Skip to content
This repository has been archived by the owner on Jan 21, 2022. It is now read-only.

Resource Provider Scenarios

Hristo Iliev edited this page Apr 6, 2017 · 21 revisions

This page lists Resource Provider scenarios and the proposed usage documents to use.

Resource/Service provider

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.

Agents

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.

Usage document

{
  "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
  • "space_id": "d98b5916-3c77-44b9-ac12-04456df23eae"

    GUID of the consumer's cart space (under shop organization)

  • "consumer_id": "app:d98b5916-3c77-44b9-ac12-045678edabae"

    GUID of the consumer's emporiumify application

  • "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 resource used. We are using MongoDB database, so this can be the ID of the database (or service instance) created for us.

Multi-tenant application

Description: 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.

Usage document:

Multi-tenant Service provider

Description: Multi-tenant application, that is also exposed as a service.

Usage document:

Clone this wiki locally