Obtaining Environment Details Based on the Environment ID
Function
This API is used to obtain environment details based on the environment ID.
Authorization Information
Each account has all of the permissions required to call all APIs, but IAM users must have the required permissions specifically assigned.
- If you are using role/policy-based authorization, see the required permissions in Permissions and Supported Actions.
- If you are using identity policy-based authorization, the permission listed below is required.
Action
Access Level
Resource Type (*: required)
Condition Key
Alias
Dependencies
servicestage:environment:get
read
environment *
servicestage:app:get
-
URI
GET /v3/{project_id}/cas/environments/{environment_id}
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| project_id | Yes | String | Definition Tenant's project ID. See Obtaining a Project ID. Constraints N/A Range N/A Default Value N/A |
| environment_id | Yes | String | Definition Environment ID. See Obtaining All Environments. Constraints N/A Range N/A Default Value N/A |
Request
| Parameter | Mandatory | Type | Description |
|---|---|---|---|
| Content-Type | Yes | String | Definition Message body type (or format). Constraints N/A Range application/json;charset=utf8 Default Value N/A |
| X-Auth-Token | Yes | String | Definition API calling can be authenticated using a token or AK/SK. If you use a token, this parameter is mandatory and must be set to the token. For details about how to obtain the token, see Authentication. Constraints N/A Range N/A Default Value N/A |
Response
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Environment ID. Range N/A |
| name | String | Definition Environment name. Range N/A |
| description | String | Definition Environment description. Range N/A |
| project_id | String | Definition Project ID. Range N/A |
| enterprise_project_id | String | Definition Enterprise project ID. Range N/A |
| deploy_mode | String | Definition Environment type. Range
|
| vpc_id | String | Definition VPC ID. Range N/A |
| creator | String | Definition Environment creator. Range N/A |
| create_time | Integer | Definition Environment creation time. Range N/A |
| update_time | Integer | Definition Environment update time. Range N/A |
| labels | Array of objects | Definition Label. You can use TMS to filter resources by labels. See Table 4. |
| resources | Array of objects | Definition Resource. See Table 5. |
| type | String | Definition Whether the Kubernetes environment is of the HA type. Range
|
| resource_create_mode | String | Definition Resource configuration mode. Range
|
| config_mode | String | Definition Configuration mode. Range
|
| env_status | String | Definition Environment resource status (non-real-time status). Range
|
| configuration | Object | Definition Environment variable of the environment. See Table 7. |
| Parameter | Type | Description |
|---|---|---|
| key | String | Definition Label name. Range N/A |
| value | String | Definition Label value. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| id | String | Definition Resource ID. Range N/A |
| name | String | Definition Resource name. Range N/A |
| type | String | Definition Resource type. Range
|
| core | String | Definition Number of cores of the custom server. This parameter is returned when the resource type is customServer. Range N/A |
| gib | String | Definition Memory of the custom server, in Gib. This parameter is returned when the resource type is customServer. Range N/A |
| parameters | Map<String, String> | Definition Resource parameters. See Table 6. |
| Parameter | Type | Description |
|---|---|---|
| kube_config | String | Definition Kubernetes connection configuration file. This parameter is returned when the resource type is custom_k8s. Range N/A |
| Parameter | Type | Description |
|---|---|---|
| resource_envs | Array of objects | Definition Resource variable bound to the environment. See Table 8. |
| envs | Array of objects | Definition Environment variable of the environment. See Table 9. |
| Parameter | Type | Description |
|---|---|---|
| resource_id | String | Definition ID of the resource associated with the resource variable bound to the environment. Range N/A |
| resource_name | String | Definition Name of the resource associated with the resource variable bound to the environment. Range N/A |
| resource_type | String | Definition Type of the resource associated with the resource variable bound to the environment. Range
|
| envs | Array of objects | Definition Resource variable bound to the environment. See Table 9. |
Example Request
None
Example Response
{
"id": "ea011e01-2eb5-453f-87bf-874e4a855abe",
"name": "dev-env",
"description": "develop environment",
"project_id": "bf8523d898b64e4eb956e3be3555ca16",
"enterprise_project_id": "0",
"deploy_mode": "virtualmachine",
"vpc_id": "234241234124xxvasf2342xxxxxxxxxxx",
"resources": [
{
"id": "329b135e-7b31-4ea6-afb9-b69017bd0a80",
"type": "ecs",
"name": "ecs-test"
}
],
"creator": "ss-test",
"create_time": 1578984198394,
"update_time": 1578984198394,
"labels": null
} Status Code
| Status Code | Description |
|---|---|
| 200 | OK |
| 400 | Bad Request |
| 404 | Not Found |
| 500 | Internal Server Error |
Error Code
What is your overall rating for this page?
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot