This example shows how to use the POST /datastores API operation to create a new datastore within the HyperFlex cluster. Important information for using this specific API, such as the API method, API parameters, and API request URL can be found within the HyperFlex REST API Explorer in the Datastore sub-category under the Core APIs top-level category.
API documentation location in HyperFlex REST API Explorer:
Example procedure using the Postman API client:
- Set the method to POST.

- Set the URL based on the specific API call. For the POST /datastores operation to create a new datastore or update an existing datastore. The complete URL should be set to https:///rest/datastores.

- Set the Authorization Type to Bearer and input a valid access token in the Token textbox. This example uses the access token that was generated in Obtaining a Valid Access Token Topic.
NOTE:
By selecting the Authorization Type as Bearer Token, Postman will automatically generate the required Header once the request is sent. An alternative method is to set Authorization Type to No Auth and manually enter the Header entry with the Key set to Authorization and the Value set to Bearer . Ensure there is a space between the word Bearer and .

- Under the Body tab, set the data type to raw and select “JSON (application/json)” in the drop-down to the right. Enter the body payload in the textbox.
NOTE:
The id parameter in the JSON payload for this API operation is only required if updating an existing datastore. When creating a new datastore this parameter can be deleted.

- Click the Send button in the upper right corner and review the response in the bottom pane. If successful, you will get a response which includes information about the new datastore that was created within the HyperFlex cluster.

The new datastore will now show up in HyperFlex Connect under Manage Datastores.
