Create Aging Policy

Details

API DetailsRelease-Specific Information
CloudCenter Platform 4xCloudCenter Suite 5x
NameCreate Aging Policy
Description

Creates a new aging policy to suspend and optionally terminate deployments associated with the policy, to configure a grace period, to send notifications or reminders, and associate system tags with the deployment

Allowed Role(s)WM_USER
MethodPOST
URI

v2/agingPolicies

cloudcenter-ccm-backend/api/v2/agingPolicies

Sample Request
curl -k -X POST -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/v2/agingPolicies"
curl -k -X POST -H "Accept: application/json" -H "Content-Type: application/json" -u cliqradmin:40E45DBE57E35ECB "https://<HOST>:<PORT>/cloudcenter-ccm-backend/api/v2/agingPolicies"
Release

Introduced in CloudCenter 4.8.2

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.
  • An aging policy and the prevent termination feature cannot be used simultaneously for a deployment because both items control the terminate and suspend behavior of VMs that are mapped to a deployment.
Back To LinksCloudCenter Platform 4x APIWorkload Manager API

ESB Header

action: create.agingPolicies

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

Not applicable

Sample Request Body – Cost-Based

{
   "name":"agingPolicyCost1",
   "description":"description agingPolicyCost1",
   "enabled":true,
   "type":"COST",
   "limit":{
      "amount":100,
      "unit":"USD"
   },
   "terminateWhenPolicyEnds":false,
   "allowGracePeriodForTermination":true,
   "graceLimit":{
      "amount":1,
      "unit":"HOURS"
   },
   "allowPolicyExtension":true,
   "extensionLimit":{
      "numOfExtensions":10,
      "limitOfEachExtension":{
         "amount":10,
         "unit":"USD"
      }
   },
   "allowPolicyNotifications":true,
   "notifications":[
      {
         "template":"templateName1",
         "type":"GRACE_PERIOD",
         "enabled":true,
         "reminders":[
            {
               "amount":1,
               "unit":"HOURS"
            }
         ]
      },
      {
         "template":"templateName2",
         "type":"POLICY_EXPIRY",
         "enabled":true,
         "reminders":[
            {
               "amount":1,
               "unit":"HOURS"
            }
         ]
      }
   ]
}

Request Body – Time-Based

{
   "name":"agingPolicyTime1",
   "description":"description agingPolicyTime1",
   "enabled":true,
   "type":"TIME",
   "limit":{
      "amount":1,
      "unit":"DAYS"
   },
   "terminateWhenPolicyEnds":false,
   "allowGracePeriodForTermination":true,
   "graceLimit":{
      "amount":1,
      "unit":"HOURS"
   },
   "allowPolicyExtension":true,
   "extensionLimit":{
      "numOfExtensions":1,
      "limitOfEachExtension":{
         "amount":1,
         "unit":"DAYS"
      }
   },
   "allowPolicyNotifications":true,
   "notifications":[
      {
         "template":"templateName",
         "type":"GRACE_PERIOD",
         "enabled":true,
         "reminders":[
            {
               "amount":1,
               "unit":"HOURS"
            }
         ]
      }
   ],
   "isPolicyActiveOnResources":true
}

Response – Cost-Based

{
   "id":"11",
   "resource":"http://ccm/v2/agingPolicies/11",
   "perms":[
      "delete",
      "read",
      "write",
      "administration"
   ],
   "name":"agingPolicyCost1",
   "description":"description agingPolicyCost1",
   "enabled":true,
   "type":"COST",
   "limit":{
      "amount":100,
      "unit":"USD"
   },
   "terminateWhenPolicyEnds":false,
   "allowGracePeriodForTermination":true,
   "graceLimit":{
      "amount":1,
      "unit":"HOURS"
   },
   "allowPolicyExtension":true,
   "extensionLimit":{
      "numOfExtensions":10,
      "limitOfEachExtension":{
         "amount":10,
         "unit":"USD"
      }
   },
   "allowPolicyNotifications":true,
   "notifications":[
      {
         "template":"templateName1",
         "type":"GRACE_PERIOD",
         "enabled":true,
         "reminders":[
            {
               "amount":1,
               "unit":"HOURS"
            }
         ]
      },
      {
         "template":"templateName2",
         "type":"POLICY_EXPIRY",
         "enabled":true,
         "reminders":[
            {
               "amount":1,
               "unit":"HOURS"
            }
         ]
      }
   ],
   "isPolicyActiveOnResources":true,
   "created":1505420142155,
   "lastUpdated":1505420142155,
   "resources":[
      {
         "resourceId":"11",
         "resourceType":"JOB",
         "appliedDate":1505420501904,
         "resourceStartTime":null,
         "estimatedPolicyEndTime":null,
         "allowedCost":100,
         "accruedCost":0,
         "numberOfExtensionsUsed":0,
         "isApprovalPending":false,
         "isPreviousExtensionDenied":false,
         "isPolicyReachingExpiry":false,
         "isPolicyReachingGraceExpiry":false
      }
   ],
   "priority":4
}

