PricingTemplatesResource


Create a pricing template


When creating a pricing template, default currencies are provided (US dollars, euros, Japanese yen), but if you want to use a different currency you have to add the currency using the Currency Resource. To assign a cost to a virtual image, create a cost code using the Cost Code Resource.
Define a price for each existing datacenter in scope and its tiers and datastore tiers. If they are not provided by a Pricing template entity, they are inizialized with a price of 0.

POST https://example.com/api/config/pricingtemplates

Roles : [ROLE_PRICING_MANAGE]

Content-Type : pricingtemplate Accept : pricingtemplate

Error Codes

  • BC-23 - The requested backup policy does not exist
  • BC-34 - Missing backup policy link
  • COSTCODE-0 - The requested cost code does not exist
  • COSTCODE-8 - Missing cost code link
  • CURRENCY-0 - The requested currency does not exist
  • CURRENCY-9 - Missing currency link
  • DC-0 - The requested datacenter does not exist
  • DC-8 - Missing datacenter link
  • DSTIER-0 - The requested datastore tier does not exist
  • DSTIER-10 - Missing link to datastore tier
  • LOCATION-4 - The location does not exist
  • PRICINGTEMPLATE-2 - Duplicate name for pricing template
  • PROFILE-1 - The requested hardware profile does not exist
  • PROFILE-5 - Missing hardware profile link
  • TIER-0 - The requested storage tier does not exist
  • TIER-2 - Missing link to storage tier

Example

List pricing templates


This method returns the list of pricing templates including own pricing template if exludeOwn is not set. For each pricing template returns the price of its datacenter in scope, tiers, datastore tier and cost codes.

GET https://example.com/api/config/pricingtemplates

Roles : [ROLE_PRICING_VIEW]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String name Order by
has String If present filter to apply in the search.
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
excludeOwn Boolean false exclude the pricing template that applies to the user's enterprise of the request

Accept : pricingtemplates

Example

List pricing templates light


This method returns the list of pricing templates including own pricing template if exludeOwn is not set

GET https://example.com/api/config/pricingtemplates

Roles : [ROLE_PRICING_VIEW]

Parameter Type Default Value Description
startwith Integer 0 The first element to be retrieved of the filtered search
by String name Order by
has String If present filter to apply in the search.
limit Integer 25 The number of entities to retrieve
asc Boolean true If the value of the 'by' parameter must be sorted in ascending order (true) or descending order (false)
excludeOwn Boolean false exclude the pricing template that applies to the user's enterprise of the request

Example

Delete a pricing template


It's not possible to delete a pricing template if it is associated with an enterprise.

DELETE https://example.com/api/config/pricingtemplates/{pricingtemplate}

Roles : [ROLE_PRICING_MANAGE]

Example

Get a pricing template


GET https://example.com/api/config/pricingtemplates/{pricingtemplate}

Roles : [ROLE_PRICING_VIEW]

Accept : pricingtemplate

Error Codes

  • PRICINGTEMPLATE-3 - The requested pricing template does not exist

Example

Update a pricing template


PUT https://example.com/api/config/pricingtemplates/{pricingtemplate}

Roles : [ROLE_PRICING_MANAGE]

Content-Type : pricingtemplate Accept : pricingtemplate

Error Codes

  • COSTCODE-0 - The requested cost code does not exist
  • COSTCODE-8 - Missing cost code link
  • CURRENCY-0 - The requested currency does not exist
  • CURRENCY-9 - Missing currency link
  • DSTIER-0 - The requested datastore tier does not exist
  • DSTIER-10 - Missing link to datastore tier
  • PRICINGTEMPLATE-3 - The requested pricing template does not exist
  • PROFILE-1 - The requested hardware profile does not exist
  • PROFILE-5 - Missing hardware profile link
  • TIER-0 - The requested storage tier does not exist
  • TIER-2 - Missing link to storage tier

Example