edit-icon download-icon

View service list

Last Updated: Jan 09, 2018

Description

View the list of all your created services in a 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 The service name.
containers boolean No Whether or not to include the service container information. 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

Service format

Name Type Description
idstringThe service ID.
namestringThe service name.
projectstringThe application name.
createddatetimeThe created time of the service.
updateddatetimeThe updated time of the service.
desired_statestringThe expected status (if the current status is the intermediate status, the expected status indicates the final status of the change).
current_statestringThe current status.
definitionmapThe service definition key/value in Compose.
extensionsmapThe service extension key/value in the Container Service Compose.
containers mapThe 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.