Application Packaging Standard

Last updated 18-Mar-2019

Capacity

The type is used to manage the service nodes (also known as hosts) registered in the platform. It implements the APS core Resource type.

Schema

The considered APS type (download) extends the Resource APS type(s) and looks as follows:

{
  "name": "Capacity",
  "id": "http://www.parallels.com/pa/pa-core-services/host-management/Capacity/1.0",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "relations": {
    "host": {
      "type": "http://www.parallels.com/pa/pa-core-services/host-management/Host/1.0",
      "required": true
    }
  },
  "properties": {
    "name": {
      "type": "string"
    },
    "units": {
      "type": "string"
    },
    "amount": {
      "type": "integer"
    },
    "consumption": {
      "type": "integer"
    }
  },
  "operations": {
    "increaseConsumption": {
      "path": "/increaseConsumption",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      }
    },
    "decreaseConsumption": {
      "path": "/decreaseConsumption",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      }
    }
  }
}

Properties

NAME TYPE ATTRIBUTES DEFAULT DESCRIPTION
amount Integer Not Required   Upper limit on the resource.
consumption Integer Not Required   Current resource consumption.
name String Not Required   The name of the related resource that this capacity represents.
units String Not Required   Unit of measure.

Relationship

NAME TYPE REQUIRED DESCRIPTION
host Host Yes Required relationship with a host resource based on the Host type.

Custom Operations

OPERATION VERB PATH RETURNS Description
decreaseConsumption POST /decreaseConsumption No return values Decrease the consumption of the specified resource (specified by APS ID) on the host.
increaseConsumption POST /increaseConsumption No return values Increase the consumption of the specified resource (specified by APS ID) on the host.

decreaseConsumption

HTTP Request

POST /aps/2/resources/{aps-id}/decreaseConsumption

Description

Decrease the consumption of the specified resource (specified by APS ID) on the host.

Returns

No return values

increaseConsumption

HTTP Request

POST /aps/2/resources/{aps-id}/increaseConsumption

Description

Increase the consumption of the specified resource (specified by APS ID) on the host.

Returns

No return values

Examples

Please find general description of create-read-update-delete (CRUD) operations with resources, properties, and structures respectively at:

Since the considered APS type contains custom operations, refer to Custom Operations for the general explanation of their structure and examples of operation calls.

Host