Important
|
This document describes a REST API that is not supported in the Object Store v2 Beta. The REST API requires a client ID and secret for an application, but this information is not provided by Runtime Manager. |
Anypoint Object Store v2 (OSv2) provides REST APIs that let you get and store key,list
values.
An object store belongs to an application. You can get the client ID and client secret from the Application Data menu from Anypoint Platform > Runtime Manager.
Important
|
The Object Store Connector reads and writes in the key,value format; whereas OSv2 reads and writes in the key,list format. If an application writes to an object store using the REST interface and reads with the object store connector from the same key, the read can only retrieve the value at element 0 of the list.
|
OSv2 provides these operations:
Tasks | REST API Operations | Object Store Connector Operation |
---|---|---|
Define (Post) |
|
|
Get |
|
Contains, Retrieve, Retrieve all keys, Retrieve and store (Retrieve part) |
Put |
|
Dual store †, Store |
Delete |
|
† The Dual Store operation in the Object Store connector consists of these two operations where the key and value are stored and then the values reversed. The Dual Store operation acts the same as two OSv2 Put item as String calls to accomplish these results:
-
objectStore.store(key, value);
-
objectStore.store(value, key);
Note
|
Before deploying an object store application, first log into Anypoint Platform > Runtime Manager and stop any running applications to reduce the number of allowed workers so that you can add a new application. |
Accessing the Object Store 2 API works as follows:
-
Log into Anypoint Platform.
-
Click Runtime Manager.
-
If you have an existing application, click it and click Manage Application.
If this is your first use, create an application in Anypoint Studio. When done developing, right-click the project name in Package Explorer and click Anypoint Platform > Deploy to Cloud.
-
In the Runtime Manager Deploying Application menu:
NoteIf you have not stopped a running application to allow the current application to deploy, click Cancel and log into Anypoint Platform > Runtime Manager to stop an application. If you attempt to stop an application from a second window, the Deploying Application window won’t know about it and attempting to install the application results in a Failed application that can’t be started. -
If the application name has a red X, change the name so that the green check mark appears after the name.
The application name you choose becomes the name users access your application with. For example, if you name your application, mydemo, users can access your application at
http://mydemo.cloudhub.io/
. -
Ignore the Deployment Target and Application File fields - Anypoint Studio fills in this information for you.
-
If needed, change the Mule Runtime version field from the drop-down list.
-
If needed, change the Worker size field.
-
Click Deploy Application.
-
-
Set up an application like Postman to access the object store. Obtain the access_token value (not supported in Beta).
-
Configure the object store access URL to:
{{osBaseUrl}}/api/v1/organizations/:organizationId/environments/:environmentId/stores/myTestStoreId/objects
-
Configure the application with HTTP headers and body for values to store to or read from the object store.
-
Send the operation to the object store API.
-