Update Suspension Policy or Policies

Details

API DetailsRelease-Specific Information
CloudCenter Platform 4xCloudCenter Suite 5x
NameUpdate Suspension Policy or Policies
Description


Update priorities on all suspension properties as a bulk operation or updates an existing suspension policy (to update schedules for when a deployment should be in Running state, update or add blockout dates, during which the deployment is suspended all day)

Allowed Role(s)WM_USER
MethodPUT
URI
  • v2/suspensionPolicies
  • v2/suspensionPolicies/policyId
  • cloudcenter-ccm-backend/api/v2/suspensionPolicies
  • cloudcenter-ccm-backend/api/v2/suspensionPolicies/policyId
Sample Request
curl -k -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v2/suspensionPolicies"
curl -k -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/cloudcenter-ccm-backend/api/v2/suspensionPolicies"
Release
  • Introduced in CloudCenter 4.8.2.
  • Enhanced in CloudCenter 4.9.1 to include the estimatedSavingsPercentage element

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.
Back To LinksCloudCenter Platform 4x APIWorkload Manager API

ESB Header

  • action: update.suspensionPolicies
  • action: update.suspensionPolicies.policyId

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

Not applicable

Sample 1 – Update Priorities Request Body

{
	"action":"UPDATE_PRIORITIES",
	"orderedPolicyIds":["5","6"]
}

Response – The priority parameter reflects your requested order

{
    "resource": "http://ccm/v2/suspensionPolicies/",
    "size": 1,
    "pageNumber": 0,
    "totalElements": 1,
    "totalPages": 1,
    "policies": [
        {
            "id": "9",
            "resource": "http://ccm/v2/suspensionPolicies/9",
            "perms": [
                "read"
            ],
            "name": "Forth-policy1",
            "description": "Forth-policy-description1",
            "enabled": true,
            "schedules": [
                {
                    "type": "DAILY",
                    "days": [
                        "WED"
                    ],
                    "startTime": "12:00",
                    "endTime": "15:00",
                    "repeats": "1"
                }
            ],
            "blockoutPeriods": [
                {
                    "startDate": "2017-12-25",
                    "endDate": "2017-12-31"
                }
            ],
            "isPolicyActiveOnResources": "",
            "resourcesMaps": [],
            "priority": 1,
            "created": 1505194048950,
            "lastUpdated": 1505194048950,
            "ownerId": 2,
            "estimatedSavingsPercentage": 62.5
        },
        {
            "id": "10",
            "resource": "http://ccm/v2/suspensionPolicies/10",
            "perms": [
                "read"
            ],
            "name": "Forth-policy1",
            "description": "Forth-policy-description1",
            "enabled": true,
            "schedules": [
                {
                    "type": "DAILY",
                    "days": [
                        "WED"
                    ],
                    "startTime": "12:00",
                    "endTime": "15:00",
                    "repeats": "1"
                }
            ],
            "blockoutPeriods": [
                {
                    "startDate": "2017-12-25",
                    "endDate": "2017-12-31"
                }
            ],
            "isPolicyActiveOnResources": "",
            "resourcesMaps": [],
            "priority": 2,
            "created": 1505194048990,
            "lastUpdated": 1505194048990,
            "ownerId": 2,
            "estimatedSavingsPercentage": 32.3
        }
    ]
}

Example 2 – Update a Time-Based suspension Policy

curl -k -X PUT -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v2/suspensionPolicies"

Request Body

{
    "name": "Forth-policy1",
    "description": "Forth-policy-description1",
    "enabled": true,
    "schedules": [
        {
            "type": "DAILY",
            "days": [
                "WED"
            ],
            "startTime": "12:00",
            "endTime": "15:00",
            "repeats": "1"
        }
    ],
    "blockoutPeriods": [
        {
            "startDate": "2017-12-25",
            "endDate": "2017-12-31"
        }
    ],
    "resourcesMaps": []
}

