diff --git a/docs/aom/api-ref/.placeholder b/docs/aom/api-ref/.placeholder deleted file mode 100644 index e69de29b..00000000 diff --git a/docs/aom/api-ref/ALL_META.TXT.json b/docs/aom/api-ref/ALL_META.TXT.json new file mode 100644 index 00000000..68113a8d --- /dev/null +++ b/docs/aom/api-ref/ALL_META.TXT.json @@ -0,0 +1,182 @@ +[ + { + "uri":"aom_04_0000.html", + "product_code":"aom", + "code":"1", + "des":"Public cloud APIs comply with the RESTful API design principles. REST-based web services are organized into resources. Each resource is identified by one or more Uniform ", + "doc_type":"api", + "kw":"API Usage Guidelines,API Reference", + "title":"API Usage Guidelines", + "githuburl":"" + }, + { + "uri":"aom_04_1010.html", + "product_code":"aom", + "code":"2", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"APIs", + "title":"APIs", + "githuburl":"" + }, + { + "uri":"aom_04_1045.html", + "product_code":"aom", + "code":"3", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Monitoring APIs", + "title":"Monitoring APIs", + "githuburl":"" + }, + { + "uri":"aom_04_1011.html", + "product_code":"aom", + "code":"4", + "des":"This API is used to query the metrics that can be monitored in the system. You can specify the namespace, metric name, dimension, resource ID (format: resType_resId), sta", + "doc_type":"api", + "kw":"Querying Metrics,Monitoring APIs,API Reference", + "title":"Querying Metrics", + "githuburl":"" + }, + { + "uri":"aom_04_1012.html", + "product_code":"aom", + "code":"5", + "des":"This API is used to query monitoring data of metrics within a specified time period. You can specify a dimension or period to query data.POST /v2/{project_id}/ams/metricd", + "doc_type":"api", + "kw":"Querying Monitoring Data,Monitoring APIs,API Reference", + "title":"Querying Monitoring Data", + "githuburl":"" + }, + { + "uri":"aom_04_1013.html", + "product_code":"aom", + "code":"6", + "des":"This API is used to add one or more monitoring data records to a server.POST /v2/{project_id}/ams/report/metricdataTable 1 describes the parameters.Request parametersTabl", + "doc_type":"api", + "kw":"Adding Monitoring Data,Monitoring APIs,API Reference", + "title":"Adding Monitoring Data", + "githuburl":"" + }, + { + "uri":"aom_04_1014.html", + "product_code":"aom", + "code":"7", + "des":"This API is used to add a threshold rule.POST /v2/{project_id}/ams/alarmsRequest parametersTable 1 describes the request parameters.Request headersTable 2 describes the r", + "doc_type":"api", + "kw":"Adding a Threshold Rule,Monitoring APIs,API Reference", + "title":"Adding a Threshold Rule", + "githuburl":"" + }, + { + "uri":"aom_04_1019.html", + "product_code":"aom", + "code":"8", + "des":"This API is used to modify a threshold rule.PUT /v2/{project_id}/ams/alarmsRequest parametersTable 1 describes the request parameters.Request headersTable 2 describes the", + "doc_type":"api", + "kw":"Modifying a Threshold Rule,Monitoring APIs,API Reference", + "title":"Modifying a Threshold Rule", + "githuburl":"" + }, + { + "uri":"aom_04_1015.html", + "product_code":"aom", + "code":"9", + "des":"This API is used to query a threshold rule list.GET /v2/{project_id}/ams/alarmsRequest parametersTable 1 describes the request parameters.Request headersTable 2 describes", + "doc_type":"api", + "kw":"Querying a Threshold Rule List,Monitoring APIs,API Reference", + "title":"Querying a Threshold Rule List", + "githuburl":"" + }, + { + "uri":"aom_04_1016.html", + "product_code":"aom", + "code":"10", + "des":"This API is used to query a threshold rule.GET /v2/{project_id}/ams/alarms/{alarm_id}Request parametersTable 1 describes the request parameters.Request headersTable 2 des", + "doc_type":"api", + "kw":"Querying a Threshold Rule,Monitoring APIs,API Reference", + "title":"Querying a Threshold Rule", + "githuburl":"" + }, + { + "uri":"aom_04_1017.html", + "product_code":"aom", + "code":"11", + "des":"This API is used to delete a threshold rule.DELETE /v2/{project_id}/ams/alarms/{alarm_id}Request parametersTable 1 describes the request parameters.Request headersTable 2", + "doc_type":"api", + "kw":"Deleting a Threshold Rule,Monitoring APIs,API Reference", + "title":"Deleting a Threshold Rule", + "githuburl":"" + }, + { + "uri":"aom_04_1047.html", + "product_code":"aom", + "code":"12", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Log APIs", + "title":"Log APIs", + "githuburl":"" + }, + { + "uri":"aom_04_1034.html", + "product_code":"aom", + "code":"13", + "des":"This API is used to query logs by different dimensions such as cluster, IP address, or application.POST /v2/{project_id}/als/action?type=querylogsTable 1 describes the p", + "doc_type":"api", + "kw":"Querying Logs,Log APIs,API Reference", + "title":"Querying Logs", + "githuburl":"" + }, + { + "uri":"aom_04_0066.html", + "product_code":"aom", + "code":"14", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Appendix", + "title":"Appendix", + "githuburl":"" + }, + { + "uri":"aom_04_0018.html", + "product_code":"aom", + "code":"15", + "des":"Table 1 describes the status codes.", + "doc_type":"api", + "kw":"Status Codes,Appendix,API Reference", + "title":"Status Codes", + "githuburl":"" + }, + { + "uri":"aom_04_0008.html", + "product_code":"aom", + "code":"16", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Common Request Headers,Appendix,API Reference", + "title":"Common Request Headers", + "githuburl":"" + }, + { + "uri":"aom_04_0009.html", + "product_code":"aom", + "code":"17", + "des":"A response usually contains the following headers:", + "doc_type":"api", + "kw":"Common Response Headers,Appendix,API Reference", + "title":"Common Response Headers", + "githuburl":"" + }, + { + "uri":"aom_04_0020.html", + "product_code":"aom", + "code":"18", + "des":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "doc_type":"api", + "kw":"Change History,API Reference", + "title":"Change History", + "githuburl":"" + } +] \ No newline at end of file diff --git a/docs/aom/api-ref/CLASS.TXT.json b/docs/aom/api-ref/CLASS.TXT.json new file mode 100644 index 00000000..e6b6c043 --- /dev/null +++ b/docs/aom/api-ref/CLASS.TXT.json @@ -0,0 +1,164 @@ +[ + { + "desc":"Public cloud APIs comply with the RESTful API design principles. REST-based web services are organized into resources. Each resource is identified by one or more Uniform ", + "product_code":"aom", + "title":"API Usage Guidelines", + "uri":"aom_04_0000.html", + "doc_type":"api", + "p_code":"", + "code":"1" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"aom", + "title":"APIs", + "uri":"aom_04_1010.html", + "doc_type":"api", + "p_code":"", + "code":"2" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"aom", + "title":"Monitoring APIs", + "uri":"aom_04_1045.html", + "doc_type":"api", + "p_code":"2", + "code":"3" + }, + { + "desc":"This API is used to query the metrics that can be monitored in the system. You can specify the namespace, metric name, dimension, resource ID (format: resType_resId), sta", + "product_code":"aom", + "title":"Querying Metrics", + "uri":"aom_04_1011.html", + "doc_type":"api", + "p_code":"3", + "code":"4" + }, + { + "desc":"This API is used to query monitoring data of metrics within a specified time period. You can specify a dimension or period to query data.POST /v2/{project_id}/ams/metricd", + "product_code":"aom", + "title":"Querying Monitoring Data", + "uri":"aom_04_1012.html", + "doc_type":"api", + "p_code":"3", + "code":"5" + }, + { + "desc":"This API is used to add one or more monitoring data records to a server.POST /v2/{project_id}/ams/report/metricdataTable 1 describes the parameters.Request parametersTabl", + "product_code":"aom", + "title":"Adding Monitoring Data", + "uri":"aom_04_1013.html", + "doc_type":"api", + "p_code":"3", + "code":"6" + }, + { + "desc":"This API is used to add a threshold rule.POST /v2/{project_id}/ams/alarmsRequest parametersTable 1 describes the request parameters.Request headersTable 2 describes the r", + "product_code":"aom", + "title":"Adding a Threshold Rule", + "uri":"aom_04_1014.html", + "doc_type":"api", + "p_code":"3", + "code":"7" + }, + { + "desc":"This API is used to modify a threshold rule.PUT /v2/{project_id}/ams/alarmsRequest parametersTable 1 describes the request parameters.Request headersTable 2 describes the", + "product_code":"aom", + "title":"Modifying a Threshold Rule", + "uri":"aom_04_1019.html", + "doc_type":"api", + "p_code":"3", + "code":"8" + }, + { + "desc":"This API is used to query a threshold rule list.GET /v2/{project_id}/ams/alarmsRequest parametersTable 1 describes the request parameters.Request headersTable 2 describes", + "product_code":"aom", + "title":"Querying a Threshold Rule List", + "uri":"aom_04_1015.html", + "doc_type":"api", + "p_code":"3", + "code":"9" + }, + { + "desc":"This API is used to query a threshold rule.GET /v2/{project_id}/ams/alarms/{alarm_id}Request parametersTable 1 describes the request parameters.Request headersTable 2 des", + "product_code":"aom", + "title":"Querying a Threshold Rule", + "uri":"aom_04_1016.html", + "doc_type":"api", + "p_code":"3", + "code":"10" + }, + { + "desc":"This API is used to delete a threshold rule.DELETE /v2/{project_id}/ams/alarms/{alarm_id}Request parametersTable 1 describes the request parameters.Request headersTable 2", + "product_code":"aom", + "title":"Deleting a Threshold Rule", + "uri":"aom_04_1017.html", + "doc_type":"api", + "p_code":"3", + "code":"11" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"aom", + "title":"Log APIs", + "uri":"aom_04_1047.html", + "doc_type":"api", + "p_code":"2", + "code":"12" + }, + { + "desc":"This API is used to query logs by different dimensions such as cluster, IP address, or application.POST /v2/{project_id}/als/action?type=querylogsTable 1 describes the p", + "product_code":"aom", + "title":"Querying Logs", + "uri":"aom_04_1034.html", + "doc_type":"api", + "p_code":"12", + "code":"13" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"aom", + "title":"Appendix", + "uri":"aom_04_0066.html", + "doc_type":"api", + "p_code":"", + "code":"14" + }, + { + "desc":"Table 1 describes the status codes.", + "product_code":"aom", + "title":"Status Codes", + "uri":"aom_04_0018.html", + "doc_type":"api", + "p_code":"14", + "code":"15" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"aom", + "title":"Common Request Headers", + "uri":"aom_04_0008.html", + "doc_type":"api", + "p_code":"14", + "code":"16" + }, + { + "desc":"A response usually contains the following headers:", + "product_code":"aom", + "title":"Common Response Headers", + "uri":"aom_04_0009.html", + "doc_type":"api", + "p_code":"14", + "code":"17" + }, + { + "desc":"HUAWEI CLOUD Help Center presents technical documents to help you quickly get started with HUAWEI CLOUD services. The technical documents include Service Overview, Price Details, Purchase Guide, User Guide, API Reference, Best Practices, FAQs, and Videos.", + "product_code":"aom", + "title":"Change History", + "uri":"aom_04_0020.html", + "doc_type":"api", + "p_code":"", + "code":"18" + } +] \ No newline at end of file diff --git a/docs/aom/api-ref/PARAMETERS.txt b/docs/aom/api-ref/PARAMETERS.txt new file mode 100644 index 00000000..6da8d5f0 --- /dev/null +++ b/docs/aom/api-ref/PARAMETERS.txt @@ -0,0 +1,3 @@ +version="" +language="en-us" +type="" \ No newline at end of file diff --git a/docs/aom/api-ref/aom_04_0000.html b/docs/aom/api-ref/aom_04_0000.html new file mode 100644 index 00000000..50452f7b --- /dev/null +++ b/docs/aom/api-ref/aom_04_0000.html @@ -0,0 +1,8 @@ + + +
Public cloud APIs comply with the RESTful API design principles. REST-based web services are organized into resources. Each resource is identified by one or more Uniform Resource Identifiers (URIs). An application accesses a resource based on the resource's Unified Resource Locator (URL). A URL is usually in the following format: https://Endpoint/uri. In the URL, uri indicates the resource path, that is, the API access path.
+Public cloud APIs use HTTPS as the transmission protocol. Requests/Responses are transmitted using JSON messages, with the media type represented by Application/json.
+For details about how to use APIs, see API Usage Guidelines.
+Name + |
+Description + |
+Mandatory + |
+Example + |
+
---|---|---|---|
X-Auth-Token + |
+User token. + |
+Yes for token-based authentication + |
+- + |
+
Content-Type + |
+Content type, +which is application/json;charset=utf-8. + |
+Yes + |
+application/json;charset=utf8 + |
+
x-sdk-date + |
+Time to send a request, +which is in the format of YYYYMMDD'T'HHMMSS'Z'. GMT time is used. + |
+Yes for Access Key ID/Secret Access Key (AK/SK)-based authentication + |
+20160629T101459Z + |
+
Authorization + |
+Signature authentication information, +which is obtained from the result of request signing. + |
+Yes for AK/SK-based authentication + |
+- + |
+
Host + |
+Request server information, which is obtained from the URL of a service API. The value is hostname[:port]. If no port is specified, the default port will be used. For HTTPS, port 443 is used by default. + |
+Yes for AK/SK-based authentication + |
+- + |
+
A response usually contains the following headers:
+ +Name + |
+Description + |
+Example + |
+
---|---|---|
Date + |
+(Standard HTTP header) Time when a message is sent. This field complies with RFC822 definitions. + |
+Mon, 12 Nov 2007 15:55:01 GMT + |
+
Server + |
+(Standard HTTP header) Software that a server uses to process the request. + |
+Apache + |
+
Content-Length + |
+(Standard HTTP header) Length of the response body, which is represented by a decimal number and stored in bytes. + |
+xxx + |
+
Content-Type + |
+(Standard HTTP header) Media type of the response body sent to the recipient. + |
+application/json + |
+
Table 1 describes the status codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
100 + |
+Continue + |
+The client should continue with its request. +This interim response is used to inform the client that the initial part of the requests has been received and not rejected by the server. + |
+
101 + |
+Switching Protocols + |
+The protocol should be switched. The protocol can only be switched to a more advanced protocol. +For example, a new HTTP protocol. + |
+
200 + |
+OK + |
+The request has succeeded. + |
+
201 + |
+Created + |
+The request has been fulfilled, resulting in the creation of a new resource. + |
+
202 + |
+Accepted + |
+The request has been accepted, but the processing has not been completed. + |
+
203 + |
+Non-Authoritative Information + |
+The server successfully processed the request, but is returning information that may be from another source. + |
+
204 + |
+No Content + |
+The server has successfully processed the request, but does not return any content. +The status code is returned in response to an HTTP OPTIONS request. + |
+
205 + |
+Reset Content + |
+The server has fulfilled the request, but the requester is required to reset the content. + |
+
206 + |
+Partial Content + |
+The server has successfully processed a part of the GET request. + |
+
300 + |
+Multiple Choices + |
+There are multiple options for the location of the requested resource. The response contains a list of resource characteristics and addresses from which a user terminal (such as a browser) can choose the most appropriate one. + |
+
301 + |
+Moved Permanently + |
+The requested resource has been assigned with a new permanent URI. This new URI is contained in the response. + |
+
302 + |
+Found + |
+The requested resource resides temporarily under a different URI. + |
+
303 + |
+See Other + |
+The response to the request can be found under a different URI, +and should be retrieved using a GET or POST method. + |
+
304 + |
+Not Modified + |
+The requested resource has not been modified. When the server returns this status code, it does not return any resources. + |
+
305 + |
+Use Proxy + |
+The requested resource must be accessed through a proxy. + |
+
306 + |
+Unused + |
+This HTTP status code is no longer used. + |
+
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
402 + |
+Payment Required + |
+This status code is reserved for future use. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
404 + |
+Not Found + |
+The requested resource cannot be found. +The client should not repeat the request without modifications. + |
+
405 + |
+Method Not Allowed + |
+The method specified in the request is not supported by the requested resource. +The client should not repeat the request without modifications. + |
+
406 + |
+Not Acceptable + |
+The server cannot fulfill the request based on the content characteristics of the request. + |
+
407 + |
+Proxy Authentication Required + |
+This status code is similar to 401, but indicates that the client must authenticate itself with the proxy first. + |
+
408 + |
+Request Timeout + |
+The client does not produce a request within the time that the server was prepared to wait. +The client may repeat the request without modifications later. + |
+
409 + |
+Conflict + |
+The request cannot be processed due to a conflict. +The resource that the client attempts to create already exits, or the request fails to be processed because of the update of the conflict request. + |
+
410 + |
+Gone + |
+The requested resource cannot be found. +The requested resource has been deleted permanently. + |
+
411 + |
+Length Required + |
+The server refuses to process the request without a defined Content-Length. + |
+
412 + |
+Precondition Failed + |
+The server does not meet one of the preconditions that the requester puts on the request. + |
+
413 + |
+Request Entity Too Large + |
+The server refuses to process a request because the request entity is too large. The server may disable the connection to prevent the client from sending requests consecutively. If the server cannot process the request temporarily, the response will contain a Retry-After field. + |
+
414 + |
+Request-URI Too Long + |
+The request URI is too long for the server to process. + |
+
415 + |
+Unsupported Media Type + |
+The server cannot process the media format in the request. + |
+
416 + |
+Requested Range Not Satisfiable + |
+The requested range is invalid. + |
+
417 + |
+Expectation Failed + |
+The server fails to meet the requirements of the Expect request-header field. + |
+
422 + |
+Unprocessable Entity + |
+The request is well-formed but is unable to be processed due to semantic errors. + |
+
429 + |
+Too Many Requests + |
+The client sends excessive requests to the server within a given time (exceeding the limit on the access frequency of the client), or the server receives excessive requests within a given time (beyond its processing capability). In this case, the client should repeat requests after the time specified in the Retry-After header of the response expires. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
501 + |
+Not Implemented + |
+The server does not support the function required to fulfill the request. + |
+
502 + |
+Bad Gateway + |
+The server acting as a gateway or proxy receives an invalid response from a remote server. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
504 + |
+Server Timeout + |
+The request cannot be fulfilled within a given time. This status code is returned to the client only when the timeout parameter is specified in the request. + |
+
505 + |
+HTTP Version Not Supported + |
+The server does not support the HTTP protocol version used in the request. + |
+
Released On + |
+Description + |
+
---|---|
2022-09-29 + |
+
|
+
2020-12-31 + |
+This issue is the first official release. + |
+
This API is used to query the metrics that can be monitored in the system. You can specify the namespace, metric name, dimension, resource ID (format: resType_resId), start position, and maximum number of returned records in pagination queries.
+POST /v2/{project_id}/ams/metrics?type={type}&limit={limit}&start={start}
+Table 1 describes the parameters.
+ +Parameter + |
+Mandatory + |
+Description + |
+
---|---|---|
project_id + |
+Yes + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
type + |
+No + |
+Metric query mode. The information carried by metricItems in the request body is used to query metrics. + |
+
limit + |
+No + |
+Maximum number of returned records. Value range: 1–1000. Default value: 1000. + |
+
start + |
+No + |
+Start position of a pagination query. The value is a non-negative integer. + |
+
Request parameters
+Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
metricItems + |
+No + |
+Arrays + |
+See Table 3. + |
+If type (a URI parameter) is not inventory, the information carried by the array is used to query metrics. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
namespace + |
+Yes + |
+String + |
+PAAS.CONTAINER, PAAS.NODE, PAAS.SLA, PAAS.AGGR, CUSTOMMETRICS, and so on. + |
+Metric namespace. +PAAS.CONTAINER: application metric. +PAAS.NODE: node metric. +PAAS.SLA: Service Level Agreement (SLA) metric. +PAAS.AGGR: cluster metric. +CUSTOMMETRICS: custom metric. + |
+
dimensions + |
+No + |
+Array + |
+- + |
+Metric dimension. +dimensions.name: dimension name, such as clusterName, clusterId, appName, appID, deploymentName, podName, podID, containerName, or containerID. +dimensions.value: dimension value, such as a specific application instance ID. + |
+
metricName + |
+No + |
+String + |
+1–1000 characters. + |
+Metric name. + |
+
Request headers
+Table 4 describes the request headers.
+ +Name + |
+Mandatory + |
+Description + |
+
---|---|---|
X-Auth-Token + |
+Yes + |
+User token obtained from IAM. + |
+
Content-Type + |
+Yes + |
+Content type, which is application/json. + |
+
Example request
+(Query by namespace+appName+clusterName)
+/v2/{projectId}/ams/metrics +{ + "metricItems": [ + { + "namespace": "PAAS.CONTAINER", + "dimensions":[ + { + "name":"appName", + "value":"demo" + }, + { + "name":"clusterName", + "value":"test" + } + ] + } + ] +}+
Response parameters
+Table 5 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. Example: AOM.0200, which indicates a success response. + |
+
errorMessage + |
+String + |
+Response message. + |
+
metrics + |
+JSON array + |
+List of metrics. + |
+
namespace + |
+String + |
+Namespace. + |
+
metricName + |
+String + |
+Metric name. + |
+
unit + |
+String + |
+Metric unit. + |
+
dimensions + |
+JSON array + |
+List of metric dimensions. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success", + "metrics": [{ + "namespace": "abc", + "metricName": "cpuUsage", + "unit":"Percent", + "dimensions": [{ + "name": "instance_id", + "value": "demo1" + }] + }] +}+
Table 6 describes the status code.
+ + +Table 7 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0101 + |
+Invalid namespace. + |
+Check whether the parameter meets requirements. + |
+
AOM.0102 + |
+Invalid inventoryId. + |
+Check whether the parameter meets requirements. + |
+
AOM.0103 + |
+ProjectId is left blank. + |
+Check whether the parameter meets requirements. + |
+
AOM.0105 + |
+Invalid limit. + |
+Check whether the parameter meets requirements. + |
+
AOM.0106 + |
+Invalid start. + |
+Check whether the parameter meets requirements. + |
+
AOM.0109 + |
+Invalid metricName. + |
+Check whether the parameter meets requirements. + |
+
AOM.0501 + |
+The Cassandra session is null. + |
+Contact technical support. + |
+
AOM.0502 + |
+The Cassandra execution is abnormal. + |
+Contact technical support. + |
+
This API is used to query monitoring data of metrics within a specified time period. You can specify a dimension or period to query data.
+POST /v2/{project_id}/ams/metricdata
+Table 1 describes the parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
project_id + |
+Yes + |
+String + |
+- + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
fillValue + |
+No + |
+String + |
+–1, 0, null, and average + |
+Filled value for breakpoints in monitoring data. Default value: –1. +
|
+
Request parameters
+Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
metrics + |
+Yes + |
+JSON array + |
+A maximum of 20 metrics are supported. See Table 3. + |
+List of metrics. + |
+
period + |
+Yes + |
+Integer + |
+Enumerated value. Options: +
|
+Data monitoring granularity. + |
+
timerange + |
+Yes + |
+String + |
+Format: start time (UTC, in ms).end time (UTC, in ms).number of minutes in the time period. When the start time and end time are –1, it indicates the latest N minutes. N indicates the time period by the granularity of minute. + |
+Query time period. For example, –1.–1.5 indicates the last 5 minutes. 1501545600000.1501632000000.1440 indicates the fixed time period from 08:00:00 on August 1, 2017 to 08:00:00 on August 2, 2017. + NOTE:
+Time range/Period ≤ 1440 +The timerange and period must use the same unit. + |
+
statistics + |
+Yes + |
+JSON array + |
+maximum, minimum, sum, average, or sampleCount. + |
+Statistic. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
namespace + |
+Yes + |
+String + |
+PAAS.CONTAINER, PAAS.NODE, PAAS.SLA, PAAS.AGGR, and CUSTOMMETRICS. + |
+Metric namespace. + |
+
metricName + |
+Yes + |
+String + |
+1–255 characters. + |
+Metric name. + |
+
dimensions + |
+Yes + |
+JSON array + |
+Neither the array nor the name/value of any dimension in the array can be left blank. + |
+Metric dimension. +dimensions.name: dimension name. Example: appName. +dimensions.value: dimension value, such as a specific application name. + |
+
Request headers
+Table 4 describes the request headers.
+ +Name + |
+Mandatory + |
+Description + |
+
---|---|---|
X-Auth-Token + |
+Yes + |
+User token obtained from IAM. + |
+
Content-Type + |
+Yes + |
+Content type, which is application/json. + |
+
Example request
+{ + "metrics": [ + { + "namespace": "abc", + "metricName": "def", + "dimensions": [ + { + "name": "instance_id", + "value": "demo1" + } + ] + } + ], + "period": 60, + "timerange": "-1.-1.5",//Last 5 minutes + "statistics": [ + "maximum", + "minimum", + "sum" + ] +}+
Response parameters
+Table 5 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
metrics + |
+JSON object + |
+- + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success", + "metrics": [{ + "metric": { + "namespace": "abc", + "metricName": "def", + "dimensions": [{ + "name": "ghi", + "value": "lmn" + }] + }, + "dataPoints": [{ + "timestamp": 1467892800000, + "unit": "Percent", + "statistics": [{ + "statistic": "maximum", + "value": 23 + }] + }] + }] +}+
Table 6 describes the status code.
+ + +Table 7 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0101 + |
+Projectid is left blank. + |
+Check whether the parameter meets requirements. + |
+
AOM.0102 + |
+The metric data parameter is null. + |
+Check whether the parameter meets requirements. + |
+
AOM.0103 + |
+Invalid period. + |
+Check whether the parameter meets requirements. + |
+
AOM.0104 + |
+Invalid statistics. + |
+Check whether the parameter meets requirements. + |
+
AOM.0105 + |
+Invalid metrics. + |
+Check whether the parameter meets requirements. + |
+
AOM.0106 + |
+Invalid time range. + |
+Check whether the parameter meets requirements. + |
+
AOM.0107 + |
+The number of data points in a time range exceeds 1440. + |
+Check whether the parameter meets requirements. + |
+
AOM.0110 + |
+Invalid fillValue. + |
+Check whether the parameter meets requirements. + |
+
AOM.0500 + |
+Internal server error. + |
+Contact technical support. + |
+
This API is used to add one or more monitoring data records to a server.
+Request parameters
+Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
metric + |
+Yes + |
+JSON object + |
+See Table 3. + |
+Metric data. + |
+
values + |
+Yes + |
+JSON array + |
+See Table 4. + |
+- + |
+
collect_time + |
+Yes + |
+UNIX timestamp + |
+UNIX timestamp, in ms. + |
+Data collection time, which must meet the following requirement: +Current UTC time – Data collection time ≤ 24 hours, or Data collection time – Current UTC time ≤ 30 minutes + |
+
Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
namespace + |
+Yes + |
+String + |
+Namespace, which must be in the format of service.item. The value must be 3 to 32 characters starting with a letter. Only letters, digits, and underscores (_) are allowed. In addition, service cannot start with PAAS or SYS. + |
+Metric namespace. + |
+
dimensions + |
+Yes + |
+JSON array + |
+Each dimension is a JSON object, and its structure is as follows: +dimension.name: 1–32 characters. +dimension.value: 1–64 characters. + |
+List of metric dimensions. + |
+
Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
unit + |
+No + |
+String + |
+- + |
+Data unit. + |
+
metric_name + |
+Yes + |
+String + |
+- + |
+Metric name. + |
+
type + |
+No + |
+String + |
+Integer or floating number + |
+Data type. + |
+
value + |
+Yes + |
+Floating number + |
+Valid numeral type. + |
+Metric value. + |
+
Request headers
+Table 5 describes the request headers.
+ +Name + |
+Mandatory + |
+Description + |
+
---|---|---|
X-Auth-Token + |
+Yes + |
+User token obtained from IAM. + |
+
Content-Type + |
+Yes + |
+Content type, which is application/json. + |
+
Example request
+[ + { + "metric": { + "namespace": "NOPAAS.ESC", + "dimensions": [ + { + "name": "instance_id", + "value": "instance-101" + } + ] + }, + "values": [ + { + "unit": "percent", + "metric_name": "cpu_util", + "type": "int", + "value": 35 + } + ], + "collect_time": 1467787152000 + } +]+
Response parameters
+Table 6 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success" +}+
Table 7 describes the status code.
+ + +Table 8 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0001 + |
+Invalid request parameter. + |
+Check whether the parameter meets requirements. + |
+
AOM.0002 + |
+Invalid namespace. + |
+Check whether the parameter meets requirements. + |
+
AOM.0003 + |
+Dimensions are left blank. + |
+Check whether the parameter meets requirements. + |
+
AOM.0005 + |
+Invalid metric data type. + |
+Check whether the parameter meets requirements. + |
+
AOM.0006 + |
+The metric data value is left blank. + |
+Check whether the parameter meets requirements. + |
+
AOM.0007 + |
+Invalid name or value length in the dimension. + |
+Check whether the parameter meets requirements. + |
+
AOM.0008 + |
+The request exceeds 40 KB. + |
+Check whether the parameter meets requirements. + |
+
AOM.0009 + |
+A metric supports a maximum of 20 dimensions. + |
+Check whether the parameter meets requirements. + |
+
AOM.0010 + |
+Invalid collection time. + |
+Check whether the parameter meets requirements. + |
+
AOM.0500 + |
+Internal server error. + |
+Contact technical support. + |
+
This API is used to add a threshold rule.
+POST /v2/{project_id}/ams/alarms
+Request parameters
+Table 1 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
project_id + |
+Yes + |
+String + |
+Non-null. + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
statistic + |
+Yes + |
+String + |
+maximum, minimum, average, sum, or sampleCount. + |
+Statistic. + |
+
namespace + |
+Yes + |
+String + |
+1–255 characters. Colons (:) are not allowed. + |
+Namespace. + |
+
metricName + |
+Yes + |
+String + |
+1–255 characters. + |
+Metric name. + |
+
period + |
+Yes + |
+Integer + |
+20000, 60000, 300000, 900000, 1800000, 3600000, 14400000, or 86400000 + |
+Statistical period. + |
+
alarmLevel + |
+No + |
+Integer + |
+4, 3, 2, or 1 + |
+Alarm severity. + |
+
evaluationPeriods + |
+Yes + |
+Integer + |
+4, 3, or 2 + |
+Number of consecutive periods. + |
+
comparisonOperator + |
+Yes + |
+String + |
+>, >=, <, or <= + |
+Comparison operator. + |
+
threshold + |
+Yes + |
+String + |
+Non-null value that can be converted to a value of the double type. Once converted, the value cannot be null, or be a positive or negative infinity. + |
+Threshold. + |
+
alarmName + |
+Yes + |
+String + |
+1–255 characters. Special characters are not allowed. + |
+Threshold name. + |
+
dimensions + |
+Yes + |
+List + |
+Non-null; number of dimensions < 100 + |
+Metric dimension. + |
+
unit + |
+No + |
+String + |
+Number of characters < 32 + |
+Metric unit. + |
+
actionEnabled + |
+No + |
+Boolean + |
+- + |
+Whether to enable the alarm function. + |
+
alarmActions + |
+No + |
+Array + |
+Size ≤ 5 + |
+Alarm action. + |
+
alarmAdvice + |
+No + |
+String + |
+Number of characters < 255 + |
+Suggestion. + |
+
alarmDescription + |
+No + |
+String + |
+Number of characters < 255 + |
+Threshold rule description. + |
+
insufficientDataActions + |
+No + |
+Array + |
+Size ≤ 5 + |
+Action to be taken when data is insufficient. + |
+
okActions + |
+No + |
+Array + |
+Size ≤ 5 + |
+Recovery action. + |
+
Request headers
+Table 2 describes the request headers.
+ +Name + |
+Mandatory + |
+Description + |
+
---|---|---|
X-Auth-Token + |
+Yes + |
+User token obtained from IAM. + |
+
Content-Type + |
+Yes + |
+Content type, which is application/json. + |
+
Example request
+{ + "actionEnabled": false, + "alarmActions": [], + "alarmAdvice": "", + "alarmDescription": "", + "alarmLevel": 3, + "alarmName": "aaaaaaaa", + "comparisonOperator": ">=", + "dimensions": [ + { + "name": "appName", + "value": "rhm-broker" + } + ], + "evaluationPeriods": 1, + "insufficientDataActions": [], + "metricName": "cpuCoreLimit", + "namespace": "PAAS.CONTAINER", + "okActions": [], + "period": 60000, + "statistic": "average", + "threshold": 0, + "unit": "Core" +}+
Response parameters
+Table 3 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
alarmId + |
+Long + |
+Threshold rule code. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success", + "alarmId": 12345678 +}+
Table 4 describes the status code.
+ + +Table 5 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0101 + |
+Invalid alarm name. + |
+Check whether the parameter meets requirements. + |
+
AOM.0102 + |
+The threshold rule name already exists. + |
+Use another name. + |
+
AOM.0103 + |
+Invalid alarm description. + |
+Check whether the parameter meets requirements. + |
+
AOM.0104 + |
+Invalid alarm threshold. + |
+Check whether the parameter meets requirements. + |
+
AOM.0105 + |
+Invalid alarm period. + |
+Check whether the parameter meets requirements. + |
+
AOM.0106 + |
+Invalid email list. + |
+Check whether the parameter meets requirements. + |
+
AOM.0107 + |
+The maximum number of threshold rules has been reached. + |
+Contact technical support to expand the capacity. + |
+
AOM.0108 + |
+Invalid time range for alarm queries. + |
+Check whether the parameter meets requirements. + |
+
AOM.0109 + |
+Invalid project ID. + |
+Check whether the parameter meets requirements. + |
+
AOM.0115 + |
+Invalid request parameter. + |
+Check whether the parameter meets requirements. + |
+
AOM.0118 + |
+Invalid number of consecutive periods. + |
+Check whether the parameter meets requirements. + |
+
AOM.0119 + |
+Invalid alarm statistic. + |
+Check whether the parameter meets requirements. + |
+
AOM.0120 + |
+Invalid alarm comparison operator. + |
+Check whether the parameter meets requirements. + |
+
AOM.0121 + |
+The alarm does not exist. + |
+Check whether the threshold rule exists. + |
+
AOM.0500 + |
+Internal server error. + |
+Contact technical support. + |
+
This API is used to query a threshold rule list.
+GET /v2/{project_id}/ams/alarms
+Request parameters
+Table 1 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
project_id + |
+Yes + |
+String + |
+- + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
limit + |
+No + |
+Integer + |
+(0,1000] + |
+Value range: 1–1000. Default value: 1000. +Maximum number of returned records. + |
+
start + |
+No + |
+Integer + |
+[0, (Maximum value of the int type – 1000)] + |
+Pagination information. + |
+
Request headers
+Table 2 describes the request headers.
+ + +Response parameters
+Table 3 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
metaData + |
+JSON object + |
+Metadata, including pagination information. + |
+
metaData.count + |
+Integer + |
+Number of returned records. + |
+
metaData.total + |
+Integer + |
+Total number of records. + |
+
metaData.start + |
+String + |
+Start of the next page, which is used for pagination. + |
+
thresholds + |
+JSON array + |
+Threshold rule list. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success", + "metaData": { + "count": 10, + "start": null, + "total": 100 + }, + "thresholds": + [ + { + "id": "2137", + "alarmName": "aaaaaaaa", + "alarmDescription": "", + "actionEnabled": false, + "okActions": [], + "alarmActions": [], + "insufficientDataActions": [], + "stateValue": "alarm", + "stateReason": "", + "stateUpdatedTimestamp": null, + "metricName": "cpuCoreLimit", + "namespace": "PAAS.CONTAINER", + "statistic": "average", + "dimensions": [ + { + "name": "appName", + "value": "rhm-broker" + } + ], + "period": 60000, + "evaluationPeriods": 1, + "unit": "Core", + "threshold": "0", + "comparisonOperator": ">=", + "alarmAdvice": "", + "alarmLevel": 3 + } + ] +}+
Table 4 describes the status code.
+ + +Table 5 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0109 + |
+Invalid project ID. + |
+Check whether the parameter meets requirements. + |
+
AOM.0110 + |
+Invalid limit. + |
+Check whether the parameter meets requirements. + |
+
AOM.0111 + |
+Invalid start. + |
+Check whether the parameter meets requirements. + |
+
AOM.0501 + |
+The Cassandra session is null. + |
+Contact technical support. + |
+
AOM.0502 + |
+The Cassandra execution is abnormal. + |
+Contact technical support. + |
+
This API is used to query a threshold rule.
+GET /v2/{project_id}/ams/alarms/{alarm_id}
+Request parameters
+Table 1 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
project_id + |
+Yes + |
+String + |
+- + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
alarm_id + |
+Yes + |
+String + |
+Non-null value that can be converted to a value of the long type. + |
+Threshold rule ID. + |
+
Request headers
+Table 2 describes the request headers.
+ + +Response parameters
+Table 3 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
thresholds + |
+JSON array + |
+Threshold rule list. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success", + "thresholds": + [ + { + "id": "2137", + "alarmName": "aaaaaaaa", + "alarmDescription": "", + "actionEnabled": false, + "okActions": [], + "alarmActions": [], + "insufficientDataActions": [], + "stateValue": "alarm", + "stateReason": "", + "stateUpdatedTimestamp": null, + "metricName": "cpuCoreLimit", + "namespace": "PAAS.CONTAINER", + "statistic": "average", + "dimensions": [ + { + "name": "appName", + "value": "rhm-broker" + } + ], + "period": 60000, + "evaluationPeriods": 1, + "unit": "Core", + "threshold": "0", + "comparisonOperator": ">=", + "alarmAdvice": "", + "alarmLevel": 3 + } + ] +}+
Table 4 describes the status code.
+ + +Table 5 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0115 + |
+Invalid request parameter. + |
+Check whether the parameter meets requirements. + |
+
AOM.0501 + |
+The Cassandra session is null. + |
+Contact technical support. + |
+
AOM.0502 + |
+The Cassandra execution is abnormal. + |
+Contact technical support. + |
+
This API is used to delete a threshold rule.
+DELETE /v2/{project_id}/ams/alarms/{alarm_id}
+Request parameters
+Table 1 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
project_id + |
+Yes + |
+String + |
+- + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
alarm_id + |
+Yes + |
+String + |
+Non-null value that can be converted to a value of the long type. + |
+Threshold rule ID. + |
+
Request headers
+Table 2 describes the request headers.
+ +Name + |
+Mandatory + |
+Description + |
+
---|---|---|
X-Auth-Token + |
+Yes + |
+User token obtained from IAM. + |
+
Content-Type + |
+Yes + |
+Content type, which is application/json. + |
+
Example request
+/v2/{project_id}/ams/alarms/al1441967036681YkazZ0deN+
Response parameters
+Table 3 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "Delete Threshold [xxx] successfully ." +}+
Table 4 describes the status code.
+ + +Table 5 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0115 + |
+Invalid request parameter. + |
+Check whether the parameter meets requirements. + |
+
AOM.0501 + |
+The Cassandra session is null. + |
+Contact technical support. + |
+
AOM.0502 + |
+The Cassandra execution is abnormal. + |
+Contact technical support. + |
+
This API is used to modify a threshold rule.
+PUT /v2/{project_id}/ams/alarms
+Request parameters
+Table 1 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
project_id + |
+Yes + |
+String + |
+- + |
+Project ID obtained from IAM. Generally, a project ID contains 32 characters. + |
+
statistic + |
+Yes + |
+String + |
+maximum, minimum, average, sum, or sampleCount. + |
+Statistic. + |
+
namespace + |
+Yes + |
+String + |
+1–255 characters. Colons (:) are not allowed. + |
+Namespace. The value transferred to the backend when a threshold rule is added will be used. The value transferred here will not replace that value. + |
+
metricName + |
+Yes + |
+String + |
+1–255 characters. + |
+Metric name. The value transferred to the backend when a threshold rule is added will be used. The value transferred here will not replace that value. + |
+
period + |
+Yes + |
+Integer + |
+20000, 60000, 300000, 900000, 1800000, 3600000, 14400000, or 86400000 + |
+Statistical period. + |
+
alarmLevel + |
+No + |
+Integer + |
+4, 3, 2, or 1 + |
+Alarm severity. + |
+
evaluationPeriods + |
+Yes + |
+Integer + |
+4, 3, or 2 + |
+Number of consecutive periods. + |
+
comparisonOperator + |
+Yes + |
+String + |
+>, >=, <, or <= + |
+Comparison operator. + |
+
threshold + |
+Yes + |
+String + |
+Non-null value that can be converted to a value of the double type. Once converted, the value cannot be null, or be a positive or negative infinity. + |
+Threshold. + |
+
alarmName + |
+Yes + |
+String + |
+1–255 characters. Special characters are not allowed. + |
+Threshold name. + |
+
dimensions + |
+Yes + |
+List + |
+Non-null; size < 100 + |
+Metric dimension. The value transferred to the backend when a threshold rule is added will be used. The value transferred here will not replace that value. + |
+
unit + |
+No + |
+String + |
+Number of characters < 32 + |
+Metric unit. The value transferred to the backend when a threshold rule is added will be used. The value transferred here will not replace that value. + |
+
actionEnabled + |
+No + |
+Boolean + |
+- + |
+Whether to enable the alarm function. + |
+
alarmActions + |
+No + |
+Array + |
+Size ≤ 5 + |
+Alarm action. + |
+
alarmAdvice + |
+No + |
+String + |
+Number of characters < 255 + |
+Alarm suggestion. Leave this parameter blank. + |
+
alarmDescription + |
+No + |
+String + |
+Number of characters < 255 + |
+Threshold rule description. + |
+
insufficientDataActions + |
+No + |
+Array + |
+Size ≤ 5 + |
+Action to be taken when data is insufficient. + |
+
okActions + |
+No + |
+Array + |
+Size ≤ 5 + |
+Recovery action. + |
+
Request headers
+Table 2 describes the request headers.
+ + +Example request
+{ + "actionEnabled": false, + "alarmActions": [], + "alarmAdvice": "", + "alarmDescription": "", + "alarmLevel": 3, + "alarmName": "aaaaaaaa", + "comparisonOperator": ">=", + "dimensions": [ + { + "name": "appName", + "value": "rhm-broker" + } + ], + "evaluationPeriods": 1, + "insufficientDataActions": [], + "metricName": "cpuCoreLimit", + "namespace": "PAAS.CONTAINER", + "okActions": [], + "period": 60000, + "statistic": "average", + "threshold": 0, + "unit": "Core" +}+
Response parameters
+Table 3 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. + |
+
errorMessage + |
+String + |
+Response message. + |
+
alarmId + |
+Long + |
+Threshold rule code. + |
+
Example response
+{ + "errorCode": "AOM.0200", + "errorMessage": "success", + "alarmId": 12345678 +}+
Table 4 describes the status code.
+ + +Table 5 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0101 + |
+Invalid alarm name. + |
+Check whether the parameter meets requirements. + |
+
AOM.0102 + |
+The threshold rule name already exists. + |
+Use another name. + |
+
AOM.0103 + |
+Invalid alarm description. + |
+Check whether the parameter meets requirements. + |
+
AOM.0104 + |
+Invalid alarm threshold. + |
+Check whether the parameter meets requirements. + |
+
AOM.0105 + |
+Invalid alarm period. + |
+Check whether the parameter meets requirements. + |
+
AOM.0106 + |
+Invalid email list. + |
+Check whether the parameter meets requirements. + |
+
AOM.0107 + |
+The maximum number of threshold rules has been reached. + |
+Contact technical support to expand the capacity. + |
+
AOM.0108 + |
+Invalid time range for alarm queries. + |
+Check whether the parameter meets requirements. + |
+
AOM.0109 + |
+Invalid project ID. + |
+Check whether the parameter meets requirements. + |
+
AOM.0115 + |
+Invalid request parameter. + |
+Check whether the parameter meets requirements. + |
+
AOM.0118 + |
+Invalid number of consecutive periods. + |
+Check whether the parameter meets requirements. + |
+
AOM.0119 + |
+Invalid alarm statistic. + |
+Check whether the parameter meets requirements. + |
+
AOM.0120 + |
+Invalid alarm comparison operator. + |
+Check whether the parameter meets requirements. + |
+
AOM.0121 + |
+The alarm does not exist. + |
+Check whether the threshold rule exists. + |
+
AOM.0500 + |
+Internal server error. + |
+Contact technical support. + |
+
This API is used to query logs by different dimensions such as cluster, IP address, or application.
+Request parameters
+Table 2 describes the request parameters.
+ +Parameter + |
+Mandatory + |
+Type + |
+Value Range + |
+Description + |
+
---|---|---|---|---|
Condition + |
+Yes + |
+String + |
+{ +"category": "app_log", +"searchKey": +{ +"clusterId": "c693fa7c-54cd-11e8-8055-0255ac101e40", +"nameSpace": "", +"appName": "", +"podName": "", +"pathFile": "", +"hostIP":"" +}, +"keyWord": "", +"startTime": 1538970064983, +"endTime": 1538970364983, +"hideSyslog": 0 +} + |
+Condition in JSON format, which must be in the request body during calling. + |
+
category + |
+Yes + |
+String + |
+app_log,node_log,custom_log + |
+Log type: +
|
+
searchKey + |
+Yes + |
+JSON + |
+- + |
+Log filter criteria, which vary according to log sources. + |
+
clusterId + |
+Yes + |
+String + |
+- + |
+Cloud Container Engine (CCE) cluster ID. + |
+
nameSpace + |
+No + |
+String + |
+- + |
+CCE cluster namespace. + |
+
appName + |
+No + |
+String + |
+- + |
+Service name. + |
+
podName + |
+No + |
+String + |
+- + |
+Container pod name. + |
+
pathFile + |
+No + |
+String + |
+- + |
+Log file name. + |
+
hostIP + |
+No + |
+String + |
+- + |
+IP address of the VM where logs are located. + |
+
keyWord + |
+No + |
+String + |
+- + |
+
NOTE:
+Default delimiters: +, '";=()[]{}@&<>/:\n\t\r + |
+
startTime + |
+Yes + |
+Long + |
+- + |
+Start time of the query (UTC, in ms). + |
+
endTime + |
+Yes + |
+Long + |
+- + |
+End time of the query (UTC, in ms). + |
+
hideSyslog + |
+No + |
+Integer + |
+0 or 1 + |
+Whether to hide the system log (icagent\kubectl) during the query. 0 (default): Hide. 1: Not hide. + |
+
Request headers
+Table 3 describes the request headers.
+ +Name + |
+Mandatory + |
+Description + |
+
---|---|---|
X-Auth-Token + |
+Yes + |
+User token obtained from IAM. + |
+
Content-Type + |
+Yes + |
+Content type, which is application/json. + |
+
Example request
+/v2/{project_id}/als/action?type=querylogs +{ + "category": "app_log", + "searchKey": + { + "clusterId": "c693fa7c-54cd-11e8-8055-0255ac101e40", + "nameSpace" : "", + "appName" : "", + "podName" : "", + "pathFile" : "", + "hostIP" : "" + }, + "keyWord": "", + "startTime": 1538970064983, + "endTime": 1538970364983, + "hideSyslog": 0 +}+
Response parameters
+Table 4 describes the response parameters.
+ +Parameter + |
+Type + |
+Description + |
+
---|---|---|
errorCode + |
+String + |
+Response code. Example: AOM.0200, which indicates a success response. + |
+
errorMessage + |
+String + |
+Response message. + |
+
result + |
+JSON object + |
+Metadata, including total number of returned records and results. + |
+
total + |
+Integer + |
+Number of returned records. + |
+
data + |
+JSON array + |
+Data array. + |
+
category + |
+String + |
+Log type. + |
+
loghash + |
+String + |
+Hash value of the log source. + |
+
clusterId + |
+String + |
+Cloud Container Engine (CCE) cluster ID. + |
+
clusterName + |
+String + |
+CCE cluster name. + |
+
nameSpace + |
+String + |
+CCE cluster namespace. + |
+
podName + |
+String + |
+CCE container pod name. + |
+
appName + |
+String + |
+Service name. + |
+
serviceID + |
+String + |
+Service ID of an AOM resource. + |
+
containerName + |
+String + |
+CCE container name. + |
+
logContent + |
+String + |
+Source log data. + |
+
pathFile + |
+String + |
+Absolute path of a log file. + |
+
hostIP + |
+String + |
+IP address of the VM where log files are located. + |
+
hostId + |
+String + |
+ID of a host in a cluster. + |
+
hostName + |
+String + |
+Name of the VM where log files are located. + |
+
collectTime + |
+String + |
+Log collection time (UTC time, in ms). + |
+
lineNum + |
+String + |
+Sequence number of a log line. + |
+
logContentSize + |
+String + |
+Size of a single-line log. + |
+
Example response
+{ + "errorCode":"AOM.0200", + "errorMessage":"Query data success", + "result":"{\"total\":5000, + \"data\":[{\"category\":\"app\", + \"loghash\":\"496b2070d40a83c17f2625401af8a50aadc316f216771fbe38b94d31feaa30eb\", + \"clusterId\":\"c693fa7c-54cd-11e8-8055-0255ac101e40\", + \"clusterName\":\"aomdemo\", + \"nameSpace\":\"default\", + \"podName\":\"als0712-7c4875f884-q5wwp\", + \"appName\":\"als0712\", + \"serviceID\":\"\", + \"containerName\":\"container-0\", + \"logContent\":\"warn:2018/10/09 06:57:01 helloworld.go:108: the main process is running now.\\n\", + \"pathFile\":\"/var/paas/sys/log/apm/debug_erro.trace\", + \"hostIP\":\"192.168.0.133\", + \"hostId\":\"c11c7211-5a0b-4925-bef4-d078661299b0\", + \"hostName\":\"192.168.0.133\", + \"collectTime\":\"1539068233983\", + \"lineNum\":\"15390682339830002\", + \"logContentSize\":\"77\" + }] + }" +}+
Table 5 describes the status code.
+ + +Table 6 describes the status codes. For more information, see Status Codes.
+ +Status Code + |
+Message + |
+Description + |
+
---|---|---|
400 + |
+Bad Request + |
+The request is invalid. +The client should not repeat the request without modifications. + |
+
401 + |
+Unauthorized + |
+The authorization information provided by the client is incorrect or invalid. + |
+
403 + |
+Forbidden + |
+The request is rejected. +The server has received the request and understood it, but the server is refusing to respond to it. The client should not repeat the request without modifications. + |
+
500 + |
+Internal Server Error + |
+The server is able to receive the request but unable to understand the request. + |
+
503 + |
+Service Unavailable + |
+The requested service is invalid. +The client should not repeat the request without modifications. + |
+
Error Code + |
+Message + |
+Solution + |
+
---|---|---|
AOM.0200 + |
+Data queried successfully. + |
+- + |
+
AOM.0201 + |
+{XXX} is invalid. + NOTE:
+XXX indicates a specific parameter. + |
+Check whether the parameter meets requirements. + |
+
AOM.0203 + |
+No logs found. + |
+Check whether the parameter meets requirements. + |
+