阅读822 返回首页    go 阿里云


查看服务实例列表__应用API列表_API参考_容器服务-阿里云

描述

说明:查看您在容器集群中创建的所有服务实例列表。

请求信息

请求行 RequestLine

  1. GET /services/ HTTP/1.1

请求行参数 URI Param

名称 类型 是否必须 描述
q string 服务名称
containers boolean 是否包含服务的容器信息,缺省值 true

特有请求头 RequestHead

请求体 RequestBody

返回信息

返回行 ResponseLine

  1. HTTP/1.1 200 OK

特有返回头 ResponseHead

返回体 ResponseBody

  1. [
  2. {
  3. "id": "string",
  4. "name": "string",
  5. "project": "string",
  6. "description": "string",
  7. "created": "datetime",
  8. "updated": "datetime",
  9. "desired_state": "string",
  10. "current_state": "string",
  11. "definition": {
  12. "key": "value",
  13. ...
  14. },
  15. "extensions": {
  16. "key": "value",
  17. ...
  18. },
  19. "containers": {
  20. "key": "value",
  21. ...
  22. }
  23. },
  24. ...
  25. ]

返回体解释

服务实例的格式

名称 类型 描述
id string 服务 ID
name string 服务名称
project string 应用名称
created datetime 服务创建时间
updated datetime 服务更新时间
desired_state string 期望状态 (如果当前状态是中间状态时,期望状态指明变迁终态)
current_state string 当前状态
definition map Compose 中服务定义 key/value
extensions map 容器服务 Compose 中服务扩展 key/value
containers map 服务中所包含容器 key (容器id)/value(属性)

示例

请求示例

  1. GET /services/ HTTP/1.1

返回示例

  1. HTTP/1.1 200 Ok
  2. Content-Type:application/json;charset=UTF-8
  3. [
  4. {
  5. "id": "wordpress_db",
  6. "name": "db",
  7. "project": "wordpress",
  8. "definition": {
  9. "environment": [
  10. "MYSQL_ROOT_PASSWORD=password"
  11. ],
  12. "image": "mysql:5.7",
  13. "restart": "always"
  14. },
  15. "extensions": {
  16. "scale": 1,
  17. "logs": [
  18. "/var/log/mysql"
  19. ]
  20. },
  21. "created": "2016-04-21T13:36:32.440646459Z",
  22. "updated": "2016-04-21T13:36:33.270308958Z",
  23. "desired_state": "running",
  24. "current_state": "running",
  25. "containers": {
  26. "5616f05d27516b3502a391fd2ca9d312cabffa5ad431bf261ea81f4ceabd476e": {
  27. "name": "/wordpress_db_1",
  28. "node": "10.246.2.3",
  29. "ip": "10.0.0.2",
  30. "running": true,
  31. "status": "running",
  32. "health": "success"
  33. }
  34. }
  35. }
  36. ]

最后更新:2016-11-23 16:03:52

  上一篇:go 更新应用配置__应用API列表_API参考_容器服务-阿里云
  下一篇:go 查看服务实例__应用API列表_API参考_容器服务-阿里云