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. | 使用者請求的資源不存在。 |