PAServiceTemplate

This APS type is used to create and manage service templates in the platform. A service template contains resource types linked through the resources relationship collection.

GraphViz

Schema

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

{
  "name": "PAServiceTemplate",
  "id": "http://parallels.com/aps/types/pa/serviceTemplate/1.2",
  "apsVersion": "2.0",
  "implements": [
    "http://aps-standard.org/types/core/resource/1.0"
  ],
  "relations": {
    "account": {
      "type": "http://aps-standard.org/types/core/account/1.0",
      "required": true
    },
    "resources": {
      "type": "http://aps-standard.org/types/core/resource/1.0",
      "collection": true
    }
  },
  "properties": {
    "serviceTemplateId": {
      "type": "integer",
      "required": true
    },
    "name": {
      "type": "string"
    },
    "description": {
      "type": "string"
    },
    "autoprovisioning": {
      "type": "boolean"
    },
    "appIDs": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "operations": {
    "limits": {
      "path": "/limits",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ResourceLimit"
        }
      },
      "errorResponse": {
        "type": "object"
      }
    },
    "addLimit": {
      "path": "/limits",
      "verb": "POST",
      "response": {
        "type": "ResourceLimit"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "limit": {
          "kind": "body",
          "type": "ResourceLimit",
          "required": true
        }
      }
    },
    "changeLimit": {
      "path": "/limits/{rtId}",
      "verb": "PUT",
      "response": {
        "type": "ResourceLimit"
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "rtId": {
          "kind": "path",
          "type": "integer",
          "required": true
        },
        "limit": {
          "kind": "body",
          "type": "ResourceLimit",
          "required": true
        }
      }
    },
    "deleteLimit": {
      "path": "/limits/{rtId}",
      "verb": "DELETE",
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "rtId": {
          "kind": "path",
          "type": "integer",
          "required": true
        }
      }
    },
    "getProvisioningCustomization": {
      "path": "/provisioningCustomization",
      "verb": "GET",
      "response": {
        "type": "array",
        "items": {
          "type": "ServiceTemplateProvisioningCustomization"
        }
      },
      "errorResponse": {
        "type": "object"
      },
      "parameters": {
        "accountId": {
          "kind": "query",
          "type": "string"
        },
        "internalAccountId": {
          "kind": "query",
          "type": "string"
        }
      }
    },
    "customizeProvisioning": {
      "path": "/provisioningCustomization",
      "verb": "POST",
      "errorResponse": {
        "type": "object"
      },
      "access": {
        "referrer": true
      },
      "parameters": {
        "provisioningCustomization": {
          "kind": "body",
          "type": "array",
          "required": true
        }
      }
    }
  },
  "structures": {
    "ResourceLimit": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "required": true
        },
        "title": {
          "type": "string"
        },
        "apsId": {
          "type": "string"
        },
        "apsType": {
          "type": "string"
        },
        "applicationId": {
          "type": "string"
        },
        "property": {
          "type": "string"
        },
        "autoprovisioning": {
          "type": "boolean"
        },
        "unit": {
          "type": "string",
          "required": true,
          "pattern": "unit|b|kb|mb|gb|.*"
        },
        "limit": {
          "type": "integer"
        }
      }
    },
    "ServiceTemplateProvisioningCustomization": {
      "type": "object",
      "properties": {
        "apsType": {
          "type": "string",
          "required": true
        },
        "json": {
          "type": "string",
          "required": true
        }
      }
    }
  }
}

The APS type is used to manage a collection of APS resources. To get a list of resources from that collection, use the following API call:

GET  /aps/2/collections/pa-service-templates?<RQL-filter>

Properties

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

serviceTemplateId

Integer

Required

Identifier in the platform.

name

String

Not Required

Service template name in the platform.

description

String

Not Required

Service template description in the platform.

autoprovisioning

Boolean

Not Required

Specifies if autoprovisioning of its resources is allowed in the platform.

appIDs

Array of String

Not Required

IDs (in the URL format) of the APS applications whose resources are in the service template.

Relationship

NAME

TYPE

REQUIRED

DESCRIPTION

account

Account

Yes

The account (the provider or a reseller) related to this service template, that is the service template owner.

resources

Collection of Resource

No

Resources included into this service template.