Response

{
    "id": "9",
    "resource": "http://ccm/v2/suspensionPolicies/9",
    "perms": [
        "read"
    ],
    "name": "Forth-policy1",
    "description": "Forth-policy-description1",
    "enabled": true,
    "schedules": [
        {
            "type": "DAILY",
            "days": [
                "WED"
            ],
            "startTime": "12:00",
            "endTime": "15:00",
            "repeats": "1"
        }
    ],
    "blockoutPeriods": [
        {
            "startDate": "2017-12-25",
            "endDate": "2017-12-31"
        }
    ],
    "isPolicyActiveOnResources": false,
    "resourcesMaps": [
        {
            "resourceId": "11",
            "resourceType": "JOB",
            "appliedDate": 1505420501904,
            "resourceStartTime": null,
            "estimatedPolicyEndTime": null,
            "allowedCost": null,
            "accruedCost": null,
            "numberOfExtensionsUsed": 0,
            "isApprovalPending": false,
            "isPreviousExtensionDenied": false,
            "isPolicyReachingExpiry": false,
            "isPolicyReachingGraceExpiry": false
        }
    ],
    "priority": 1,
    "created": 1505194048950,
    "lastUpdated": 1505194048950,
    "ownerId": 2,
    "estimatedSavingsPercentage": 62.5
}

Request Attributes

action
  • Description: Identifies a bulk action that changes the action executed one or more policies that have already been configured.

  • Type: Enumeration

    EnumerationDescription
    UPDATE_PRIORITIESOnly policies that the tenant administrator creates are used in governance mode and only the tenant administrator can change the priority of these policies.

orderedPolicyIds
  • Description: Identifies the order in which the policies must be ordered. Specify the policyId for each policy as a comma-separated list with each policyId listed in double quotes in the required order. If you want policyId "7" to appear first and policyId "2" to appear next, provide "7","2" as the ordered priority for these two policies.

    • Provide all IDs for all policies that are available for this tenant.
    • If you skip one or more IDs and do not include all the IDs in this list, the API request results in an error.
  • Type: String

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

  • Type: String

description
  • DescriptionA brief description for this CloudCenter Resource.

  • Type: String

enabled
  • Description: Indicates that this resource has been enabled. The default differs based on the resource.

    • true = The resource has been enabled (v2 aging and suspension policies are enabled by default).

    • false = The resource has not been enabled.

  • Type: Boolean

schedules
  • Description: Schedule settings for this policy.

  • Type: Sequence of schedule details

    type
    • Description: Identifies the frequency of the suspension.

    • Type: Enumeration

      EnumerationDescription
      DAILYThe policy should put the deployment in the Running state every day during the designated start time through end time period.
      WEEKLYIdentifies specific days during the week when the policy should put the deployment in the Running state.

    days
    • Description: Identifies the frequency of the weekly suspension based on the identified day(s).

    • Type: Enumeration

      EnumerationDescription
      MONIdentifies that the policy should put the deployment in the Running state each Monday.
      TUEIdentifies that the policy should put the deployment in the Running state each Tuesday.
      WEDIdentifies that the policy should put the deployment in the Running state each Wednesday.
      THURIdentifies that the policy should put the deployment in the Running state each Thursday.
      FRIIdentifies that the policy should put the deployment in the Running state each Friday.
      SATIdentifies that the policy should put the deployment in the Running state each Saturday.
      SUNIdentifies that the policy should put the deployment in the Running state each Sunday.

    startTime

    endTime

    repeats
    • Description: Identifies the number of times to repeat requests in JMeter.
    • Type: Long

blockoutPeriods

resourcesMaps
  • Description: Identifies details about the resource that needs to be configured for this policy.

  • Type: Sequence of resource details

    resourceId
    • Description: Unique identifier for a CloudCenter Resource managed by ACLs. This ID is generated automatically by the CloudCenter platform when the resource is created.  
    • Type: String

    resourceType
    • Description: The data type for a CloudCenter Resource.

    • Type: Enumeration

      StringCategory
      JOBIdentifies the resource to be a job or deployment

    appliedDate
    • Description: The date that is applied to the policy associated with this resource.

    • Type: Long

    resourceStartTime
    • Description:The start time for the policy enforcement for this resource.

    • Type: Long

    estimatedPolicyEndTime
    • Description:The estimated end time for the policy enforcement for this resource.

    • Type: Long

    allowedCost
    • Description: For a policy that is to terminate a deployment after a designated deployment cost, this attribute identifies the additional cost that is allowed for each extension

    • Type: Decimal

    accruedCost
    • Description: For a policy that is to terminate a deployment after a designated deployment cost, this attribute identifies the additional cost that is accrued.

      If a policy specifies a time or cost that is less that what has accrued for the deployment, the policy is not available.

    • Type: Decimal

    numberOfExtensionsUsed
    • Description: If one or more extensions are configured for the policy, the number of extensions appears, followed by the time length or cost limit of each extension, in parentheses

    • Type: Integer

    isApprovalPending
    • Description: Identifies if approvals is pending for a deployment submission or action.

    • Type: Boolean

      • true =Approval is pending

      • false =Default. Approval is not pending

    isPreviousExtensionDenied
    • Description:You also can add  extensions to a policy, which allows deployments to keep running as needed. This field identifies if one such request for an extension was denied.

    • Type: Boolean

      • true = A precious request for an extension was denied

      • false =Default. No extension was denied.

    isPolicyReachingExpiry
    • Description: Identifies if a policy is reaching it expiry date after the deployment has been running for a designated period of time term 

    • Type: Boolean

      • true = They policy  is going to expire

      • false =Default. The policy expiration is not in effect.

    isPolicyReachingGraceExpiry
    • Description:You can configure how far in advance of a termination or grace period expiration the system sends the message, and you can send additional messages as reminders. This field identifies if a configured grace period for a policy is going to expire.

    • Type: Boolean

      • true = They policy's grace period is going to expire

      • false =Default. The policy's grace period is not in effect.

Response Attributes

id
  • DescriptionUnique, system-generated identifier for this CloudCenter Resource.

  • Type: String

resource
  • Description: Unique URL to access this resource.
  • Type: String

perms (click for additional details)

