public DeploymentGroup GetDeploymentGroupById() { String projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a task agent client instance VssConnection connection = Context.Connection; TaskAgentHttpClient dgClient = connection.GetClient <TaskAgentHttpClient>(); // Get deployment group by Id DeploymentGroup deploymentGroup = dgClient.GetDeploymentGroupAsync(project: projectName, deploymentGroupId: this.addedDeploymentGroupId).Result; return(deploymentGroup); }
public DeploymentGroup UpdateDeploymentGroup() { String projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a task agent client instance VssConnection connection = Context.Connection; TaskAgentHttpClient dgClient = connection.GetClient <TaskAgentHttpClient>(); // Get task group to update DeploymentGroup deploymentGroup = dgClient.GetDeploymentGroupAsync(project: projectName, deploymentGroupId: this.addedDeploymentGroupId).Result; DeploymentGroupUpdateParameter deploymentGroupUpdateParameter = new DeploymentGroupUpdateParameter { Name = deploymentGroup.Name + "-Update1", Description = "Description of this deployment group is updated" }; // Update deployment group DeploymentGroup updatedDeploymentGroup = dgClient.UpdateDeploymentGroupAsync(project: projectName, deploymentGroupId: this.addedDeploymentGroupId, deploymentGroup: deploymentGroupUpdateParameter).Result; return(updatedDeploymentGroup); }