All Products
Search
Document Center

Managed Service for Prometheus:CreatePrometheusInstance

Last Updated:May 09, 2024

Creates a Prometheus instance.

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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:CreatePrometheusInstanceWrite
  • 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 cluster to which the Prometheus instance belongs. Valid values:

  • remote-write: Prometheus instance for remote write.
  • ecs(Not supported): Prometheus instance for ECS.
  • cloud-monitor(Not supported): Prometheus instance for Alibaba Cloud services in China.
  • cloud-product(Not supported): Prometheus instance for Alibaba Cloud services outside China.
  • global-view: Prometheus instance for GlobalView.
  • aliyun-cs(Not supported): Prometheus instance for Container Service for Kubernetes (ACK).
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

Data storage duration (in days).

90
ArchiveDurationintegerNo

The number of days for automatic archiving after storage expiration (optional values: 60, 90, 180, 365). 0 means not archive.

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 changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: ArchiveDuration
2024-02-28The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: Duration
2023-08-17The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    delete Input Parameters: ParamJson
2023-08-11The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: ParamJson
2023-03-29The request parameters of the API has changedsee changesets
Change itemChange content
Input ParametersThe request parameters of the API has changed.
    Added Input Parameters: AllSubClustersSuccess