Custom Operations

OPERATION

VERB

PATH

RETURNS

Description

limits

GET

/limits

If successful, this method returns a list of ResourceLimit objects in the response body.

Get resource limits for all resources included into the specified service template.

addLimit

POST

/limits

If successful, this method returns the added ResourceLimit object in the response body.

Add the specified ResourceLimit into the service template.

changeLimit

PUT

/limits/{rtId}

If successful, this method returns the changed ResourceLimit object in the response body

Change the specified resource limit.

deleteLimit

DELETE

/limits/{rtId}

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

Delete the specified resource limit object from the service template.

getProvisioningCustomization

GET

/provisioningCustomization

Array of ServiceTemplateProvisioningCustomization

Get an array of ServiceTemplateProvisioningCustomization objects used to customize resource provisioning for the current reseller.

customizeProvisioning

POST

/provisioningCustomization

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

Override the customizable provisioning parameters for the current reseller.

limits

HTTP Request

GET /aps/2/resources/{aps-id}/limits

Description

Get resource limits for all resources included into the specified service template.

Returns

If successful, this method returns a list of ResourceLimit objects in the response body.

addLimit

HTTP Request

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

Description

Add the specified ResourceLimit into the service template.

Parameters

PARAMETER

TYPE

DESCRIPTION

limit

ResourceLimit

New ResourceLimit

Returns

If successful, this method returns the added ResourceLimit object in the response body.

changeLimit

HTTP Request

PUT /aps/2/resources/{aps-id}/limits/{rtId}

Description

Change the specified resource limit.

Parameters

PARAMETER

TYPE

DESCRIPTION

rtId

Integer

ID of the resource type in the platform

limit

ResourceLimit

Updated ResourceLimit

Returns

If successful, this method returns the changed ResourceLimit object in the response body

deleteLimit

HTTP Request

DELETE /aps/2/resources/{aps-id}/limits/{rtId}

Description

Delete the specified resource limit object from the service template.

Parameters

PARAMETER

TYPE

DESCRIPTION

rtId

Integer

ID of the resource type in the platform.

Returns

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

getProvisioningCustomization

HTTP Request

GET /aps/2/resources/{aps-id}/provisioningCustomization

Description

Get an array of ServiceTemplateProvisioningCustomization objects used to customize resource provisioning for the current reseller.

Parameters

PARAMETER

TYPE

DESCRIPTION

accountId

String

internalAccountId

String

Returns

Array of ServiceTemplateProvisioningCustomization

customizeProvisioning

HTTP Request

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

Description

Override the customizable provisioning parameters for the current reseller.

Parameters

PARAMETER

TYPE

DESCRIPTION

provisioningCustomization

Array

Set of ServiceTemplateProvisioningCustomization

Returns

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

Structures

ResourceLimit

The ResourceLimit structure is used to present the platform resources contained in a service template.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

id

Integer

Required

Identifier of the resource type (RT) in the platform, for example, 1000276.

title

String

Not Required

Resource title assigned in the APS type the resource is based on.

apsId

String

Not Required

The resource APS ID, such as “a3d2ab13-9acc-449e-831f-d111601bea23”.

apsType

String

Not Required

APS type of the resource, for example, “http://aps-standard.org/samples/basicApp/vps/1.0”.

applicationId

String

Not Required

Application ID, such as “http://aps-standard.org/samples/basicApp”.

property

String

Not Required

The resource property that the APS counter processes.

autoprovisioning

Boolean

Not Required

Specifies if autoprovisioning of the resource is allowed in the platform.

unit

String

Required

Units to measure limits and usage of a resource, such as unit, b, kb, mb, and gb.

limit

Integer

Not Required

Limit on the resource as specified in the service template. Absence of the property means that the resource has no limit (unlimited).

ServiceTemplateProvisioningCustomization

Defines the structure of provisioning parameters customized per reseller as explained in the Customization for Sales Channels concepts.

NAME

TYPE

ATTRIBUTES

DEFAULT

DESCRIPTION

apsType

String

Required

The ID of the APS type that defines the customizable provisioning parameters. This APS type must implement the Reseller Profile standard APS type.

json

String

Required

A string in the form of JSON with actual customizable provisioning parameters.

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.