All Products
Search
Document Center

Managed Service for Prometheus:CreateEnvironment

Last Updated:Nov 05, 2024

Creates an environment 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:CreateEnvironmentcreate
  • Environment
    acs:arms:{#regionId}:{#accountId}:environment/*
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID.

cn-hangzhou
AliyunLangstringNo

The language. Default value: zh.

Valid values:

  • en: English
  • zh: Chinese
zh
EnvironmentNamestringYes

The name of the environment.

env1
EnvironmentTypestringYes

The type of the environment. Valid values:

  • CS: Container Service
  • ECS: Elastic Compute Service
  • Cloud: cloud service
CS
EnvironmentSubTypestringYes

The subtype of the environment. Valid values:

  • CS: Container Service for Kubernetes (ACK) or Distributed Cloud Container Platform for Kubernetes (ACK One)
  • ECS: ECS
  • Cloud: cloud service
ECS, ACK, etc.
BindResourceIdstringYes

The ID of the resource bound to the environment, such as the container ID or VPC ID. For a Cloud environment, specify the region ID.

c6e9dec475dca4a50a188411d8cbxxx
ManagedTypestringNo

Specifies whether agents or exporters are managed. Valid values:

  • none: No. By default, no managed agents or exporters are provided for ACK clusters.
  • agent: Agents are managed. By default, managed agents are provided for ASK clusters, ACS clusters, and ACK One clusters.
  • agent-exporter: Agents and exporters are managed. By default, managed agents and exporters are provided for cloud services.
none
FeePackagestringNo

The payable resource plan.

  • If the EnvironmentType parameter is set to CS, set the value to CS_Basic or CS_Pro. Default value: CS_Basic.
  • Otherwise, leave the parameter empty.
CS_Basic
PrometheusInstanceIdstringNo

The ID of the Prometheus instance. If no Prometheus instance is created, call the InitEnvironment operation.

c6e9dec475dca4a50a188411d8cbxxx
GrafanaWorkspaceIdstringNo

The ID of the Grafana workspace associated with the environment. If this parameter is left empty, the default shared Grafana workspace is used.

grafana-rnglkcdrntlhk0****
ResourceGroupIdstringNo

The ID of the resource group.

rg-acfmxyexli2****
Tagsarray<object>No

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

objectNo

The list of tags.

KeystringNo

The tag key.

TestKey
ValuestringNo

The tag value.

TestValue
InitEnvironmentbooleanNo

Specifies whether to initialize the environment.

false

Response parameters

ParameterTypeDescriptionExample
object

Schema of Response

RequestIdstring

The request ID.

16AF921B-8187-489F-9913-43C808B4****
Codeinteger

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

200
Datastring

The ID of the created environment.

env-xxxxx
Messagestring

The returned message.

message

Examples

Sample success responses

JSONformat

{
  "RequestId": "16AF921B-8187-489F-9913-43C808B4****",
  "Code": 200,
  "Data": "env-xxxxx",
  "Message": "message"
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-06-17The request parameters of the API has changedView Change Details
2024-05-28The request parameters of the API has changedView Change Details
2024-05-08The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-03-19The request parameters of the API has changedView Change Details
2024-02-23The request parameters of the API has changedView Change Details
2024-01-09The request parameters of the API has changedView Change Details
2023-11-03The internal configuration of the API is changed, but the call is not affectedView Change Details