Type Definition

APS Type is a formal JSON schema JSON-SCH used for creating and managing a set of APS resources instantiated from the APS type.

APS Types and Services

All APS resources of a certain APS type must be provisioned and managed by a certain service, which is the resource factory for this APS type on the application side. This means every service declared in a package must be bound to an APS type defined in the same package. According to the diagram below, when the APS controller receives a REST request for an operation (for example, POST) over a resource of a certain APS type (for example, vps) it forwards the request to the service bound with this APS type, that is, to the /vpses service.

../../../_images/type-service.png

Meta Declaration

When a service is declared in a Package Structure, the Application Services declaration must include the reference to the schema file that defines the related APS type.

../../../_images/aps-type-vs-service.png

JSON Representation

Before you start working with APS types (schemas), get familiar with the following formal terms derived from the JSON definition in RFC-4627:

  • In a schema file, each part inside curly brackets { } is a JSON object. This means that an APS type itself is a JSON object and it contains a number of embedded JSON objects.

  • An APS type is a collection of name: value pairs (colon is the inside separator), separated from other pairs by comma, where name is a string, and value is a string, number, boolean, null, array, or object.

  • An array is represented as a pair of square brackets [ ] surrounding zero or more values.

  • A string begins and ends with quotation marks, for example, “VPS Cloud”.

  • MIME type of JSON files is application/json.

Go through the following sections to get familiar with the APS type definition.