Object Store V2

(3 reviews)
Download

home

Short Description

The Object Store V2 API enables API access to Anypoint Platform Object Store v2.

Detailed Description

Object Store v2 provides fast sharing of data and states across batch processes, Mule components, multiple distributed applications. It enables use of a distributed object store for advanced use cases such as API caching and API rate limiting.

Object Store v2 is integrated as a service within Anypoint Platform and provides a self-service application object store so that developers do not need to rely on central IT to set up a standalone or third-party caching service. Object Store v2 is horizontally scalable, resilient, and distributed, and enables deployment of applications in CloudHub platform.

Requests to this api are rate limited at a flat 10 req/sec per client application.

For more information, see Object Store

Authentication

The Object Store v2 API requires authentication with the Anypoint Platform Access Management API using client credentials.

  1. Obtain your Client ID and Client Secret from the Anypoint Platform: Runtime Manager -> your application -> Object Store -> Show Client Credentials.
  2. Send a POST request to https://anypoint.mulesoft.com/accounts/oauth2/token endpoint to get an access token, using a body in application/x-www-form-urlencoded format with the following parameters:

    • client_id
    • client_secret
    • grant_type (set to "client_credentials")
  3. After obtaining the access token, pass it through the Authorization header when making API calls to the Object Store: "Authorization: bearer access_token".

Direct Calls to the API

In order to make API calls directly to the Object Store service, you need to obtain your application's organization and environment IDs.

Organization ID

In Anypoint platform
1. Go to Access Management
2. Select Organization tab
3. Select your application's organization
4. You would see a text box containing the organization ID in the pop-up window.

Environment ID

In Anypoint platform
1. Go to Access Management
2. Select Environments tab
3. Select your application's envrionment
4. Unlike organizations, the environment's pop-up window does not contain a text box with the environment ID. Take a look at the url in your browser when the pop-up window is open. The environment ID is the very last value, after /edit/.

We understand finding these IDs are cumbersome and we are working on a solution to make it simpler and easier.

Example API Calls

The following example shows how to retrieve a list of object stores

#To get access token:
curl -X POST \
  https://anypoint.mulesoft.com/accounts/oauth2/token \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -d 'client_id=<client_id>&client_secret=<client_secret>&grant_type=client_credentials'

#To send request to Object Store:
curl -X GET \
-H 'Authorization: bearer <access_token>' \
'https://object-store-us-east-1.anypoint.mulesoft.com/api/v1/organizations/<organization_id>/environments/<environment_id>/stores' 

Response:
{
  "values": [
    {
      "storeId": "APP\\_os-test\\_employees",
      "encrypted": true,
      "permanentOsFlag": false,
      "persistent": true,
      "defaultTtlSeconds": 1209600,
      "defaultConfirmationTtlSeconds": 600
    }
  ]
  "nextPageToken": null
}

Support

Support for this API is provided through the Anypoint Platform support portal.


Reviews