获取集群信息
更新时间:
GetCluster
描述
获取集群信息。
请求语法
请求行:
GET /clusters/{Id} HTTP/1.1
请求方法为 GET,请求资源为 clusters,请求参数为:
| 属性名称 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| Id | String | 是 | 集群标识符。 | 
无请求数据。
返回信息
成功
状态行:
HTTP/1.1 201 OK
响应数据:
返回的数据为 JSON 格式串。
{"Name": "clusterName1","Id": "cls-6kir9pdp3lg6220g418002","OwnerId": 123,"Description": "demo","CreationTime": "2016-10-31T06:55:33.921897Z","State": "Active","ImageId": "img-ubuntu","Notification": {"Topic": {"Name": "test-topic","Endpoint": "http://[UserId].mns.[Region].aliyuncs.com/","Events": ["OnClusterDeleted","OnInstanceCreated","OnInstanceActive"]}},"Configs": {"Disks": {"SystemDisk": {"Type": "cloud","Size": 500},"DataDisk": {"Type": "cloud","Size": 500,"MountPoint": "/path/to/mount"}},"Mounts": {"Entries": [{"Destination": "/home/admin/mount-dest","Source": "oss://your-bucket/mount-source","WriteSupport": true}],"Locale": "GBK","Lock": false,"NAS": {"AccessGroup": ["group1","group2"],"FileSystem": ["filesystem1","filesystem2"]},"OSS": {"AccessKeyId": "","AccessKeySecret": "","AccessSecurityToken": ""}},"Networks": {"Classic": {"AllowIpAddress": [],"AllowIpAddressEgress": [],"AllowSecurityGroup": [],"AllowSecurityGroupEgress": []},"VPC": {"CidrBlock": "10.0.0.0/8",}}},"Groups": {"group1": {"DesiredVMCount": 3,"ActualVMCount": 2,"InstanceType": "bcs.a2.large","ResourceType": "OnDemand"}},"OperationLogs": ["[2016-10-31T06:55:33.921897Z][group]Creating instance group successfully","[2016-10-31T06:55:33.941897Z]Creating cluster successfully"],"Metrics": {"RunningCount": 1,"StartingCount": 0,"StoppingCount": 0,"StoppedCount": 0}}
属性说明:
| 属性名称 | 类型 | 是否必须 | 描述 | 
|---|---|---|---|
| Name | string | 是 | 集群名称。 | 
| Id | string | 是 | 集群标识符,自动生成。 | 
| Description | string | 否 | 集群的描述信息。 | 
| OwnerId | int | 是 | 拥有者ID。 | 
| CreationTime | string | 否 | 集群创建时间。 | 
| State | string | 否 | 集群状态。仅支持”Active”和”Deleting”。 | 
| ImageId | string | 是 | 镜像标识符。 | 
| Notification | object(Notification) | 否 | 消息通知配置,用户指定消息事件Notification。 | 
| Configs | object(ConfigInfo) | 否 | 集群的一些配置信息,比如实例的磁盘配置,由ConfigInfo描述。 | 
| Groups | map<string, object(GroupInfo)> | 是 | 集群的实例组信息,每个实例组的信息由GroupInfo描述。 | 
| OperationLogs | array[string] | 是 | 操作日志。 | 
| Metrics | object(ClusterMetrics) | 否 | 集群Metric数据,由ClusterMetrics描述。 | 
错误
| 状态码 | 错误码 | 错误信息 | 语义 | 
|---|---|---|---|
| 404 | InvalidResource.NotFound | Specified resource is not found. | 用户请求的资源不存在。 | 
该文章对您有帮助吗?