ResourceTypeManagement

ResourceType Management interface

GraphViz

Schema

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

{
  "name": "ResourceTypeManagement",
  "id": "http://www.parallels.com/pa/pa-core-services/resource-type-manager/1.1",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "access": {},
  "operations": {
    "getResourceType": {
      "path": "/resourceTypes/{resTypeId}",
      "verb": "GET",
      "response": {
        "type": "ResourceType"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "resTypeId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "createResourceType": {
      "path": "/resourceTypes",
      "verb": "POST",
      "response": {
        "type": "ResourceType"
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "updateResourceType": {
      "path": "/resourceTypes/{resTypeId}",
      "verb": "PUT",
      "response": {
        "type": "ResourceType"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "resTypeId": {
          "kind": "path",
          "type": "integer"
        }
      }
    },
    "deleteResourceType": {
      "path": "/resourceTypes/{resTypeId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "resTypeId": {
          "kind": "path",
          "type": "integer"
        }
      }
    }
  },
  "structures": {
    "ResourceType": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "resourceClassName": {
          "type": "string"
        },
        "attributes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "activationParameters": {
          "type": "object",
          "required": true
        }
      }
    }
  }
}

The APS type is used to create a singleton APS resource exposing its operations for API calls. The call syntax depends on the operation. For example, a call of an operation that accepts input parameters both in the URL string and in the body looks as follows:

POST  /aps/2/services/resource-type-manager/<operation-path>?<query-params>

{/*<body params>*/}

In the above call, the verb can be either GET, PUT, POST, or DELETE as specified in the definition of the operation.

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

getResourceType

GET

/resourceTypes/{resTypeId}

ResourceType

Retrieve the resource type

createResourceType

POST

/resourceTypes

If successful, this method returns added ResourceType object in response body

Create resource type

updateResourceType

PUT

/resourceTypes/{resTypeId}

If successful, this method returns updated ResourceType object in response body

Update resource type

deleteResourceType

DELETE

/resourceTypes/{resTypeId}

If successful, this method returns a 200 OK standard status code

Delete resource type

getResourceType

HTTP Request

GET /aps/2/services/resource-type-manager/resourceTypes/{resTypeId}

Description

Retrieve the resource type

Parameters

PARAMETER

TYPE

DESCRIPTION

resTypeId

Integer

ID of resource type

Returns

ResourceType

createResourceType

HTTP Request

POST /aps/2/services/resource-type-manager/resourceTypes

Description

Create resource type

Returns

If successful, this method returns added ResourceType object in response body

updateResourceType

HTTP Request

PUT /aps/2/services/resource-type-manager/resourceTypes/{resTypeId}

Description

Update resource type

Parameters

PARAMETER

TYPE

DESCRIPTION

resTypeId

Integer

ID of resource type

Returns

If successful, this method returns updated ResourceType object in response body

deleteResourceType

HTTP Request

DELETE /aps/2/services/resource-type-manager/resourceTypes/{resTypeId}

Description

Delete resource type

Parameters

PARAMETER

TYPE

DESCRIPTION

resTypeId

Integer

ID of resource type

Returns

If successful, this method returns a 200 OK standard status code

Structures

ResourceType

This APS type is used to create resource types in the platform.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

id

Integer

Not Required

A digital ID unique in scope of the present wizard data. For the sake of reliability, assign a negative digit to avoid confusion with an ID of a resource type existing in the platform. The platform will assign a unique ID when creating the required resource type.

name

String

Not Required

Name..

description

String

Not Required

Description..

resourceClassName

String

Not Required

attributes

Array of String

Not Required

activationParameters

Object

Required

Examples

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