阅读55 返回首页    go 小米路由器


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

描述

说明:根据服务实例 ID 查看详细信息。

请求信息

请求行 RequestLine

  1. GET /services/{service_id} HTTP/1.1

请求行参数 URI Param

名称 类型 是否必须 描述
service_id string 服务实例 ID, 格式为 {project_name}_{service_name}

特有请求头 RequestHead

请求体 RequestBody

返回信息

返回行 ResponseLine

  1. HTTP/1.1 200 OK

特有返回头 ResponseHead

返回体 ResponseBody

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

返回体解释

服务实例的格式

名称 类型 描述
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/wordpress_db HTTP/1.1

返回示例

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

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

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