Update Job

Details

API DetailsRelease-Specific Information
CloudCenter Platform 4xCloudCenter Suite 5x
NameUpdate job
Description

Updates a CloudCenter deployment

Allowed Role(s)WM_USER
MethodPUT
URI

v2/jobs/jobid

cloudcenter-ccm-backend/api/v2/jobs/jobid

Sample Request
curl -k -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v2/jobs/22604" 
curl -k -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>cloudcenter-ccm-backend/api/v2/jobs/22604" 
Release
  • Introduced in CloudCenter 4.6
  • Enhanced in CloudCenter 4.8.2 to include three new enumerations for the supportedActions attribute (CANCEL_APPROVAL_REQUEST, EXTEND_AGE, and RESEND_APPROVAL_REQUEST).

Modified in CloudCenter Suite 5.0.0

Notes
  • Only resource owners and users with WRITE perms can view all the fields for this resource.
  • Other users can only view common fields like name, description, and so forth. See Permission Control for additional context.
  • Existing actions (prior to CloudCenter 4.8.2), SUSPEND, RESUME, PROMOTE, MIGRATE (PUT) and TERMINATE (DELETE API), can also be used for ServiceNow approval flows based on your deployment environment requirements when using ServiceNow–CloudCenter integration. See Create ServiceNow Extension for additional context and details on switching on these workflows.
Back To LinksCloudCenter Platform 4x APIWorkload Manager API

ESB Header

action: update.jobs.jobid

See the Enterprise Service Bus (ESB) section for additional context.

Not applicable

Sample Requests

a. Request Body – MARK_FAVORITE

{ "action": "MARK_FAVORITE" }

b. Request Body – REMOVE_FAVORITE

{ "action": "REMOVE_FAVORITE" }

c. Request Body –HIDE

{ "action": "HIDE" }

d. Request Body – ON_TERMINATE_PROTECTION

{ "action": "ON_TERMINATE_PROTECTION" }

e. Request Body – OFF_TERMINATE_PROTECTION

{ "action" : "OFF_TERMINATE_PROTECTION" }

f. Request Body – SCALE_UP

Provide the ID of the child job for the specific tier from where you need to scale up or down.

{
   "action" : "SCALE_UP",
   "numNodesToScale" : 2
}

g. Request Body – SCALE_DOWN

Provide the ID of the child job for the specific tier from where you need to scale up or down.

{
   "action" : "SCALE_DOWN",
   "numNodesToScale" : 2
} 

h. Request Body – SCALE_DOWN using NodeID

Provide the Node ID(s) of the VM(s) that need to be terminated.

{
    "action": "SCALE_DOWN",
    "nodeIdsToScaleDown": ["5fc3aaf0-d855-4417-8e93-426958e7a829", "ven"]
}

i. Request Body – SUSPEND (only deployments, NOT legacy jobs)

{ "action" : "SUSPEND" }

j. Request Body – RESUME (only deployments)

{ "action" : "RESUME" }

k. Request Body – RERUN

{
  "action" : "RERUN",
  "name" : "<newJobName>"   
} 

l. Request Body – UPGRADE (next version of the application)

{
  "action" : "UPGRADE",
  "appVersion": "5.0"   
}  

m. Request Body – UPDATE_TAGS

{
  "action" : "UPDATE_TAGS",
  "tagIds": [1, 4, 5]   
} 

n. Request Body – PROMOTE (from the CCM) – Sample payload for Amazon cloud

{
    "appId": "75",
    "appVersion": "1.0",
    "name": "JenkinsT7SingleTier_Dep_z",
    "environmentId": 3,
    "action": "PROMOTE",
    "keepExistingDeployment": false,
    "parameters": {
        "cloudParams": {
        }
    },
    "jobs": [{
        "tierId": "76",
        "parameters": {
            "appParams": [],
            "cloudParams": {
                "cloudRegionId": 1,
                "instance": "m1.small",
                "cloudProperties": [{
                    "name": "vpcId",
                    "value": "vpc-cedaf6ab"
                }],
                "nics": [{
                    "id": "subnet-07a39362",
                    "allocationMode": "DHCP",
                    "allocatePublicIp": true,
                    "order": 1
                }]
            }
        }
    }]
} 

o. Request Body – MIGRATE (from the CCM) – Sample payload for Amazon cloud

{
    "appId": "75",
    "appVersion": "1.0",
    "name": "JenkinsT7SingleTier_Dep_z",
    "environmentId": 3,
    "action": "MIGRATE",
    "keepExistingDeployment": false,
    "parameters": {
        "cloudParams": {}
    },
    "jobs": [{
        "tierId": "76",
        "parameters": {
            "appParams": [],
            "cloudParams": {
                "cloudRegionId": 1,
                "instance": "m1.small",
                "cloudProperties": [{
                    "name": "vpcId",
                    "value": "vpc-cedaf6ab"
                }],
                "nics": [{
                    "id": "subnet-07a39362",
                    "allocationMode": "DHCP",
                    "allocatePublicIp": true,
                    "order": 1
                }]
            }
        }
    }]
}

p. Request Body – PROMOTE (CICD Projects) – Sample payload for Amazon cloud

{
    "appId": "29",
    "appVersion": "1.0",
    "action": "PROMOTE",
    "name": "Jenkins_902_promote",
    "keepExistingDeployment": false,
    "projectId": 1,
    "phaseId": 2,
    "parameters": {
        "cloudParams": {
        }
    },
    "jobs": [{
        "tierId": "30",
        "parameters": {
            "appParams": [],
            "cloudParams": {
                "cloudRegionId": 1,
                "instance": "m1.small",
                "cloudProperties": [{
                    "name": "vpcId",
                    "value": "vpc-ed1e1c88"
                }],
                "nics": [{
                    "id": "subnet-01306d76",
                    "allocationMode": "DHCP",
                    "allocatePublicIp": true,
                    "order": 1
                }]
            }
        }
    }]
} 

