Update an Auto Scaling Policy

put

/paas/api/v1.1/instancemgmt/{identityDomainId}/services/JaaS/instances/{serviceId}/autoscaling/policies

This endpoint is not applicable to service instances created on Oracle Cloud Infrastructure.

Updates the rule and condition details of the existing automatic (auto) scaling policy for an Oracle Java Cloud Service instance.

At least one rule (operation) must be defined to enable auto scaling for a service instance. If you update both rules (operations), make sure the conditions do not conflict each other.

Before updating a scaling rule for a BYOL instance (service instance that was created with isBYOL set to true), verify that you have the required Oracle WebLogic Server licenses for the maximum cluster size that you intend to specify in the rule. For the on-premises to Oracle Cloud processor-conversion ratios, see Oracle PaaS and IaaS Universal Credits - Service Descriptions.

See About Automatic Scaling in Administering Oracle Java Cloud Service.

Request

Supported Media Types
Path Parameters
Header Parameters
Body ()
The request body defines the auto scaling policy details for the service instance.
Root Schema : autoscalingpolicy-request
Type: object
Show Source
Nested Schema : policies
Type: array
Groups details about the auto scaling policy.
Show Source
Nested Schema : policies-request
Type: object
Show Source
  • alarm
    Groups the conditions for a rule to trigger an alarm.
  • The number of minutes after a scaling activity is completed before any further scaling activities can start. A valid value is a positive integer in the range of 30 to 300.

    If the alarm is still active after the cool down period, the scaling activity is repeated. The process continues until the alarm is no longer active, or the maximum or minimum cluster size is reached.

  • Maximum cluster size supported by the service instance. Required and valid only for a ScaleOut rule.
  • Minimum cluster size supported by the service instance. Required and valid only for a ScaleIn rule.
  • The scaling operation to perform when the alarm is triggered. At least one scaling operation must be defined in the policy. Only scale out and scale in are supported at this time. Valid values: scaleOut, scaleIn
Nested Schema : alarm
Type: object
Groups the conditions for a rule to trigger an alarm.
Show Source
  • Whether auto scaling is to be performed when an alarm rule is breached on all VM instances or on any of the VM instances. Valid values:ALL, ANY
  • The arithmetic operation to use when comparing the specified statistic and threshold values. Valid values: GreaterThanOrEqualToThreshold (for scale out), LessThanOrEqualToThreshold (for scale in)
  • Name of the metric set in the alarm. Supported values are:
    • CPUUtilization - The unit of measurement is percent.
    • MemoryUtilization - The unit of measurement is percent. Oracle Java Cloud Service instances created prior to release 17.2.3 do not support this metric.
    • Memory - The unit of measurement is GB. Oracle Java Cloud Service instances created prior to release 17.2.3 do not support this metric.

    If you are defining both the scale out and scale in operations in a policy, the same metric must be specified for each operation.

  • Unit of measurement for the alarm's associated metric. Valid values: percent, GB
  • The consecutive number of times data is compared for the given metric. A valid value is a positive integer in the range of 1 to 24.
  • The interval in minutes when data is compared for the given metric. A valid value is a positive integer in the range of 5 to 60.
  • The statistic to apply to the alarm's associated metric. Valid values: AVG, MIN, MAX
  • The value against which the given statistic is compared. A valid value can be a positive integer or float, in the range of 1 to 100 (for a percent value), and between 1 to 240 (for a GB value).
Back to Top

Response

Supported Media Types

202 Response

Accepted.

When done, policy details are returned.

Body ()
Root Schema : autoscalingpolicy-response
Type: object
Show Source
Nested Schema : policies
Type: array
Groups details about the auto scaling policy.
Show Source
Nested Schema : policy-details
Type: object
Show Source
Nested Schema : alarm
Type: object
Groups the conditions for a rule to trigger an alarm.
Show Source

400 Response

Validation failed. See the response for errors from one or more sources. Make the corrections and try again.
Body ()
Root Schema : validationfailed-response
Type: object
Show Source
Nested Schema : errors
Type: array
Groups the error details.
Show Source
Nested Schema : errordetails-response
Type: object
Show Source
Back to Top

Examples

The following example shows how to update the auto scaling policy for an Oracle Java Cloud Service instance, by submitting a PUT request on the REST resource using cURL.

Note:

  • The command in this example uses the URL structure https://rest_server_url/resource-path, where rest_server_url is the REST server to contact for your identity domain (or Cloud Account). See Send Requests.

  • In the resource path, the service type ../JaaS/.. is case-sensitive.

cURL Command

curl -i -X PUT -u username:password -d @updatepolicy.json -H "Content-Type:application/json" -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/JaaS/instances/ExampleInstance/autoscaling/policies

Example of Request Body

The following example shows the contents of the request body in JSON format.

{
    "name": "JCSPolicy",
    "description": "JCS1 Auto Scaling Policy",
    "policies": [
    {
        "operation": "scaleOut",
        "alarm": {
            "metricName": "CPUUtilization",
            "metricUnit": "percent",
            "statistic": "AVG",
            "comparisonOperator": "GreaterThanOrEqualToThreshold",
            "threshold": 90,
            "sampleCount": 3,
            "sampleFrequency": 10,
            "breachedOnInstance": "ALL"
        },
        "coolDownPeriod": 30,
        "maxClusterSize": 4
    },
    {
        "operation": "scaleIn",
        "alarm": {
            "metricName": "CPUUtilization",
            "metricUnit": "percent",
            "statistic": "AVG",
            "comparisonOperator": "LessThanOrEqualToThreshold",
            "threshold": 40,
            "sampleCount": 3,
            "sampleFrequency": "10",
            "breachedOnInstance": "ANY"
        },       
        "coolDownPeriod": 30,
        "minClusterSize": 2
    }
    ]
} 

Example of Response Header

The following shows an example of the response header.

HTTP/1.1 202 Accepted
Date: Thu, 19 May 2016 00:53:16 GMT
Content-Length: 0
Content-Type: application/json

Example of Response Body

The following shows an example of a 202 response returned in JSON format.

{
    "name": "JCSPolicy",
    "description": "JCS1 Auto Scaling Policy",
    "policies": [
    {
        "operation": "scaleOut",
        "alarm": {
            "metricName": "CPUUtilization",
            "metricUnit": "percent",
            "statistic": "AVG",
            "comparisonOperator": "GreaterThanOrEqualToThreshold",
            "threshold": "90",
            "sampleCount": "3",
            "sampleFrequency": "10",
            "breachedOnInstance": "ALL"
        },
        "coolDownPeriod": "30",
        "maxClusterSize": "4"
    },
    {
        "operation": "scaleIn",
        "alarm": {
            "metricName": "CPUUtilization",
            "metricUnit": "percent",
            "statistic": "AVG",
            "comparisonOperator": "LessThanOrEqualToThreshold",
            "threshold": "40",
            "sampleCount": "3",
            "sampleFrequency": "10",
            "breachedOnInstance": "ANY"
        },
        "coolDownPeriod": "30",
        "minClusterSize": "2"
    }
    ],
    "version": 2,
    "status": "Active",
    "startTime": "2016-05-19T07:39:03.576+0000"
}

The following shows an example of a 400 response.

{
    "status": "Bad Request",
    "errors": [
        {
            "detail": "Failed to submit [update] rule request, another activity ongoing on this service."
        }
    ]
}
Back to Top