Response – Time-Based

{
  "id": "10",
  "resource": "http://ccm/v2/agingPolicies/10",
  "perms": [
    "delete",
    "read",
    "write",
    "administration"
  ],
  "name": "agingPolicyTime1",
  "description": "description agingPolicyTime1",
  "enabled": true,
  "type": "TIME",
  "limit": {
    "amount": 1,
    "unit": "DAYS"
  },
  "terminateWhenPolicyEnds": false,
  "allowGracePeriodForTermination": true,
  "graceLimit": {
    "amount": 1,
    "unit": "HOURS"
  },
  "allowPolicyExtension": true,
  "extensionLimit": {
    "numOfExtensions": 1,
    "limitOfEachExtension": {
      "amount": 1,
      "unit": "DAYS"
    }
  },
  "allowPolicyNotifications": true,
  "notifications": [
    {
      "template": "templateName",
      "type": "GRACE_PERIOD",
      "enabled": true,
      "reminders": [
        {
          "amount": 1,
          "unit": "HOURS"
        }
      ]
    }
  ],
  "isPolicyActiveOnResources": true,
  "created": 1505414349817,
  "lastUpdated": 1505414349817,
  "resources": [
    {
      "resourceId": "9",
      "resourceType": "JOB",
      "appliedDate": 1505414377070,
      "resourceStartTime": 1505414053171,
      "estimatedPolicyEndTime": 1505500453171,
      "allowedCost": null,
      "accruedCost": null,
      "numberOfExtensionsUsed": 0,
      "isApprovalPending": false,
      "isPreviousExtensionDenied": false,
      "isPolicyReachingExpiry": false,
      "isPolicyReachingGraceExpiry": false
    },
    {
      "resourceId": "37",
      "resourceType": "JOB",
      "appliedDate": 1505758125998,
      "resourceStartTime": 1505757005670,
      "estimatedPolicyEndTime": 1505843405670,
      "allowedCost": null,
      "accruedCost": null,
      "numberOfExtensionsUsed": 0,
      "isApprovalPending": false,
      "isPreviousExtensionDenied": false,
      "isPolicyReachingExpiry": false,
      "isPolicyReachingGraceExpiry": false
    }
  ],
  "priority": 3
}

Request Attributes

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

type
  • Type: Enumeration

    EnumerationDescription
    COSTThe associated policy after the application deployment run has reached a designated deployment cost.
    TIMEThe associated policy after the application deployment has been running for a designated period.


reminders
  • Description: Identifies the limit to suspend or terminate a deployment when it reaches a designated deployment cost or the designated time limit.

  • Type: Sequence of time length or cost limit

    amount
    • Description: The billed amount on this invoice
    • Type: Float

    unit
    • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

    • Type: Enumeration

      EnumerationDescription
      MONTHSIdentifies if the time duration should be counted as whole months.
      DAYSIdentifies if the time duration should be counted as number of days.
      HOURSIdentifies if the time duration should be counted as hours within a day.
      USD

      Identifies if the time duration should be counted based on a US dollar limit.

      Currently, the CloudCenter platform only provides the currency limit in US dollars.

terminateWhenPolicyEnds
  • Description: Identifies if the policy is configured to be terminated when the time or cost limit is reached.

  • Type: Boolean

    • true = The policy will be terminated once the limit is reached.

    • false = Default. The policy will not be terminated once the limit is reached.

allowGracePeriodForTermination
  • Description: Identifies if a grace period is configured for a policy, so you can continue to keep deployments in a suspended state before the automated termination (terminateWhenPolicyEnds) takes place.

  • Type: Boolean

    • true = The grace period is configured for terminations.

    • false = (Default) The grace period is not configured for terminations.

graceLimit
  • Description: Identifies the configured limit to suspend or terminate a deployment when it reaches a designated deployment cost or the designated time limit.

  • Type: Sequence of time length or cost limit

    amount
    • Description: The billed amount on this invoice
    • Type: Float

    unit
    • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

    • Type: Enumeration

      EnumerationDescription
      MONTHSIdentifies if the time duration should be counted as whole months.
      DAYSIdentifies if the time duration should be counted as number of days.
      HOURSIdentifies if the time duration should be counted as hours within a day.
      USD

      Identifies if the time duration should be counted based on a US dollar limit.

      Currently, the CloudCenter platform only provides the currency limit in US dollars.

allowPolicyExtension
  • Description:Identifies if a policy extension is configured so deployment continue to run as configured.

  • Type: Boolean

    • true = A policy extension is configured.

    • false = (Default) A policy extension is not configured.

extensionLimit
  • Description: Identified the configured extensions for a policy so deployments can continue to run after adding more time/cost to permit continued runtime.

  • Type: Sequence of extension details

    numOfExtensions
    • Description: If one or more extensions are configured for the policy, the number of extensions displays, followed by the time length or cost limit of each extension. See Extensions for additional context.

    • Type: Integer

    limitOfEachExtension
    • Description: Identifies the duration of each extension as a number of units. For a policy that is to terminate a deployment after a designated deployment cost, this field identifies the additional cost that is allowed for each extension. See Extensions for additional context.

    • Type:Sequence of details for the extension limit

      amount
      • Description: The billed amount on this invoice
      • Type: Float

      unit
      • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

      • Type: Enumeration

        EnumerationDescription
        MONTHSIdentifies if the time duration should be counted as whole months.
        DAYSIdentifies if the time duration should be counted as number of days.
        HOURSIdentifies if the time duration should be counted as hours within a day.
        USD

        Identifies if the time duration should be counted based on a US dollar limit.

        Currently, the CloudCenter platform only provides the currency limit in US dollars.

allowPolicyNotifications
  • Description: Identifies if notifications are allowed for this policy. A notification is an e-mail message to a deployment owner that informs the owner that the deployment is going to terminate or suspend or that a grace period for a deployment is going to expire.

  • Type: Boolean

    • true = The system sends an email message to a deployment owner notifying the owner of changes.
    • false = Default. The system does not send an email message to a deployment owner notifying the owner of changes.

notifications
  • Description: A notification is an e-mail message to a deployment owner that informs the owner that the deployment is going to terminate or suspend or that a grace period for a deployment is going to expire.
  • Type: sequence of notification details

    template
    • DescriptionThe name assigned for this notification policyValid characters are letters, numbers, underscores, and spaces.

    • Type: String

    type
    • Description: Identifies the type of policy notification that the system sends to a deployment owner to notify the owner that the deployment is going to terminate.

    • Type: Enumeration

      EnumerationDescription
      GRACE_PERIODThe policy has a configured grace period.
      POLICY_EXPIRYThe policy has an configured expiry limit.

    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

    reminders
    • Description: Identifies the limit to suspend or terminate a deployment when it reaches a designated deployment cost or the designated time limit.

    • Type: Sequence of time length or cost limit

      amount
      • Description: The billed amount on this invoice
      • Type: Float

      unit
      • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

      • Type: Enumeration

        EnumerationDescription
        MONTHSIdentifies if the time duration should be counted as whole months.
        DAYSIdentifies if the time duration should be counted as number of days.
        HOURSIdentifies if the time duration should be counted as hours within a day.
        USD

        Identifies if the time duration should be counted based on a US dollar limit.

        Currently, the CloudCenter platform only provides the currency limit in US dollars.

Response Attributes

policyId
  • DescriptionUnique, system-generated identifier for the policy.  
    • If used as a request parameter, pass the Policy ID based on the context.
    • Pass the aging policy as a top-level policy and the scaling policy at the child job level.
    • The Policy ID is required if configured in your application profile. 
  • 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

type
  • DescriptionThe type of resource
  • Type: String

reminders
  • Description: Identifies the limit to suspend or terminate a deployment when it reaches a designated deployment cost or the designated time limit.

  • Type: Sequence of time length or cost limit

    amount
    • Description: The billed amount on this invoice
    • Type: Float

    unit
    • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

    • Type: Enumeration

      EnumerationDescription
      MONTHSIdentifies if the time duration should be counted as whole months.
      DAYSIdentifies if the time duration should be counted as number of days.
      HOURSIdentifies if the time duration should be counted as hours within a day.
      USD

      Identifies if the time duration should be counted based on a US dollar limit.

      Currently, the CloudCenter platform only provides the currency limit in US dollars.

terminateWhenPolicyEnds
  • Description: Identifies if the policy is configured to be terminated when the time or cost limit is reached.

  • Type: Boolean

    • true = The policy will be terminated once the limit is reached.

    • false = Default. The policy will not be terminated once the limit is reached.

allowGracePeriodForTermination
  • Description: Identifies if a grace period is configured for a policy, so you can continue to keep deployments in a suspended state before the automated termination (terminateWhenPolicyEnds) takes place.

  • Type: Boolean

    • true = The grace period is configured for terminations.

    • false = (Default) The grace period is not configured for terminations.

graceLimit
  • Description: Identifies the configured limit to suspend or terminate a deployment when it reaches a designated deployment cost or the designated time limit.

  • Type: Sequence of time length or cost limit

    amount
    • Description: The billed amount on this invoice
    • Type: Float

    unit
    • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

    • Type: Enumeration

      EnumerationDescription
      MONTHSIdentifies if the time duration should be counted as whole months.
      DAYSIdentifies if the time duration should be counted as number of days.
      HOURSIdentifies if the time duration should be counted as hours within a day.
      USD

      Identifies if the time duration should be counted based on a US dollar limit.

      Currently, the CloudCenter platform only provides the currency limit in US dollars.

allowPolicyExtension
  • Description:Identifies if a policy extension is configured so deployment continue to run as configured.

  • Type: Boolean

    • true = A policy extension is configured.

    • false = (Default) A policy extension is not configured.

extensionLimit
  • Description: Identified the configured extensions for a policy so deployments can continue to run after adding more time/cost to permit continued runtime.

  • Type: Sequence of extension details

    numOfExtensions
    • Description: If one or more extensions are configured for the policy, the number of extensions displays, followed by the time length or cost limit of each extension. See Extensions for additional context.

    • Type: Integer

    limitOfEachExtension
    • Description: Identifies the duration of each extension as a number of units. For a policy that is to terminate a deployment after a designated deployment cost, this field identifies the additional cost that is allowed for each extension. See Extensions for additional context.

    • Type:Sequence of details for the extension limit

      amount
      • Description: The billed amount on this invoice
      • Type: Float

      unit
      • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

      • Type: Enumeration

        EnumerationDescription
        MONTHSIdentifies if the time duration should be counted as whole months.
        DAYSIdentifies if the time duration should be counted as number of days.
        HOURSIdentifies if the time duration should be counted as hours within a day.
        USD

        Identifies if the time duration should be counted based on a US dollar limit.

        Currently, the CloudCenter platform only provides the currency limit in US dollars.

allowPolicyNotifications
  • Description: Identifies if notifications are allowed for this policy. A notification is an e-mail message to a deployment owner that informs the owner that the deployment is going to terminate or suspend or that a grace period for a deployment is going to expire.

  • Type: Boolean

    • true = The system sends an email message to a deployment owner notifying the owner of changes.
    • false = Default. The system does not send an email message to a deployment owner notifying the owner of changes.

notifications
  • Description: A notification is an e-mail message to a deployment owner that informs the owner that the deployment is going to terminate or suspend or that a grace period for a deployment is going to expire.
  • Type: sequence of notification details

    template
    • DescriptionThe name assigned for this notification policyValid characters are letters, numbers, underscores, and spaces.

    • Type: String

    type
    • Description: Identifies the type of policy notification that the system sends to a deployment owner to notify the owner that the deployment is going to terminate.

    • Type: Enumeration

      EnumerationDescription
      GRACE_PERIODThe policy has a configured grace period.
      POLICY_EXPIRYThe policy has an configured expiry limit.

    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

    reminders
    • Description: Identifies the limit to suspend or terminate a deployment when it reaches a designated deployment cost or the designated time limit.

    • Type: Sequence of time length or cost limit

      amount
      • Description: The billed amount on this invoice
      • Type: Float

      unit
      • Description: Identifies the designated number of months, days, or hours after the configured time duration is reached or the US dollar limit after the cost limit is reached.

      • Type: Enumeration

        EnumerationDescription
        MONTHSIdentifies if the time duration should be counted as whole months.
        DAYSIdentifies if the time duration should be counted as number of days.
        HOURSIdentifies if the time duration should be counted as hours within a day.
        USD

        Identifies if the time duration should be counted based on a US dollar limit.

        Currently, the CloudCenter platform only provides the currency limit in US dollars.

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.

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

resources
  • Description: Properties for this image.
  • Type: Name-Value Pair (array)

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



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