Billing resource APS type
In this document:
The considered APS type (download
) looks as follows:
{
"name": "BSSResource",
"id": "http://www.odin.com/billing/Resource/1.3",
"apsVersion": "2.0",
"implements": [
"http://aps-standard.org/abstract/types/unlimited-resource/1.0"
],
"relations": {
"inventoryItem": {
"type": "http://www.odin.com/billing/AbstractInventoryItem/1.0"
}
},
"properties": {
"name": {
"type": "http://aps-standard.org/types/core/i18n/1.3#MLString",
"required": true
},
"id": {
"type": "integer"
},
"unitOfMeasure": {
"type": "http://aps-standard.org/types/core/i18n/1.3#MLString",
"required": true
},
"dependsOn": {
"type": "array",
"items": {
"type": "ResourceDependency"
}
},
"MPN": {
"type": "string"
},
"vendorId": {
"type": "string"
},
"vendorName": {
"type": "string"
},
"productId": {
"type": "string"
},
"apsAppUUID": {
"type": "string"
},
"consumptionType": {
"type": "integer",
"default": "0",
"enum": [
"0",
"1",
"2"
],
"enumTitles": [
"Unspecified",
"Commitment",
"Usage"
]
}
},
"structures": {
"ResourceDependency": {
"type": "object",
"properties": {
"resource": {
"type": "string"
},
"kind": {
"type": "string",
"enum": [
"REQUIRES",
"PROVIDED_BY",
"SUBSCRIPTION_WIDE_CONFLICTS",
"ACCOUNT_WIDE_CONFLICTS"
]
},
"multiplier": {
"type": "integer"
}
}
}
}
}
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/bss-resources?<RQL-filter>
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
name |
I18n |
Required |
Resource name |
|
id |
Integer |
Not Required |
Internal resource identifier |
|
unitOfMeasure |
I18n |
Required |
To get the Measurement unit of Billing resource |
|
dependsOn |
Array of ResourceDependency |
Not Required |
A list of resource dependency definitions |
|
MPN |
String |
Not Required |
Base MPN value. Effective value can be obtained by the following rule: if ServicePlan.resourceRates[].MPN is present then MPN is ServicePlan.resourceRates[].MPN else MPN is ServicePlan.resources[ServicePlan.resourceRates[].resourceId].MPN |
|
vendorId |
String |
Not Required |
Vendor ID |
|
vendorName |
String |
Not Required |
Vendor Name |
|
productId |
String |
Not Required |
Product ID |
|
apsAppUUID |
String |
Not Required |
The UUID of the APS application that the resource refers to |
|
consumptionType |
Integer |
Not Required |
0 |
Resource consumption Type |
NAME |
TYPE |
REQUIRED |
DESCRIPTION |
---|---|---|---|
inventoryItem |
No |
Optional reference to Inventory item |
A resource dependency definition.
NAME |
TYPE |
ATTRIBUTES |
DEFAULT |
DESCRIPTION |
---|---|---|---|---|
resource |
String |
Not Required |
Aps.id of a http://www.odin.com/billing/Resource resource which a resource depends on |
|
kind |
Enum |
Not Required |
A dependency kind. Possible values are: REQUIRES - the resource requires a dependsOn to be present in the same subscription PROVIDED_BY - the resource is already provided by a dependsOn resource available in the same subscription SUBSCRIPTION_WIDE_CONFLICTS - the resource cannot be installed if the same subscription has a dependsOn resource ACCOUNT_WIDE_CONFLICTS - the resource cannot be installed if the at least one subscription of the account has a dependsOn resource |
|
multiplier |
Integer |
Not Required |
An optional number of depend-on resources to resolve REQUIRES dependency |
Let us consider a service plan that offers only one VPS with a selected configuration (only one configuration can be used) and two add-on services: Storage and Storage Protection, dependable on each other. The service plan contains resource rates based on the following resources:
Configuration resources conflicting with each other:
Platinum configuration
Gold configuration
Silver configuration
Add-on services:
Storage (requires the Platinum configuration)
Storage Protection (requires the Storage resource)
To get all resource dependencies in the service plan, find this plan by a particular parameter and require the APS controller to return an array of dependencies for each resource in this plan:
GET /aps/2/collections/service-plans?eq(planId,4),select(name.en_US,resources.name.en_US,resources.dependsOn)
The response will look like this:
HTTP/1.1 200 OK
[
{
"aps": {
"modified": "2019-06-07T11:29:44Z",
"id": "f949357e-76b5-404a-9722-8b14710d4730",
"type": "http://www.odin.com/billing/ServicePlan/1.1",
"status": "aps:ready",
"revision": 6
},
"name": {
"en_US": "Testing Resource Dependencies"
},
"resources": [
{
"aps": {
"modified": "2019-06-07T13:38:45Z",
"id": "14d9d218-114e-4640-836c-69bc58e9b3a9",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 7
},
"name": {
"en_US": "MSS - Gold Configuration (conflicts with other configurations)"
},
"dependsOn": [
{
"resource": "35aab9dd-ea5e-4722-9dda-83d7cd8b8fa3",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
},
{
"resource": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
}
]
},
{
"aps": {
"modified": "2019-06-07T13:38:58Z",
"id": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 7
},
"name": {
"en_US": "MSS - Platinum Configuration (conflicts with other configurations)"
},
"dependsOn": [
{
"resource": "14d9d218-114e-4640-836c-69bc58e9b3a9",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
},
{
"resource": "35aab9dd-ea5e-4722-9dda-83d7cd8b8fa3",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
}
]
},
{
"aps": {
"modified": "2019-06-07T13:38:33Z",
"id": "35aab9dd-ea5e-4722-9dda-83d7cd8b8fa3",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 10
},
"name": {
"en_US": "MSS - Silver Configuration (conflicts with other configurations)"
},
"dependsOn": [
{
"resource": "14d9d218-114e-4640-836c-69bc58e9b3a9",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
},
{
"resource": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
}
]
},
{
"aps": {
"modified": "2019-06-06T14:43:20Z",
"id": "3f462e79-4717-4233-8cb9-fa44b5d8e4fd",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 2
},
"name": {
"en_US": "MSS - VPS"
}
},
{
"aps": {
"modified": "2019-06-07T11:32:02Z",
"id": "372c60e0-4692-4f49-89f1-c9e5f96b8bb2",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 4
},
"name": {
"en_US": "MSS - Storage (requires Platinum conf.)"
},
"dependsOn": [
{
"resource": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"kind": "REQUIRES",
"multiplier": 1
}
]
},
{
"aps": {
"modified": "2019-06-07T11:32:29Z",
"id": "fda0678c-280a-4be4-9666-9e81a7ab57ba",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 3
},
"name": {
"en_US": "MSS - Storage Protection (requires Storage)"
},
"dependsOn": [
{
"resource": "372c60e0-4692-4f49-89f1-c9e5f96b8bb2",
"kind": "REQUIRES",
"multiplier": 1
}
]
}
]
}
]
To look at resource dependencies regardless of their inclusion in service plans, find the required resources by certain properties, for example by a name pattern:
GET /aps/2/collections/bss-resources?like(name.en_US,MSS*),select(name.en_US,dependsOn)
The response will look like this:
HTTP/1.1 200 OK
[
{
"dependsOn": [
{
"resource": "35aab9dd-ea5e-4722-9dda-83d7cd8b8fa3",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
},
{
"resource": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
}
],
"aps": {
"modified": "2019-06-07T11:30:28Z",
"id": "14d9d218-114e-4640-836c-69bc58e9b3a9",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 6
},
"name": {
"en_US": "MSS - Gold Configuration"
}
},
{
"aps": {
"modified": "2019-06-06T14:43:19Z",
"id": "2727013f-b981-4dec-b499-611bee04f81e",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 2
},
"name": {
"en_US": "MSS - App REF"
}
},
{
"dependsOn": [
{
"resource": "14d9d218-114e-4640-836c-69bc58e9b3a9",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
},
{
"resource": "35aab9dd-ea5e-4722-9dda-83d7cd8b8fa3",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
}
],
"aps": {
"modified": "2019-06-07T11:31:05Z",
"id": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 6
},
"name": {
"en_US": "MSS - Platinum Configuration"
}
},
{
"dependsOn": [
{
"resource": "14d9d218-114e-4640-836c-69bc58e9b3a9",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
},
{
"resource": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"kind": "SUBSCRIPTION_WIDE_CONFLICTS"
}
],
"aps": {
"modified": "2019-06-07T11:30:46Z",
"id": "35aab9dd-ea5e-4722-9dda-83d7cd8b8fa3",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 9
},
"name": {
"en_US": "MSS - Silver Configuration"
}
},
{
"dependsOn": [
{
"resource": "301c27cf-5373-47da-9a5c-b482d8ab15b8",
"kind": "REQUIRES",
"multiplier": 1
}
],
"aps": {
"modified": "2019-06-07T11:32:02Z",
"id": "372c60e0-4692-4f49-89f1-c9e5f96b8bb2",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 4
},
"name": {
"en_US": "MSS - Storage (requires Platinum conf.)"
}
},
{
"aps": {
"modified": "2019-06-06T14:43:20Z",
"id": "3f462e79-4717-4233-8cb9-fa44b5d8e4fd",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 2
},
"name": {
"en_US": "MSS - VPS"
}
},
{
"dependsOn": [
{
"resource": "2727013f-b981-4dec-b499-611bee04f81e",
"kind": "REQUIRES"
}
],
"aps": {
"modified": "2019-06-07T07:58:57Z",
"id": "442a729e-347a-4ba5-acdd-cfe5abfebaa9",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 3
},
"name": {
"en_US": "MSS - VPS Management"
}
},
{
"dependsOn": [
{
"resource": "372c60e0-4692-4f49-89f1-c9e5f96b8bb2",
"kind": "REQUIRES",
"multiplier": 1
}
],
"aps": {
"modified": "2019-06-07T11:32:29Z",
"id": "fda0678c-280a-4be4-9666-9e81a7ab57ba",
"type": "http://www.odin.com/billing/Resource/1.3",
"status": "aps:ready",
"revision": 3
},
"name": {
"en_US": "MSS - Storage Protection (requires Storage)"
}
}
]