-
Notifications
You must be signed in to change notification settings - Fork 86
Resource Provider Scenarios
This page lists Resource Provider scenarios and the recommended usage documents to use:
- Service provider - CF Broker
- Multi-tenant application - Application with users
- Multi-tenant Service Provider - Application with users acting as Broker
I am a service provider and like to meter usage of my service. The service is a CF service which is consumed via Service Broker API.
Resource provider runs in organization services
and space mongodb
. Provides mongodb databases as CF service instances.
Consumer runs as the emporiumify
application in organization shop
, space cart
. It stores items added in the cart in different mongodb collections, all in the same database.
{
"start": 1396421450000,
"end": 1396421451000,
"organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
"space_id": "d98b5916-3c77-44b9-ac12-04456df23eae",
"consumer_id": "app:d98b5916-3c77-44b9-ac12-045678edabae",
"resource_id": "mongodb",
"plan_id": "basic",
"resource_instance_id": "d98b5916-3c77-44b9-ac12-04d61c7a4eae",
"measured_usage": [
{
"measure": "storage",
"quantity": 145
}
]
}
Fields:
-
"organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538"
Can be broken into:
- us-south: datacenter or CF installation name. The schema is optional
- 54257f98-83f0-4eca-ae04-9ea35277a538: GUID of the consumer's
shop
organization
If the service provider knows the tenant of the applications using this service (tenant-aware) he can use appropriate schema instead
tenant:54257f98-83f0-4eca-ae04-9ea35277a538
. -
"space_id": "d98b5916-3c77-44b9-ac12-04456df23eae"
GUID of the consumer's
cart
space (undershop
organization) -
"consumer_id": "app:d98b5916-3c77-44b9-ac12-045678edabae"
Can be either:
- consumer's
emporiumify
application GUID - service binding GUID if no application data is available (in case service key is used)
- consumer's
-
"resource_id": "mongodb"
MongoDB Resource Provider ID
-
"plan_id": "basic"
Resource Provider (MongoDB) plan ID
-
"resource_instance_id": "d98b5916-3c77-44b9-ac12-04d61c7a4eae"
ID of the MongoDB database (or service instance) created for us.
-
"measured_usage"
KiB of storage used in the database
I like to meter data of my multi-tenant application. Application is called by a consumer tenant who does not necessarily has an org/space. Consumer calls app with a tenant-specific URL, API key or OAuth scope to identify itself.
Resource provider runs as the emporiumify
application in organization shop
, space cart
. It provides marketplace services to end-users.
Consumers access the emporiumify
application to add items to the marketplace so end-users can add them to cart and buy them.
{
"start": 1396421450000,
"end": 1396421451000,
"organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538",
"space_id": "d98b5916-3c77-44b9-ac12-04456df23eae",
"consumer_id": "app:d98b5916-3c77-44b9-ac12-045678edabae",
"resource_id": "emporiumify",
"plan_id": "shared",
"resource_instance_id": "customer:d98b5916-3c77-44b9-ac12-04d61c7a4eae",
"measured_usage": [
{
"measure": "storage",
"quantity": 145
}
]
}
Fields:
-
"organization_id": "us-south:54257f98-83f0-4eca-ae04-9ea35277a538"
Can be broken into:
- us-south: datacenter or CF installation name. The schema is optional
- 54257f98-83f0-4eca-ae04-9ea35277a538: GUID of the consumer's
shop
organization
-
"space_id": "d98b5916-3c77-44b9-ac12-04456df23eae"
GUID of the consumer's
cart
space (undershop
organization) -
"consumer_id": "app:d98b5916-3c77-44b9-ac12-045678edabae"
GUID of the consumer's
emporiumify
application (undershop/cart
) -
"resource_id": "emporiumify"
Our
emporiumify
Abacus resource provider ID -
"plan_id": "shared"
emporiumify
plan id. Used to identify which plan to use -
"resource_instance_id": "customer:d98b5916-3c77-44b9-ac12-04d61c7a4eae"
ID of the
emporiumify
app customer.
Multi-tenant application, that is also exposed as a service.
/images/multi-tenant-service-provider.png
Resource provider runs as the emporiumify
application in organization shop
, space cart
. It provides:
- marketplace services to end-users
- service instances (and REST API) to applications in CF via Service Broker API
Consumers:
- access the
emporiumify
application to add items to the marketplace so end-users can add them to cart and buy them - creates service instance in organization
extensions
, spacethirdparty
and binds it to appamazon
. Then it uses the REST API ofemporiumify
The emporiumify
Resource Provider must submit two kinds of documents based on the user:
Same as Multi-tenant app.
Similar to Resource provider:
{
"start": 1396421450000,
"end": 1396421451000,
"organization_id": "3612bfbe-a521-4a95-84e0-18a04cc42c5e",
"space_id": "8140eda1-bdc6-40ff-8dce-91248614dca8",
"consumer_id": "app:8343d7b6-a3f7-433b-8461-28512d333282",
"resource_id": "emporiumify",
"plan_id": "broker",
"resource_instance_id": "app:8343d7b6-a3f7-433b-8461-28512d333282",
"measured_usage": [
{
"measure": "storage",
"quantity": 145
}
]
}
Fields:
-
"organization_id": "3612bfbe-a521-4a95-84e0-18a04cc42c5e"
GUID of the
extensions
organization. -
"space_id": "8140eda1-bdc6-40ff-8dce-91248614dca8"
GUID of the
thirdparty
space (underextensions
organization) -
"consumer_id": "app:8343d7b6-a3f7-433b-8461-28512d333282"
GUID of the consumer's
amazon
application (underextensions/thirdparty
) -
"resource_id": "emporiumify"
Our
emporiumify
Abacus resource provider ID -
"plan_id": "shared"
broker
plan id. Used to identify a new plan that takes into account the broker use case -
"resource_instance_id": "app:8343d7b6-a3f7-433b-8461-28512d333282"
ID of the
amazon
app that uses ouremporiumify
service.
ABOUT | RESOURCE PROVIDER | ABACUS INTEGRATOR
*Abacus icon made by Freepik from www.flaticon.com