View Aging Policies

Details

API DetailsRelease-Specific Information
CloudCenter Platform 4xCloudCenter Suite 5x
NameGet Aging Policies
Description

Displays a list of aging policies or a the specified aging policy (or policies) based on the queried parameters

Allowed Role(s)WM_USER
MethodGET
URI
  • v2/agingPolicies
  • v2/agingPolicies/policyId
  • v2/agingPolicies?hideNonAdminPolicies=true
  • v2/agingPolicies?tags=true
  • cloudcenter-ccm-backend/api/v2/agingPolicies
  • cloudcenter-ccm-backend/api/v2/agingPolicies/policyId
  • cloudcenter-ccm-backend/api/v2/agingPolicies?hideNonAdminPolicies=true
  • cloudcenter-ccm-backend/api/v2/agingPolicies?tags=true
Sample Request
curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/v2/agingPolicies?size=0&hideNonAdminPolicies=true 
curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/cloudcenter-ccm-backend/api/v2/agingPolicies?size=0&hideNonAdminPolicies=true 
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.
Back To LinksCloudCenter Platform 4x APIWorkload Manager API

ESB Header

  • action: get.agingPolicies
  • action: get.agingPolicies.policyId
  • action: get.agingPolicies
    actionparam: hideNonAdminPolicies=true&tags=true

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

Not applicable

Sample 1 – Admin-Created Aging Policies Response

{
   "resource":"https://<HOST>:<PORT>/v2/agingPolicies?size=0&hideNonAdminPolicies=true",
   "size":2,
   "pageNumber":0,
   "totalElements":2,
   "totalPages":1,
   "policies":[
      {
         "id":"2",
         "resource":"https://<HOST>:<PORT>/v2/agingPolicies/2",
         "perms":[
            "administration",
            "write",
            "delete",
            "read"
         ],
         "name":"SomePolicy",
         "description":"",
         "enabled":true,
         "type":"TIME",
         "limit":{
            "amount":1,
            "unit":"MONTHS"
         },
         "terminateWhenPolicyEnds":false,
         "allowGracePeriodForTermination":false,
         "graceLimit":null,
         "allowPolicyExtension":false,
         "extensionLimit":null,
         "allowGracePeriodNotification":false,
         "allowPolicyExpiryNotification":false,
         "notifications":[

         ],
         "isPolicyActiveOnResources":false,
         "created":1516953892905,
         "lastUpdated":1516953892905,
         "resources":[

         ],
         "priority":1,
         "ownerId":2
      },
      {
         "id":"1",
         "resource":"https://<HOST>:<PORT>/v2/agingPolicies/1",
         "perms":[
            "administration",
            "write",
            "delete",
            "read"
         ],
         "name":"SomePolicy",
         "description":"",
         "enabled":true,
         "type":"TIME",
         "limit":{
            "amount":1,
            "unit":"DAYS"
         },
         "terminateWhenPolicyEnds":false,
         "allowGracePeriodForTermination":false,
         "graceLimit":null,
         "allowPolicyExtension":false,
         "extensionLimit":null,
         "allowGracePeriodNotification":false,
         "allowPolicyExpiryNotification":false,
         "notifications":[

         ],
         "isPolicyActiveOnResources":false,
         "created":1516953890053,
         "lastUpdated":1518113000240,
         "resources":[

         ],
         "priority":1,
         "ownerId":2
      }
   ]
}

Example 2 – Specific Aging Policy

curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/v2/agingPolicies/2 

Response

{
   "id":"2",
   "resource":"https://<HOST>:<PORT>/v2/agingPolicies/2",
   "perms":[
      "administration",
      "write",
      "delete",
      "read"
   ],
   "name":"SomePolicy",
   "description":"",
   "enabled":true,
   "type":"TIME",
   "limit":{
      "amount":1,
      "unit":"MONTHS"
   },
   "terminateWhenPolicyEnds":false,
   "allowGracePeriodForTermination":false,
   "graceLimit":null,
   "allowPolicyExtension":false,
   "extensionLimit":null,
   "allowGracePeriodNotification":false,
   "allowPolicyExpiryNotification":false,
   "notifications":[

   ],
   "isPolicyActiveOnResources":false,
   "created":1516953892905,
   "lastUpdated":1516953892905,
   "resources":[

   ],
   "priority":1,
   "ownerId":2
}

Example 3 – All Aging Policies

curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/v2/agingPolicies

Response

{
   "resource":"http://ccm/v2/agingPolicies/",
   "size":2,
   "pageNumber":0,
   "totalElements":2,
   "totalPages":1,
   "policies":[
      {
         "id":"10",
         "resource":"http://ccm/v2/agingPolicies/10",
         "perms":[
            "delete",
            "read",
            "write",
            "administration"
         ],
         "name":"agingPolicyTime1",
         "description":"dscription 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":"tempalteName",
               "type":"GRACE_PERIOD",
               "enabled":true,
               "reminders":[
                  {
                     "amount":1,
                     "unit":"HOURS"
                  }
               ]
            }
         ],
         "isPolicyActiveOnResources":false,
         "created":1505414349817,
         "lastUpdated":1505414349817,
         "resources":[

         ],
         "priority":1
      },
      {
         "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":"templateName",
               "type":"GRACE_PERIOD",
               "enabled":true,
               "reminders":[
                  {
                     "amount":1,
                     "unit":"HOURS"
                  }
               ]
            }
         ],
         "isPolicyActiveOnResources":false,
         "created":1505420142155,
         "lastUpdated":1505420142155,
         "resources":[

         ],
         "priority":2
      }
   ]
}

Example 4: Cost-Based Aging Policy

curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/v2/agingPolicies/11

Response

{
    "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": "tempalteName1",
            "type": "GRACE_PERIOD",
            "enabled": true,
            "reminders": [
                {
                    "amount": 1,
                    "unit": "HOURS"
                }
            ]
        },
        {
            "template": "tempalteName2",
            "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
}

Example 5: Time-Based Aging Policy

curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/v2/agingPolicies/10

Response

{
  "id": "10",
  "resource": "http://ccm/v2/agingPolicies/10",
  "perms": [
    "delete",
    "read",
    "write",
    "administration"
  ],
  "name": "agingPolicyTime1",
  "description": "dscription 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": "tempalteName",
      "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

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

hideNonAdminPolicies
  • Description: Filters policies that are not created by administrators.
  • Type: Boolean
    • true = Displays properties that were created by administrators.
    • false = Default. Displays properties that were created by both administrators and non-administrators.

Optional query parameter

tags
  • DescriptionTags associated with this resource. Each string represents a system tag. See the System Tags section for the relevant release for additional context.

    If you filter reports based on tags that you applied to VMs or jobs, then the report displays all the VMs or jobs that have this exact combination of tags.

  • Type: Array of strings

Optional query parameter


Response Attributes

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

size
  • Description: Total number of records that any list page should contain. The default is: 

    • v1 APIs = 20 records

    • v2 APIs:

      • Prior to 4.8.0: All elements are returned and the page value is ignored.

      • Effective 4.8.0: 50 records
  • Type: Integer

pageNumber
  • Description: The page number that the client wants to fetch. Page numbers start with 0 (default).
  • Type: Integer

totalElements
  • Description: The number resources that an API call returns
  • Type: Long

totalPages
  • Description: The number of pages in a response 
  • Type: Integer

policies
  • Description: Identifies information for each aging 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

    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.


    limit
    • Description: The $-based limit for the bundleType. See the Financial Overview section for the relevant release for additional context.
    • Type: Integer

    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.

    allowGracePeriodNotification
    • Description: Identifies if a notification e-mail must be sent to inform the owner that a grace period for a policy is going to expire.

    • Type: Boolean

      • true = An email notification will be sent for grace period expiration.

      • false = (Default) An email notification will not be sent for grace period expiration.

    allowPolicyExpiryNotification
    • Description: Identifies if a notification e-mail must be sent to inform the owner that a policy is going to expire.

    • Type: Boolean

      • true = An email notification will be sent for a policy expiration.

      • false = (Default) An email notification will not be sent for a policy expiration.

    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.

    Unable to render {include} The included page could not be found.

    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:Identifies the details for each resource using the 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

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

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