Update an environment

Request

PUT https://{hostname}:{port}
    /cli/environment/update?{parameters}
Accept: {contentType}
Table 1. Request parameters
Parameter Type Required Description
environment string true Name or ID of the environment
application string false Name or ID of the application; this value is required if you specify the environment name instead of ID
Table 2. Header parameters
Parameter Type Required Description
Accept
  • application/json
  • application/yaml
true
This command takes a JSON request string or file. Use the following template for the request:
{
  "applicationId": "Application ID associated with the 
  Environment template.",
  "cleanupCountToKeep": "Number of most recently deployed 
  versions to keep (optional)",
  "cleanupDaysToKeep": "Number of days to keep versions 
  deployed to this environment (optional)",
  "color": "HTML color code for the environment (optional)",
  "description": "Description (optional)",
  "exemptProcessesArray": "An array of process Ids. These 
  processes will be exempt from approvals for this 
  environment (optional).",
  "externalApprovalAgent": "Name or id of agent to run 
  external approval processes on (optional).",
  "externalApprovalAgentPool": "Name or id of agent pool 
  to run external approval processes on (optional).",
  "externalApprovalProcess": "Name or id of external 
  approval process(optional).",
  "historyCleanupDaysToKeep": "Number of days to keep 
  application process history for this environment 
  (optional)",
  "inheritSystemCleanup": "Inherit the system cleanup 
  settings. If set to true, this overrides the other cleanup 
  attributes. (optional, boolean)",
  "lockSnapshots": "Whether snapshots will be locked when 
  deployed to this environment (optional)",
  "name": "Environment name",
  "noSelfApprovals": "When this option is selected, users 
  that submit deployment requests cannot approve their own 
  requests (optional)",
  "requireApprovals": "Whether approvals will be required 
  (optional)",
  "requireSnapshot": "If enabled, all deployments must use 
  a snapshot instead of loose versions (optional)",
  "snapshotDaysToKeep": "Number of days to keep snapshots 
  deployed to this environment (optional)",
  "teamMappings": [{
    "resourceRoleId": "Id of Resource Type to apply to 
  this team mapping (optional, can specify either this or 
  resourceRoleLabel",
    "resourceRoleLabel": "Name of Resource Type to apply 
  to this team mapping (optional, can specify either this or 
  resourceRoleId",
    "teamId": "ID of a team, either this field or 
  teamLabel are needed to specify a team",
    "teamLabel": "Name of the team to map the environment 
  to, either this field or teamId are needed to specify a 
  team"
  }],
  "useSystemDefaultDays": "Whether or not to use the 
  system default number of days to keep application process 
  history for this environment (optional)"
}

Related CLI command: updateEnvironment.