全部产品
Search
文档中心

批量计算:获取集群信息

更新时间:Apr 12, 2018

描述

获取集群信息(GetCluster)。

请求语法

  1. GET /clusters/{Id}

属性说明

属性名称 类型 是否必需 描述
Id String 集群标示符。

返回信息

成功

返回200状态码以及Cluster的状态信息,如下。

  1. {
  2. "Name": "clusterName1",
  3. "Id": "cls-6kir9pdp3lg6220g418002",
  4. "OwnerId": 123,
  5. "Description": "demo",
  6. "CreationTime": "2016-10-31T06:55:33.921897Z",
  7. "State": "Active",
  8. "ImageId": "img-ubuntu",
  9. "Notification": {
  10. "Topic": {
  11. "Name": "test-topic",
  12. "Endpoint": "http://[UserId].mns.[Region].aliyuncs.com/",
  13. "Events": [
  14. "OnClusterDeleted",
  15. "OnInstanceCreated",
  16. "OnInstanceActive"
  17. ]
  18. }
  19. },
  20. "Configs": {
  21. "Disks": {
  22. "SystemDisk": {
  23. "Type": "cloud",
  24. "Size": 500
  25. },
  26. "DataDisk": {
  27. "Type": "cloud",
  28. "Size": 500,
  29. "MountPoint": "/path/to/mount"
  30. }
  31. },
  32. "Mounts": {
  33. "Entries": [
  34. {
  35. "Destination": "/home/admin/mount-dest",
  36. "Source": "oss://your-bucket/mount-source",
  37. "WriteSupport": true
  38. }
  39. ],
  40. "Locale": "GBK",
  41. "Lock": false,
  42. "NAS": {
  43. "AccessGroup": [
  44. "group1",
  45. "group2"
  46. ],
  47. "FileSystem": [
  48. "filesystem1",
  49. "filesystem2"
  50. ]
  51. },
  52. "OSS": {
  53. "AccessKeyId": "",
  54. "AccessKeySecret": "",
  55. "AccessSecurityToken": ""
  56. }
  57. },
  58. "Networks": {
  59. "Classic": {
  60. "AllowIpAddress": [],
  61. "AllowIpAddressEgress": [],
  62. "AllowSecurityGroup": [],
  63. "AllowSecurityGroupEgress": []
  64. },
  65. "VPC": {
  66. "CidrBlock": "10.0.0.0/8",
  67. }
  68. }
  69. },
  70. "Groups": {
  71. "group1": {
  72. "DesiredVMCount": 3,
  73. "ActualVMCount": 2,
  74. "InstanceType": "bcs.a2.large",
  75. "ResourceType": "OnDemand"
  76. }
  77. },
  78. "OperationLogs": ["[2016-10-31T06:55:33.921897Z][group]Creating instance group successfully","[2016-10-31T06:55:33.941897Z]Creating cluster successfully"],
  79. "Metrics": {
  80. "RunningCount": 1,
  81. "StartingCount": 0,
  82. "StoppingCount": 0,
  83. "StoppedCount": 0
  84. }
  85. }

属性说明

属性名称 类型 描述
Name string 集群名称。
Id string 集群标识符,自动生成。
Description string 集群的描述信息。
OwnerId int 拥有者ID。
CreationTime string 集群创建时间。
State string 集群状态。仅支持”Active”和”Deleting”。
ImageId string 镜像标识符。
Notification object 消息通知配置,用户指定消息事件Notification
Configs object 集群的一些配置信息,比如实例的磁盘配置,由ConfigInfo描述。
Groups object 集群的实例组信息,每个实例组的信息由GroupInfo描述。
OperationLogs array 操作日志。
Metrics object 集群Metric数据,由ClusterMetrics描述。

错误码

错误码 错误信息 状态码 语义
InvalidResource.NotFound Specified resource is not found. 404 用户请求的资源不存在。