Package org.azd.core
Class CoreApi
- All Implemented Interfaces:
CoreDetails
Core class to manage core API
-
Constructor Summary
ConstructorDescriptionCoreApi
(Connection connection) Pass the connection object to work with Core Api -
Method Summary
Modifier and TypeMethodDescriptioncreateProject
(String projectName, String description) Creates a default scrum projectcreateProject
(String projectName, String description, String sourceControlType, String templateTypeId) Creates a project for given process idcreateTeam
(String projectName, String teamName) Create a team in a team project.deleteProject
(String projectId) Queues a project to be deleted.deleteTeam
(String projectName, String teamName) Delete a team.featureToggle
(String projectId, FeatureManagement feature, boolean state) Set project feature state for project service SeeFeatureManagement
for list of featuresgetFeatureState
(String projectId, FeatureManagement feature) Call un-published API feature to fetch project service feature state.Get a list of processes.getProject
(String projectName) Get project with the specified id or namegetProject
(String projectName, boolean includeCapabilities, boolean includeHistory) Get project with the specified id or name with optional parametersgetProjectProperties
(String projectId) Get a collection of team project properties.Get all projects in the organization that the authenticated user has access to.getProjects
(Integer skip, Integer top, Number continuationToken, Boolean getDefaultTeamImageUrl, ProjectState stateFilter) Get all projects in the organization that the authenticated user has access to.Get a specific team.Get a specific team.getTeams()
Get a list of all teams.getTeams
(boolean expandIdentity, boolean mine, int skip, int top) Get a list of all teams.updateProject
(String projectId, Project projectParameters) Update an existing project's name, abbreviation, description, or restore a project.updateTeams
(String projectName, String teamName, String description) Update a team's name and/or description.Methods inherited from class org.azd.utils.AzDAsyncApi
createAsync
-
Constructor Details
-
CoreApi
Pass the connection object to work with Core Api- Parameters:
connection
- Connection object
-
-
Method Details
-
getProcesses
Get a list of processes.- Specified by:
getProcesses
in interfaceCoreDetails
- Returns:
- a list of processes
Processes
- Throws:
AzDException
- Default Api Exception handler.
-
createProject
Creates a default scrum project- Specified by:
createProject
in interfaceCoreDetails
- Parameters:
projectName
- pass the project namedescription
- pass the description for the project- Returns:
- object with link to the project
- Throws:
AzDException
- Default Api Exception handler.
-
createProject
public OperationReference createProject(String projectName, String description, String sourceControlType, String templateTypeId) throws AzDException Creates a project for given process id- Specified by:
createProject
in interfaceCoreDetails
- Parameters:
projectName
- pass the project namedescription
- project descriptionsourceControlType
- type of version controltemplateTypeId
- pass the process id. Run getProcesses to get the list of process id- Returns:
- object with link to the project
- Throws:
AzDException
- Default Api Exception handler.
-
deleteProject
Queues a project to be deleted.You should pass the project id to delete it. Passing the project name won't delete. To get the project id run getProject() with projectName and get the Id.
- Specified by:
deleteProject
in interfaceCoreDetails
- Parameters:
projectId
- pass the project id- Returns:
- object of deleted project with url
- Throws:
AzDException
- Default Api Exception handler.
-
getProject
Get project with the specified id or name- Specified by:
getProject
in interfaceCoreDetails
- Parameters:
projectName
- pass the project name or id- Returns:
- project object
Project
- Throws:
AzDException
- Default Api Exception handler.
-
getProject
public Project getProject(String projectName, boolean includeCapabilities, boolean includeHistory) throws AzDException Get project with the specified id or name with optional parameters- Specified by:
getProject
in interfaceCoreDetails
- Parameters:
projectName
- pass the project name or idincludeCapabilities
- Include capabilities (such as source control) in the team project result (default: false).includeHistory
- Search within renamed projects (that had such name in the past).- Returns:
- project object
Project
- Throws:
AzDException
- Default Api Exception handler.
-
getProjectProperties
Get a collection of team project properties.- Specified by:
getProjectProperties
in interfaceCoreDetails
- Parameters:
projectId
- provide the project guid not the project name- Returns:
- ProjectProperties
ProjectProperties
- Throws:
AzDException
- Default Api Exception handler.
-
getProjects
Get all projects in the organization that the authenticated user has access to.- Specified by:
getProjects
in interfaceCoreDetails
- Returns:
- array of projects
Projects
- Throws:
AzDException
- Default Api Exception handler.
-
getProjects
public Projects getProjects(Integer skip, Integer top, Number continuationToken, Boolean getDefaultTeamImageUrl, ProjectState stateFilter) throws AzDException Get all projects in the organization that the authenticated user has access to.- Specified by:
getProjects
in interfaceCoreDetails
- Parameters:
skip
- specify how many projects to skiptop
- specify the number projects to retrievecontinuationToken
- specify the next value to retrievegetDefaultTeamImageUrl
- if true gets the default team image urlstateFilter
- allowed values are [all, createPending, deleted, deleting, new, unchanged, wellFormed]- Returns:
- array of projects
Projects
- Throws:
AzDException
- Default Api Exception handler.
-
updateProject
public OperationReference updateProject(String projectId, Project projectParameters) throws AzDException Update an existing project's name, abbreviation, description, or restore a project.- Specified by:
updateProject
in interfaceCoreDetails
- Parameters:
projectId
- pass the project idprojectParameters
- HashMap of project parameters to be updated.Refer "https://docs.microsoft.com/en-us/rest/api/azure/devops/core/projects/update?view=azure-devops-rest-6.1"
- Returns:
- an object or team project with url
- Throws:
AzDException
- Default Api Exception handler.
-
createTeam
Create a team in a team project.- Specified by:
createTeam
in interfaceCoreDetails
- Parameters:
projectName
- project name or GUIDteamName
- pass the team name- Returns:
- returns web api object
- Throws:
AzDException
- Default Api Exception handler.
-
deleteTeam
Delete a team.- Specified by:
deleteTeam
in interfaceCoreDetails
- Parameters:
projectName
- pass the project name or idteamName
- pass the team name- Throws:
AzDException
- Default Api Exception handler.
-
getTeam
Get a specific team.- Specified by:
getTeam
in interfaceCoreDetails
- Parameters:
projectName
- pass the project name or idteamName
- pass the team name- Returns:
- team object
- Throws:
AzDException
- Default Api Exception handler.
-
getTeam
public WebApiTeam getTeam(String projectName, String teamName, boolean expandIdentity) throws AzDException Get a specific team.- Specified by:
getTeam
in interfaceCoreDetails
- Parameters:
projectName
- pass the project name or idteamName
- pass the team nameexpandIdentity
- if true gets the identity object- Returns:
- team object
- Throws:
AzDException
- Default Api Exception handler.
-
getTeams
Get a list of all teams.- Specified by:
getTeams
in interfaceCoreDetails
- Returns:
- array of team
- Throws:
AzDException
- Default Api Exception handler.
-
getTeams
public WebApiTeams getTeams(boolean expandIdentity, boolean mine, int skip, int top) throws AzDException Get a list of all teams.- Specified by:
getTeams
in interfaceCoreDetails
- Parameters:
expandIdentity
- if true gets the identity objectmine
- if true gets the team to which user has access toskip
- pass to skip number of teamstop
- pass to retrieve number of teams- Returns:
- array of team
- Throws:
AzDException
- Default Api Exception handler.
-
updateTeams
public WebApiTeam updateTeams(String projectName, String teamName, String description) throws AzDException Update a team's name and/or description.- Specified by:
updateTeams
in interfaceCoreDetails
- Parameters:
projectName
- The name or ID (GUID) of the team project containing the team to update.teamName
- The name or ID of the team to update.description
- provide the description for your team to update- Returns:
- team object
WebApiTeam
- Throws:
AzDException
- Default Api Exception handler.
-
getFeatureState
public Optional<Boolean> getFeatureState(String projectId, FeatureManagement feature) throws AzDException Call un-published API feature to fetch project service feature state. SeeFeatureManagement
for current list of features. Besides an 'enabled' and 'disabled' state, there is also an undefined state, hence the Optional return wrapper- Specified by:
getFeatureState
in interfaceCoreDetails
- Parameters:
projectId
- project identifierfeature
- FeatureManagement enum type for which to return state- Returns:
- Optional wrapped boolean, empty if state is undefined
- Throws:
AzDException
- Default Api Exception handler
-
featureToggle
public ProjectFeature featureToggle(String projectId, FeatureManagement feature, boolean state) throws AzDException Set project feature state for project service SeeFeatureManagement
for list of features- Specified by:
featureToggle
in interfaceCoreDetails
- Parameters:
projectId
- project identifierfeature
- enum value for feature to enable or disablestate
- enable or disable feature- Returns:
- object containing feature id and state
- Throws:
AzDException
- Default Api Exception handler
-