コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }