View Suspension Policies

Details

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

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

Allowed Role(s)WM_USER
MethodGET
URI
  • v2/suspensionPolicies
  • v2/suspensionPolicies/policyId
  • v2/suspensionPolicies?hideNonAdminPolicies=true
  • v2/suspensionPolicies/policyId?details=true
  • cloudcenter-ccm-backend/api/v2/suspensionPolicies
  • cloudcenter-ccm-backend/api/v2/suspensionPolicies/policyId
  • cloudcenter-ccm-backend/api/v2/suspensionPolicies?hideNonAdminPolicies=true
  • cloudcenter-ccm-backend/api/v2/suspensionPolicies/policyId?details=true
Sample Request
curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/v2/suspensionPolicies/?size=0&hideNonAdminPolicies=true
curl -k -X GET -H "Accept: application/json" -u admin_5:40E45DBE57E35ECB https://<HOST>:<PORT>/cloudcenter-ccm-backend/api/v2/suspensionPolicies/?size=0&hideNonAdminPolicies=true
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: get.suspensionPolicies
  • action: get.suspensionPolicies.policyId
  • action: get.suspensionPolicies
    actionparam: hideNonAdminPolicies=true
  • action: get.suspensionPolicies.policyId
    actionparam: details=true

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

Not applicable

Sample 1 – Admin-Created Suspension Policies Response

   {
    "resource": "http://<HOST>:<PORT>/v2/suspensionPolicies/?size=0&hideNonAdminPolicies=true",
    "size": 1,
    "pageNumber": 0,
    "totalElements": 1,
    "totalPages": 1,
    "policies": [
        {
            "id": "21",
            "resource": "http://<HOST>:<PORT>/v2/suspensionPolicies/21",
            "perms": [
                "administration",
            	"write",
            	"delete",
            	"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": 15,
			"estimatedSavingsPercentage": 33.3 },
        {
            "id": "32",
            "resource": "http://<HOST>:<PORT>/v2/suspensionPolicies/32",
            "perms": [
                "administration",
            	"write",
            	"delete",
            	"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": 62.5
        }
    ]
}

Example 2 – Specific Suspension Policy

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

Response

{
    "id": "9",
    "resource": "http://<HOST>:<PORT>/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
}

Example 2 – All Suspension Policies

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

Response

{
    "resource": "http://<HOST>:<PORT>/v2/suspensionPolicies/",
    "size": 2,
    "pageNumber": 0,
    "totalElements": 2,
    "totalPages": 1,
    "policies": [
        {
            "id": "9",
            "resource": "http://<HOST>:<PORT>/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://<HOST>:<PORT>/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
        }
    ]
}

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

details
  • Description: Detailed information that relates to this resource
  • Type: String

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 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