q. Request Body – DEMOTE – Sample payload for Amazon cloud

{
    "appId": "29",
    "appVersion": "1.0",
    "action": "DEMOTE",
    "name": "Jenkins_902_promote",
    "keepExistingDeployment": false,
    "projectId": 1,
    "phaseId": 2,
    "parameters": {
        "cloudParams": {}
    },
    "jobs": [{
        "tierId": "30",
        "parameters": {
            "appParams": [],
            "cloudParams": {
                "cloudRegionId": 1,
                "cloud": "Amazon-us-west-2",
                "instance": "m1.small",
                "cloudProperties": [{
                    "name": "vpcId",
                    "value": "vpc-ed1e1c88"
                }],
                "nics": [{
                    "id": "subnet-01306d76",
                    "allocationMode": "DHCP",
                    "allocatePublicIp": true,
                    "order": 1
                }]
            }
        }
    }]
}

r. Request Body – APPROVE

{ "action": "APPROVE"}

s. Request Body – REJECT

{ "action": "DENY" }

t. Request Body – RESEND_APPROVAL_REQUEST (ServiceNow Workflow)

{ "action": "RESEND_APPROVAL_REQUEST" }

u. Request Body – EXTEND_AGE (Aging Policy)

{ "action" : "EXTEND_AGE" }

Request Attributes

jobId
  • DescriptionUnique, system-generated identifier for the job
  • Type: String
supportedActions
  • Description: Identifies the supported actions for each deployment. Users can perform several functions based on their deployment permissions.

    The User Privilege (see perms and Permission Control) and Job Status (see Deployment and VM States) determine the supported actions for each user. For example:

    • User Privilege: If you only have View privileges, you can only view (GET) the job details, you cannot manage the jobs/deployments.
    • Job Status: You can only see the RESUME option if the job/deployment is in a SUSPENDED state.

  • Type: Enumeration

    Enumeration Description
    APPROVEApprove a deployment request.
    CANCEL_APPROVAL_REQUESTCancel the current approval request for a ServiceNow workflow.
    DEMOTEDemote a deployment.
    DENYDeny a deployment request.
    EXTEND_AGEExtend the age of the Aging Policy attached to the job.
    HIDEJust hide this job (for jobs with Errors)
    MARK_FAVORITEMark a job or deployment as a favorite (see Deployments > Favorite Deployments for additional context)
    MIGRATE

    Migrate deployment – provide the following block for promoting the application:

    PUT https://<CCM HOST NAME>:<PORT>/v2/jobs/{jobId}

    Points to be noted if approval is required:

    • The MIGRATE request triggers an automatic backup process.
    • Migrate is not supported for Project-based deployments.
    • If Rejected when approval is required, no change – deployment continues to run.
    • If Approved and:
      • Successful (deployed) – Deployment is terminated (if requested via the keepExistingDeployment=true setting).
      • Migrate Fails – Deployment is suspended.
    ON_TERMINATE_PROTECTION Prevent an inadvertent stoppage from the CloudCenter platform and thus avoid interrupting production deployments by turning on the preventTermination feature. See Termination for additional context.
    OFF_TERMINATE_PROTECTION Turn off the preventTermination feature. See Termination for additional context.
    PROMOTE

    Promote a deployment – provide the following block for promoting the application:

    PUT https://<CCM HOST NAME>:<PORT>/v2/jobs/{jobId}

    Points to be noted if approval is required:

    • The PROMOTE request does not trigger a backup process.
    • If Rejected, no change – Deployment continues to run.
    • If Approved and:
      • Successful (deployed) – Deployment is terminated (if requested via the keepExistingDeployment=true setting).
      • Fails – deployment is suspended
    REMOVE_FAVORITEUn-marks a job or deployment as a favorite (see Deployments > Favorite Deployments for additional context)
    RERUNRerun the deployment – valid only for batch jobs.
    RESEND_APPROVAL_REQUESTResend the approval request for a ServiceNow workflow to the ServiceNow admin.
    RESUMEResume a deployment – valid only for deployments.
    STARTStart a deployment.
    STOPStop a deployment – valid for both deployments and legacy jobs. It just stops the deployment (or) job.
    SUSPEND Suspend a deployment – valid only for deployments and not legacy jobs
    TERMINATETerminate a deployment.
    TERMINATE_AND_HIDETerminates and hides the deployment.

    UPDATE_TAGS

    Update tags as part of Job. If Governance mode is ON, Security profiles, policies (Aging, Scaling policies) can be updated (Update involves update, creation, deletion). See Governance for additional context.
    UPGRADEUpgrade a deployment to the next version – provide the next version of the Application to be upgraded.

numNodesToScale
  • Description: The number of nodes within each tier in use to ensure manual or automatic scaling.
  • Type: Long
  • Default = 1

Optional.

nodeIdsToScaleDown
  • Description: The ID of the nodes that need to be terminated to ensure manual or automatic scale down.
  • Type: String

Optional.

appVersion
  • Description: The application build version with which a new job is started. If the appVersion is not specified, the latest application build version is used.

  • Type: String
name
  • DescriptionThe name assigned for this CloudCenter ResourceValid characters are letters, numbers, underscores, and spaces.

  • Type: String

tagIds
  • Description: A list of tag identifiers associated (or) to be associated with this resource. Each tag is represented by a System Tag ID.
  • Type: Long (list)
  • Example: "tagIds": [1, 5]

Response Attributes

None.




© 2017-2019 Cisco Systems, Inc. All rights reserved