View service instances

Last Updated: Nov 01, 2016

Description

View all service instances in the container cluster.

Request information

Request line (RequestLine)

  1. GET /services/ HTTP/1.1

Request line parameter (URI Param)

Name Type Required? Description
q string No Service name.
containers boolean No Includes service container information or not. The default value is true.

Special request header (RequestHead)

None

Request body (RequestBody)

None

Response information

Response line (ResponseLine)

  1. HTTP/1.1 200 OK

Special response header (ResponseHead)

None

Response body (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. ]

Response body explanation

Format of the service instance

Name Type Description
id string Service ID.
name string Service name.
project string Application name.
created datetime Service creation time.
updated datetime Service update time.
desired_state string Desired state (If the application is in the intermediate state, the parameter specifies the final state of the application).
current_state string Current state.
definition map Compose service definition key/value.
extensions map Expansion key/value of services in the Container Service Compose.
containers map Container key (container ID)/value (attribute) in the service.

Example

Request example

  1. GET /services/ HTTP/1.1

Return example

  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. ]
Thank you! We've received your feedback.