Querying a Custom Serverless Scale-Up Policy
Function
This API is used to query a custom serverless scale-up policy. Before calling this API:
- Learn how to authorize and authenticate it.
- Obtain the required region and endpoint.
Constraints
This API is in the open beta test (OBT) phase. To use it, submit a service ticket.
URI
GET /v3/{project_id}/instances/{instance_id}/serverless/scaling-policy
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Definition Project ID of a tenant in a region. To obtain this value, see Obtaining a Project ID. Constraints N/A Range The value contains 32 characters. Only letters and digits are allowed. Default Value N/A |
instance_id |
Yes |
String |
Definition Instance ID, which uniquely identifies an instance. Constraints N/A Range The value contains 36 characters with a suffix of in07. Only letters and digits are allowed. Default Value N/A |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
X-Auth-Token |
Yes |
String |
Definition User token. To obtain this value, call the IAM API for obtaining a user token. The value of X-Subject-Token in the response header is the token value. Constraints N/A Range N/A Default Value N/A |
X-Language |
No |
String |
Definition Request language type. Constraints N/A Range Default Value en-us |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
enlarge_step_size |
String |
Definition Custom scale-up step. Constraints N/A Range The value is between 2 and half of the maximum compute. Default Value N/A |
custom_scaling_config |
CustomScalingConfig object |
Definition Custom scale-up policy. Constraints N/A |
Parameter |
Type |
Description |
---|---|---|
enlarge_scene |
ScalingScene object |
Definition Custom scale-up policy. Constraints N/A |
Parameter |
Type |
Description |
---|---|---|
conditions |
Array of ScalingCondition objects |
Definition Configuration change conditions. Constraints N/A |
Parameter |
Type |
Description |
---|---|---|
condition_id |
String |
Definition Name of a configuration change condition. Constraints N/A Range The value cannot be empty and contains a maximum of 32 characters. Only letters, digits, and hyphens (-) are allowed. Default Value N/A |
duration |
Integer |
Definition Duration, in milliseconds. Constraints N/A Range 2000–5000 Default Value N/A |
interval |
Integer |
Definition Interval, in milliseconds. Constraints N/A Range 1000–5000 Default Value N/A |
metric_conditions |
Array of MetricCondition objects |
Definition Conditions for metric reconfiguration. Constraints N/A |
Parameter |
Type |
Description |
---|---|---|
metric_name |
String |
Definition Metric name. Constraints N/A Range Default Value N/A |
metric_value |
Integer |
Definition Threshold for metric reconfiguration. Constraints The value is 10,000 times the percentage. For example, when the percentage is 50%, the value is 5000. Range 6000–8000 Default Value N/A |
compare_mode |
String |
Definition Comparison mode. Constraints N/A Range GT: greater than Default Value N/A |
Status code: 400
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Status code: 500
Parameter |
Type |
Description |
---|---|---|
error_code |
String |
Error code. |
error_msg |
String |
Error message. |
Example Request
Querying a custom serverless scale-up policy
GET https://{endpoint}/v3/056538411200d4cd2f79c003c7606412/instances/c70a7eed50b14ee4969449ab5166aa7bin07/serverless/scaling-policy
Example Response
Status code: 200
Success.
{ "enlarge_step_size" : "2", "custom_scaling_config" : { "enlarge_scene" : { "conditions" : [ { "condition_id" : "enlarge-custom-01", "metric_conditions" : [ { "metric_name" : "cpuTotalUsage", "metric_value" : 8000, "compare_mode" : "GT" } ], "duration" : 3000, "interval" : 1000 }, { "condition_id" : "enlarge-custom-02", "metric_conditions" : [ { "metric_name" : "cpuTotalUsage", "metric_value" : 6000, "compare_mode" : "GT" } ], "duration" : 5000, "interval" : 2000 }, { "condition_id" : "enlarge-custom-03", "metric_conditions" : [ { "metric_name" : "memoryTotalUsage", "metric_value" : 8000, "compare_mode" : "GT" } ], "duration" : 3000, "interval" : 2000 } ] } } }
Status Code
For details, see Status Codes.
Error Code
For details, see Error Codes.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot