View a service

Last Updated: Jan 09, 2018

Description

View the service details according to the service ID.

Request information

Request line (RequestLine)

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

Request line parameter (URI Param)

Name Type Required? Description
service_id string Yes The service ID in the format of {project_name}_{service_name}.

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. "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. }

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/wordpress_db HTTP/1.1

Return example

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