View an Auto Scaling Policy
/paas/api/v1.1/instancemgmt/{identityDomainId}/services/JaaS/instances/{serviceId}/autoscaling/policies
Returns the latest automatic (auto) scaling policy for an Oracle Java Cloud Service instance.
Request
-
identityDomainId: string
Identity domain ID for the Oracle Java Cloud Service account.
-
serviceId: string
Name of the Oracle Java Cloud Service instance.
-
Authorization: string
Base64 encoded user name and password separated by a colon or OAuth access token obtained from Oracle Identity Cloud Service. See Authenticate.
-
X-ID-TENANT-NAME: string
Identity domain ID for the Oracle Java Cloud Service account.
Response
- application/json
200 Response
Policy details are returned in the response body.
object
-
description(optional):
string
Description of the auto scaling policy.
-
message(optional):
string
For example:
Rule is Active
-
name(optional):
string
Name of the auto scaling policy. The default name is the service instance name.
-
policies(optional):
array policies
Groups details about the auto scaling policy.
-
startTime(optional):
string
Date and time the auto scaling policy was created or updated.
-
status(optional):
string
State of the auto scaling policy.
-
version(optional):
string
Version of the auto scaling policy.
object
-
alarm(optional):
object alarm
Groups the conditions for a rule to trigger an alarm.
-
coolDownPeriod(optional):
integer
The number of minutes after a scaling activity is completed before any further scaling activities can start.
-
maxClusterSize(optional):
integer
Maximum cluster size supported by the service instance when scaling out.
-
minClusterSize(optional):
integer
Minimum cluster size supported by the service instance when scaling in.
-
operation(optional):
string
The scaling operation to perform when the alarm is triggered. For example:
scaleOut
,scaleIn
object
-
breachedOnInstance(optional):
string
Whether auto scaling is to be performed when an alarm rule is breached on all VM instances or on any of the VM instances. For example:
ALL
,ANY
-
comparisonOperator(optional):
string
Arithmetic operation to use when comparing the specified
statistic
andthreshold
values. For example:GreaterThanOrEqualToThreshold
,LessThanOrEqualToThreshold
-
metricName(optional):
string
Name of the metric set in the alarm. For example:
CPUUtilization
-
metricUnit(optional):
string
Unit of measurement for the alarm's associated metric. For example:
percent
-
sampleCount(optional):
integer
The consecutive number of times data is compared for the given metric.
-
sampleFrequency(optional):
integer
The interval in minutes when data is compared for the given metric.
-
statistic(optional):
string
The statistic to apply to the alarm's associated metric. For example:
AVG
,MIN
,MAX
-
threshold(optional):
number
The value against which the given
statistic
is compared.
404 Response
Examples
The following example shows how to view the auto scaling policy defined for an Oracle Java Cloud Service instance, by submitting a GET request on the REST resource using cURL.
Note:
-
The command in this example uses the URL structure
https://rest_server_url/resource-path
, whererest_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 GET -u username:password -H "X-ID-TENANT-NAME:ExampleIdentityDomain" https://rest_server_url/paas/api/v1.1/instancemgmt/ExampleIdentityDomain/services/JaaS/instances/ExampleInstance/autoscaling/policies
Example of Response Header
The following shows an example of the response header.
HTTP/1.1 200 OK
Date: Thu, 19 May 2016 02:23:06 GMT
Transfer-Encoding: chunked
Content-Type: application/json
Example of Response Body
The following is an example of the 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": "80",
"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": 1,
"status": "Active",
"startTime": "2016-05-19T07:33:46.252+0000"
}
Example of Response Body (no policy defined)
The following shows the response returned in JSON format when no policy has been defined for the service instance.
{
"status": "Not Found",
"errors": [
{
"detail": "Policy not found."
}]
}