1.1.5 • Published 5 years ago

abacus-provisioning-plugin v1.1.5

Weekly downloads
9
License
Apache-2.0
Repository
-
Last release
5 years ago

Abacus service boker provisioning API

API overview

A provisioning plugin provides REST APIs for manipulation and retrieving information about provisioned resources in Abacus. For more details and examples, please have a look at the resource provider guide.

Authentication

The requests MUST authenticate with the Abacus provisioning plugin via oAuth token (the Authorization: header) on every request. The provisioning plugin is responsible for validating the oAuth token and returning a 401 Unauthorized message if the token is invalid. oAuth token MUST include scopes. More information can be found in Abacus Authentication-and-Authorization.

Plans

Create

POST /v1/:plan_type/plans

Create plan. The :plan_type MUST be one of the following types: metering, rating, pricing.

Body
Request fieldTypeDescription
planobjectMUST be a valid JSON object representing a plan. Plan id MUST be provided. In case of a resource specific token, plan id MUST ends with resource provider id. An example metering, rating and pricing plans.

Response

Status CodeDescription
201 CreatedReturned upon successful processing of this request.
400 Bad RequestWhen plan id is missing.
401 UnauthorizedWhen oAuth token is not valid.
403 ForbiddenWhen no system write scope is provided or resource specific write scope is provided.
409 ConflictWhen the plan has a conflict.

Update

PUT /v1/:plan_type/plans/:plan_id

Update plan. The :plan_type MUST be one of the following types: metering, rating, pricing. The plan_id is a string and MUST be an existing plan id.

Body
Request fieldTypeDescription
planobjectMUST be a valid JSON object representing a plan. Plan id MUST be provided and MUST be the same as plan_id parameter in the route. In case of a resource specific token, plan id MUST ends with resource provider id. An example metering, rating and pricing plans.

Response

Status CodeDescription
200 OKReturned upon successful processing of this request.
400 Bad RequestWhen plan id is missing or plan id from the mody does not match plan_id parameter in the route.
401 UnauthorizedWhen oAuth token is not valid.
403 ForbiddenWhen no system write scope is provided or resource specific write scope is provided.
404 Not foundWhen the plan is not found.

Get

GET /v1/:plan_type/plans/:plan_id

Retrieve existing plan. The :plan_type MUST be one of the following types: metering, rating, pricing. The plan_id is a string and MUST be an existing plan id.

Pass Cache-Control: no-cache header to specify that the backend should not use caching.

Response

Status CodeDescription
200 OKReturned upon successful processing of this request.
401 UnauthorizedWhen oAuth token is not valid.
403 ForbiddenWhen no system read scope is provided or resource specific read scope is provided.
404 Not foundWhen the plan is not found.

Body

The body contains requested plan details. The structure of plan in the body is described below.

Object definitions

MeteringPlan

The metering plan defines the metering part of the calculations that Abacus will execute.

PropertyTypeDescription
plan_idstringPlan ID
measuresarrayArray of Measures objects
metricsarrayArray of MeteringMetric objects

Measure

Measures are the raw data that you submit to Abacus. Each measure consists of multiple entries, each of them associated with a name and unit.

PropertyTypeDescription
namestringThe name of the measure. For example storage, heavy_api_calls or light_api_calls.
unitstringThe unit of the measure. For example BYTE and CALL.

MeteringMetric

While the measures represent the raw data, the metrics combine and derive something out of the data.

PropertyTypeDescription
namestringThe name of the metric. For example storage or thousand_light_api_calls.
unitstringThe unit of the metric. For example GIGABYTE and THOUSAND_CALLS.
typestringThere are two metric types discrete and time-based.
meterstringA map function responsible for transforming a raw measure into the unit used for metering.
accumulatestringA reduce function responsible for accumulating metered usage over time.
aggregatestringA reduce function responsible for aggregating usage in Cloud Foundry entities (space and organization), instead of time.
summarizestringA reduce function responsible for summarizing the different types of usage.

RatingPlan

A rating plan defines the rating calculations.

PropertyTypeDescription
plan_idstringPlan ID
metricsarrayArray of RatingMetric objects

RatingMetric

While the measures represent the raw data, the metrics combine and derive something out of the data.

PropertyTypeDescription
namestringThe name of the metric. For example storage or thousand_light_api_calls.
ratestringA simple map function responsible for converting an aggregated usage into a cost. This can be done at various levels like service instance, plan, app, space, org etc.
chargestringA reduce function responsible for charging at various levels like service instance, plan, app, space, org and so on.

PricingPlan

A pricing plan defines the pricing on per-measure basis.

PropertyTypeDescription
plan_idstringPlan ID
metricsarrayArray of PricingMetric objects

PricingMetric

While the measures represent the raw data, the metrics combine and derive something out of the data.

PropertyTypeDescription
namestringThe name of the metric. For example storage or thousand_light_api_calls.
metricsarrayArray of Price objects

Price

PropertyTypeDescription
countrystringThe ID of the country. For example EUR or USA.
metricsnumberThe price for the coresponding country.