policies
  • Description: Identifies information for each suspension policy.

  • Type: Array of policies

    id
    • DescriptionUnique, system-generated identifier for this CloudCenter Resource.

    • Type: String
    resource
    • Description: Unique URL to access this resource.
    • Type: String
    perms (click for additional details)

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

    • Type: String

    description
    • DescriptionA brief description for this CloudCenter Resource.

    • Type: String

    enabled
    • Description: Indicates that this resource has been enabled. The default differs based on the resource.

      • true = The resource has been enabled (v2 aging and suspension policies are enabled by default).

      • false = The resource has not been enabled.

    • Type: Boolean

    schedules
    • Description: Schedule settings for this policy.

    • Type: Sequence of schedule details

      type
      • Description: Identifies the frequency of the suspension.

      • Type: Enumeration

        EnumerationDescription
        DAILYThe policy should put the deployment in the Running state every day during the designated start time through end time period.
        WEEKLYIdentifies specific days during the week when the policy should put the deployment in the Running state.

      days
      • Description: Identifies the frequency of the weekly suspension based on the identified day(s).

      • Type: Enumeration

        EnumerationDescription
        MONIdentifies that the policy should put the deployment in the Running state each Monday.
        TUEIdentifies that the policy should put the deployment in the Running state each Tuesday.
        WEDIdentifies that the policy should put the deployment in the Running state each Wednesday.
        THURIdentifies that the policy should put the deployment in the Running state each Thursday.
        FRIIdentifies that the policy should put the deployment in the Running state each Friday.
        SATIdentifies that the policy should put the deployment in the Running state each Saturday.
        SUNIdentifies that the policy should put the deployment in the Running state each Sunday.

      startTime

      endTime

      repeats
      • Description: Identifies the number of times to repeat requests in JMeter.
      • Type: Long

    blockoutPeriods

    isPolicyActiveOnResources
    • Description: Identifies if the policy is active for the resource for which the policy is enforced

    • Type:

      • true = The policy is active for resources.

      • false = Default. The policy is not active for resources.

    resourcesMaps
    • Description: Identifies details about the resource that needs to be configured for this policy.

    • Type: Sequence of resource details

      resourceId
      • Description: Unique identifier for a CloudCenter Resource managed by ACLs. This ID is generated automatically by the CloudCenter platform when the resource is created.  
      • Type: String

      resourceType
      • Description: The data type for a CloudCenter Resource.

      • Type: Enumeration

        StringCategory
        JOBIdentifies the resource to be a job or deployment

      appliedDate
      • Description: The date that is applied to the policy associated with this resource.

      • Type: Long

      resourceStartTime
      • Description:The start time for the policy enforcement for this resource.

      • Type: Long

      estimatedPolicyEndTime
      • Description:The estimated end time for the policy enforcement for this resource.

      • Type: Long

      allowedCost
      • Description: For a policy that is to terminate a deployment after a designated deployment cost, this attribute identifies the additional cost that is allowed for each extension

      • Type: Decimal

      accruedCost
      • Description: For a policy that is to terminate a deployment after a designated deployment cost, this attribute identifies the additional cost that is accrued.

        If a policy specifies a time or cost that is less that what has accrued for the deployment, the policy is not available.

      • Type: Decimal

      numberOfExtensionsUsed
      • Description: If one or more extensions are configured for the policy, the number of extensions appears, followed by the time length or cost limit of each extension, in parentheses

      • Type: Integer

      isApprovalPending
      • Description: Identifies if approvals is pending for a deployment submission or action.

      • Type: Boolean

        • true =Approval is pending

        • false =Default. Approval is not pending

      isPreviousExtensionDenied
      • Description:You also can add  extensions to a policy, which allows deployments to keep running as needed. This field identifies if one such request for an extension was denied.

      • Type: Boolean

        • true = A precious request for an extension was denied

        • false =Default. No extension was denied.

      isPolicyReachingExpiry
      • Description: Identifies if a policy is reaching it expiry date after the deployment has been running for a designated period of time term 

      • Type: Boolean

        • true = They policy  is going to expire

        • false =Default. The policy expiration is not in effect.

      isPolicyReachingGraceExpiry
      • Description:You can configure how far in advance of a termination or grace period expiration the system sends the message, and you can send additional messages as reminders. This field identifies if a configured grace period for a policy is going to expire.

      • Type: Boolean

        • true = They policy's grace period is going to expire

        • false =Default. The policy's grace period is not in effect.

    priority
    • Description: When you associate System Tags with an application deployment tier, the CloudCenter platform evaluates all rules that are mapped to the system tags to choose the aging policy. If more than one aging policy is available, the rule evaluation chooses the aging policy with the highest priority. This option is available only if Governance Rules is turned on. A value of 1 represents the highest priority

    • Type: long

    created
    • Description: The date that this resource or favorite was created (system generated). This is a read-only attribute and cannot be configured.
    • Type: Long

    lastUpdated
    • Description: Date that this resource was last updated. This attribute is the same as the lastUpdatedTime attribute.

    • Type: Long

    ownerId
    • DescriptionUnique, system-generated identifier for a resource owner in the CloudCenter platform.
    • Type: String

    estimatedSavingsPercentage
    • Description: Estimates the savings percentage and is updated whenever schedule type/scheduled days, start time/end time of schedule are changed. Blockout dates are not used in this calculation as the time frame is indeterminate.

    • Type: Float

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