ListEcsInstances
Queries a list of ECS instances in the VPC and vSwitch of the current user.
Operation description
Try it now
Test
RAM authorization
|
Action |
Access level |
Resource type |
Condition key |
Dependent action |
|
elasticsearch:ListCollectors |
get |
*All Resource
|
None | None |
Request syntax
GET /openapi/ecs HTTP/1.1
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| page |
integer |
No |
The page number of the returned results. Maximum value: 500. |
1 |
| size |
integer |
No |
The number of results per page. Default value: 10. Maximum value: 500. |
10 |
| ecsInstanceIds |
string |
No |
The list of ECS instance IDs. The value can be a JSON array that consists of multiple instance IDs. You can specify up to 100 IDs. Separate multiple IDs with commas (,). |
["i-bp13y63575oypr9d****","i-bp1gyhphjaj73jsr****"] |
| ecsInstanceName |
string |
No |
The name of the ECS instance. |
test |
| tags |
string |
No |
Instance tags of the ECS instance. A tag must contain the following fields:
|
[{ "tagKey":"a","tagValue":"b"}] |
| vpcId |
string |
No |
The ID of the VPC where the ECS instance resides. |
vpc-bp16k1dvzxtmagcva**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The ID of the request. |
5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D*** |
| Headers |
object |
The response headers. |
|
| X-Total-Count |
integer |
The number of returned records. |
11 |
| Result |
array<object> |
The returned results. |
|
|
array<object> |
|||
| ecsInstanceId |
string |
The ECS instance ID. |
i-bp14ncqge8wy3l3d**** |
| collectors |
array<object> |
The list of collectors on the ECS instance. |
|
|
array<object> |
|||
| configs |
array<object> |
The configuration file information of the collector. |
|
|
object |
|||
| fileName |
string |
The name of the file. |
fields.yml |
| content |
string |
The content of the file. |
- key: log\n title: Log file content\n description: >\n Contains log file lines.\n .... |
| dryRun |
boolean |
Specifies whether to verify and create the collector. Valid values:
|
false |
| resType |
string |
The type of the collector. Valid values: fileBeat, metricBeat, heartBeat, and auditBeat. |
fileBeat |
| ownerId |
string |
The ID of the account. |
16852***488***** |
| resId |
string |
The collector instance ID. |
ct-cn-0v3xj86085dvq**** |
| collectorPaths |
array |
The list of Filebeat collection paths. |
|
|
string |
The Filebeat collection path. |
["/var/log"] |
|
| gmtUpdateTime |
string |
The time when the collector was updated. |
2020-06-20T07:26:47.000+0000 |
| extendConfigs |
array<object> |
The extended parameter information. |
|
|
array<object> |
|||
| protocol |
string |
The transmission protocol, which must be consistent with the access protocol of the instance specified by the collector output. Valid values: HTTP and HTTPS. This parameter is displayed when configType is set to collectorTargetInstance. |
HTTP |
| enableMonitoring |
boolean |
Specifies whether to enable monitoring. This parameter is displayed when configType is set to collectorTargetInstance and instanceType is set to elasticsearch. Valid values:
|
true |
| instanceId |
string |
Instance ID of the instance associated with the collector. When configType is set to collectorTargetInstance, this parameter indicates instance ID of the collector output instance. When configType is set to collectorDeployMachines and type is set to ACKCluster, this parameter indicates instance ID of the ACK cluster. |
es-cn-nif1z89fz003i**** |
| hosts |
array |
The list of host addresses of the collector target instance. |
|
|
string |
The list of access addresses of the instance specified by the collector output. This parameter is displayed when configType is set to collectorTargetInstance. |
["es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200"] |
|
| groupId |
string |
The ID of the machine group. This parameter is displayed when configType is set to collectorDeployMachine. |
default_ct-cn-5i2l75bz4776**** |
| instanceType |
string |
The type of the instance specified by the collector output. Valid values: elasticsearch and logstash. This parameter is displayed when configType is set to collectorTargetInstance. |
elasticsearch |
| machines |
array<object> |
The list of ECS instances on which the collector is deployed. This parameter is displayed when configType is set to collectorDeployMachines and type is set to ECSInstanceId. |
|
|
object |
|||
| instanceId |
string |
The list of ECS instance IDs. |
i-bp13y63575oypr9d**** |
| agentStatus |
string |
The status of each collector on the ECS instance. Valid values:
|
heartOk |
| configType |
string |
The configuration type. Valid values:
|
collectorDeployMachine |
| userName |
string |
The username used to access the instance specified by the collector output. Default value: elastic. This parameter is displayed when configType is set to collectorTargetInstance or collectorElasticsearchForKibana. |
elastic |
| type |
string |
The type of the machine on which the collector is deployed. This parameter is displayed when configType is set to collectorDeployMachine. Valid values:
|
ECSInstanceId |
| resVersion |
string |
The version of the collector. When the machine type is ECS, only 6.8.5_with_community is supported. |
6.8.5_with_community |
| vpcId |
string |
The ID of the VPC where the collector resides. |
vpc-bp16k1dvzxtm****** |
| name |
string |
The name of the collector. |
ct-testAbc |
| gmtCreatedTime |
string |
The time when the collector was created. |
2020-06-20T07:26:47.000+0000 |
| status |
string |
The status of the collector. Valid values:
|
activing |
| cloudAssistantStatus |
string |
The installation status of Cloud Assistant. Valid values:
|
true |
| ecsInstanceName |
string |
The name of the ECS instance. |
ecsTestName |
| osType |
string |
The operating system type of the ECS instance. Valid values:
|
linux |
| ipAddress |
array<object> |
The IP address information of the ECS instance. |
|
|
object |
|||
| host |
string |
The IP address. |
172.16.xx.xx |
| ipType |
string |
The type of the IP address. Valid values:
|
private |
| tags |
string |
The tag information of the ECS instance. |
[ { "tagKey": "a", "tagValue": "b" } ] |
| status |
string |
The status of the ECS instance. Valid values:
|
running |
Examples
Success response
JSON format
{
"RequestId": "5FFD9ED4-C2EC-4E89-B22B-1ACB6FE1D***",
"Headers": {
"X-Total-Count": 11
},
"Result": [
{
"ecsInstanceId": "i-bp14ncqge8wy3l3d****",
"collectors": [
{
"configs": [
{
"fileName": "fields.yml",
"content": "- key: log\\n title: Log file content\\n description: >\\n Contains log file lines.\\n ...."
}
],
"dryRun": false,
"resType": "fileBeat",
"ownerId": "16852***488*****",
"resId": "ct-cn-0v3xj86085dvq****",
"collectorPaths": [
"[\"/var/log\"]"
],
"gmtUpdateTime": "2020-06-20T07:26:47.000+0000",
"extendConfigs": [
{
"protocol": "HTTP",
"enableMonitoring": true,
"instanceId": "es-cn-nif1z89fz003i****",
"hosts": [
"[\"es-cn-n6w1o1x*****.elasticsearch.aliyuncs.com:9200\"]"
],
"groupId": "default_ct-cn-5i2l75bz4776****",
"instanceType": "elasticsearch",
"machines": [
{
"instanceId": "i-bp13y63575oypr9d****",
"agentStatus": "heartOk"
}
],
"configType": "collectorDeployMachine",
"userName": "elastic",
"type": "ECSInstanceId"
}
],
"resVersion": "6.8.5_with_community",
"vpcId": "vpc-bp16k1dvzxtm******",
"name": "ct-testAbc",
"gmtCreatedTime": "2020-06-20T07:26:47.000+0000",
"status": "activing"
}
],
"cloudAssistantStatus": "true",
"ecsInstanceName": "ecsTestName",
"osType": "linux",
"ipAddress": [
{
"host": "172.16.xx.xx",
"ipType": "private"
}
],
"tags": "[ { \"tagKey\": \"a\", \"tagValue\": \"b\" } ]",
"status": "running"
}
]
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | ComponentCodeValueError | component value is disable | |
| 401 | UserNotOpen | Aliyun account is not open elasticsearch | |
| 401 | StsRoleAccountNoPermission | Role account has no permission or expired | |
| 401 | SubAccountNoPermission | Aliyun sub account has no permission, please authorize your sub account in Aliyun RAM | |
| 401 | UserUnauthorized | Authentication required |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.