Service

From Ocean Framework Documentation Wiki
Jump to: navigation, search

The Service resource has one public URL. (For information about the difference between Public and Internal URLs and HATEOAS conventions, please see API Structure and Conventions.)

/v1/services

Structure

name
(String) The name of the Service
description
(String) A plain-text description of the Service, documenting its use.
created_at
(String) A datetime string in GMT.
updated_at
(String) A datetime string in GMT.
{
 "service": {
          "name": "auth",
          "description": "This service handles authentication and authorisation. It is also 
                          the registry of Services and their Resources.",
          "created_at": "2012-12-01T18:40:53Z",
          "updated_at": "2012-12-03T09:12:17Z",
          "lock_version": 21,
          "_links": {
            "self": {
              "href": "https://api.example.com/v1/services/f00f05e4-3263-4235-8fb6-e909dac23349",
              "type": "application/json" },
            "resources": {
              "href": "https://api.example.com/v1/services/f00f05e4-3263-4235-8fb6-e909dac23349/resources",
              "type": "application/json" }
          }
  }
}

Hyperlinks

The following hyperlink names are used in the following subsections. To retrieve the URL and Content-Type to use, use the _links hash. Note that the URI may change, and thus you should make no inference on how to construct similar URIs from any previous URI. For more information, refer to Hyperlink URIs are Opaque. You may store hyperlink URIs in permanent storage for later use.

The hyperlinks for a Service resource are:

self
as always, the self hyperlink can be used to perform CRUD actions on the Service resource.
resources
GET retrieves the collection of Resources handled by this Service.
POST creates a new Resource belonging to this Service.
instances
returns a collection of Amazon cloud Instances associated with this Service.
documentation
if present, this is a hyperlink to the text/html documentation for the Resource. This is set in the chef-repo in the apps data bag.
creator
the ApiUser who created this Service.
updater
the ApiUser who last updated this Service.


GET self

Retrieves a Service resource.

200
The operation was successful.

GET /v1/services

Returns a collection of Services. The basic URL returns all Services in the system. You can add query arguments to the basic URL to perform matches and substring searches, and you can also group on a property.

You can match on the following property:

  • name

The following returns all Services whose name property is media:

GET /v1/services?name=media

You can also search on substrings in description by using search, for instance:

GET /v1/services?search=Groups

Pagination can also be performed using page:

GET /v1/services?page=3

The first page is 0. Page size defaults to 25, but can be changed using page_size:

GET /v1/services?page=0&page_size=100
200
The operation was successful. The collection is returned as a JSON array in the response body.