CreatePrometheusInstance

Updated at:

Creates a Prometheus monitoring instance.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

cms:CreatePrometheusInstance

create

*PrometheusInstance

acs:cms:{#regionId}:{#accountId}:prometheusinstance/*

None None

Request syntax

POST /prometheus-instances HTTP/1.1

Request parameters

Parameter

Type

Required

Description

Example

body

object

No

The request structure.

archiveDuration

integer

No

The number of days to automatically archive data after the storage period expires. A value of 0 indicates that data is not archived. Valid values for the archive duration:

  • V1: 60 to 365 days.

  • V2: 60 to 3650 days. A value of 3650 indicates permanent retention.

60

authFreeReadPolicy

string

No

The authentication-free read policy. IP address ranges and VPC IDs are supported.

{ "SourceIp": [ "192.168.1.0/24", "172.168.2.22" ], "SourceVpc": [ "vpc-xx1", "vpc-xx2" ] }

authFreeWritePolicy

string

No

The authentication-free write policy.

{ "SourceIp": [ "192.168.1.0/24", "172.168.2.22" ], "SourceVpc": [ "vpc-xx1", "vpc-xx2" ] }

enableAuthFreeRead

boolean

No

Specifies whether to enable authentication-free read access. This feature is supported only in V2.

true

enableAuthFreeWrite

boolean

No

Specifies whether to enable authentication-free write access. This feature is supported only in V2.

true

enableAuthToken

boolean

No

Specifies whether to enable the authorization token. This feature is supported only in V1.

true

prometheusInstanceName

string

Yes

The name of the instance.

name1

resourceGroupId

string

No

The ID of the resource group.

rg-aekz5qqvjyatgoy

status

string

No

The instance status.

Valid values:

  • Running :

    Running

  • Stoped :

    Stoped

Running

storageDuration

integer

No

The storage duration in days.

  • By written data volume: 90 and 180.

  • By reported metric volume: 15, 30, 60, 90, and 180.

Valid values:

  • 15 :

    15 days.

  • 30 :

    30 days.

  • 60 :

    60 days.

  • 90 :

    90 days.

  • 180 :

    180 days.

90

tags

array<object>

No

The tags.

object

No

The tags.

key

string

No

The tag key.

key1

value

string

No

The tag value.

110109200001214284

workspace

string

No

The workspace to which the instance belongs. Default value: default-cms-{userId}-{regionId}.

wokspace1

paymentType

string

No

Billable methods. Valid values:

  • POSTPAY: pay-as-you-go based on the volume of reported metrics.

  • POSTPAY_GB: pay-as-you-go based on the volume of written metrics. Note: If this parameter is left empty, the default billing method configured for the user is used. If no default billing method is configured, the system uses the pay-as-you-go billing method based on the volume of reported metrics by default.

Valid values:

  • POSTPAY :

    Reported metric volume.

  • POSTPAY_GB :

    Written metric volume.

POSTPAY

dryrun

boolean

No

Specifies whether to perform a dry run only. Valid values:

  • true: performs a dry run without creating the instance. The system checks whether required parameters are specified, the request format is valid, and service limits are met. If the request fails the check, an error is returned. If the request passes the check, the DryRunOperation error code is returned.

  • false: sends a normal request and creates the instance directly after the request passes the check. This is the default value.

Response elements

Element

Type

Description

Example

object

prometheusInstanceId

string

The ID of the instance.

rw-abc123

requestId

string

Id of the request

264C3E89-BE6E-5F82-A484-CE9C2196C7DC

Examples

Success response

JSON format

{
  "prometheusInstanceId": "rw-abc123",
  "requestId": "264C3E89-BE6E-5F82-A484-CE9C2196C7DC"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.