All Products
Search
Document Center

Application Real-Time Monitoring Service:CreatePrometheusInstance

Last Updated:Nov 05, 2024

Creates a Prometheus instance.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
arms:CreatePrometheusInstancecreate
  • Prometheus
    acs:arms:{#regionId}:{#accountId}:prometheus/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The ID of the region. If you use a Prometheus instance to monitor an Alibaba Cloud service in China, this parameter must be set to cn-shanghai.

cn-shanghai
ClusterTypestringYes

The type of the Prometheus instance. Valid values:

  • remote-write: Prometheus instance for Remote Write
  • ecs (unavailable): Prometheus instance for ECS
  • global-view: Prometheus instance for GlobalView
  • aliyun-cs: Prometheus instance for Container Service
  • cloud-product (unavailable): Prometheus instance for Alibaba Cloud services
  • cloud-monitor (unavailable): Prometheus instance for Hybrid Cloud Monitoring
  • flink (unavailable): Prometheus instance for Flink
remote-write
VpcIdstringNo

The ID of virtual private cloud (VPC). This parameter is required if you set the ClusterType parameter to ecs.

vpc-rpn**********
VSwitchIdstringNo

The ID of the vSwitch. This parameter is required if you set the ClusterType parameter to ecs.

vsw-bp1*********
SecurityGroupIdstringNo

The ID of the security group. This parameter is required if you set the ClusterType parameter to ecs.

sg-bp1********
ClusterIdstringNo

The ID of the ACK cluster. This parameter is required if you set the ClusterType parameter to aliyun-cs.

cc7a37ee31aea4ed1a059eff8034b****
ClusterNamestringNo

The name of the created cluster. This parameter is required if you set the ClusterType parameter to remote-write or ecs.

clusterNameOfTest
SubClustersJsonstringNo

JSON string for child instances of the globalView instance.

When the clusterType is global view, this parameter needs to be passed: a list of information about the clusters that need to be aggregated. Example: [ { "Headers":{ }, "RegionId": "cn hangzhou", "SourceType": "Alibaba Prometheus", "Extras":{ }, "ClusterId": "c39a1048921e04f ****************", "SourceName": "test1", "DataSource": "", "UserId": "1672753 ******************" }, { "Headers":{ }, "RegionId": "cn beijing", "SourceType": "Alibaba Prometheus", "Extras":{ }, "ClusterId": "c6b6485496d5b40 ****************", "SourceName": "test2", "DataSource": "", "UserId": "1672753 ******************" }, { "Headers":{ }, "RegionId": "cn zhangjiakou", "SourceType": "Alibaba Prometheus", "Extras":{ }, "ClusterId": "c261a4f3200c446 ****************", "SourceName": "test3", "DataSource": "", "UserId": "1672753 ******************" } ]
AllSubClustersSuccessbooleanNo

Does it require all child instances to be verified successfully before creating a GlobalView instance. The default is false, which means partial success is possible.

true
GrafanaInstanceIdstringYes

The ID of the Grafana dedicated instance. This parameter is available if you set the ClusterType parameter to ecs.

grafana-bp1*****
ResourceGroupIdstringNo

The ID of the custom resource group. You can configure this parameter to bind the instance to the resource group.

rg-acfmxyexli2****
TagsstringNo

The tags of the instance. You can configure this parameter to manage tags for the instance.

[ { "labelName":"labelValue" }, { "testName":"clusterA" } ]
DurationintegerNo

The data storage duration. Unit: days.

90
ArchiveDurationintegerNo

The number of days for which data is automatically archived after the storage expires. Valid values: 60, 90, 180, and 365. 0 indicates that the data is not archived.

90

Response parameters

ParameterTypeDescriptionExample
object
Datastring

The ID of the created Prometheus instance.

qduukd****
RequestIdstring

The ID of the request.

70675725-8F11-4817-8106-CFE0AD71****
Messagestring

The message returned.

message
Codeinteger

The status code. The status code 200 indicates that the request was successful.

200

Examples

Sample success responses

JSONformat

{
  "Data": "qduukd****",
  "RequestId": "70675725-8F11-4817-8106-CFE0AD71****",
  "Message": "message",
  "Code": 200
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-04-12The request parameters of the API has changedView Change Details
2024-02-28The request parameters of the API has changedView Change Details
2023-08-17The request parameters of the API has changedView Change Details
2023-08-11The request parameters of the API has changedView Change Details
2023-03-29The request parameters of the API has changedView Change Details