public IList <DeploymentGroup> ListAllDeploymentGroups() { String projectName = ClientSampleHelpers.FindAnyProject(this.Context).Name; // Get a task agent client instance VssConnection connection = Context.Connection; TaskAgentHttpClient dgClient = connection.GetClient <TaskAgentHttpClient>(); // List all deployment groups IList <DeploymentGroup> deploymentGroups = dgClient.GetDeploymentGroupsAsync(project: projectName).Result; return(deploymentGroups); }
//----------------------------------------------------------------- // Configuration //----------------------------------------------------------------- public Task <List <DeploymentGroup> > GetDeploymentGroupsAsync(string projectName, string machineGroupName) { CheckConnection(); return(_taskAgentClient.GetDeploymentGroupsAsync(projectName, machineGroupName)); }