Managing storage in Management API#
This guide explains how to manage storage entries using the Management API. In Adverity, storage entries appear under Settings → Storage and are used to stage data extracts before loading them into a destination such as Google BigQuery.
Prerequisites#
Before you complete the procedure in this guide, perform all of the following actions:
Ensure your API key belongs to a user with the Administrator workspace role. Only users with the Administrator role can create, update, or delete storage entries. Users without this role can only list storage entries.
Create a workspace and determine its
WORKSPACE_ID. For more information, see Configuring workspaces in Management API.For Google Cloud Storage entries, create a Google Cloud Storage authorization in Adverity and determine its
AUTH_ID. For more information, see Creating and configuring authorizations in Management API.
Note
These endpoints require the Bearer scheme for the
Authorization header.
Listing storage entries#
To list all storage entries, follow these steps:
Create a GET request to the following endpoint:
https://{{INSTANCE}}/api/storage/
In the HTTP request header, include the parameter
Authorizationwith the valueBearer {{KEY}}.Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location --request GET 'https://{{INSTANCE}}/api/storage/' \
--header 'Authorization: Bearer {{KEY}}'
Creating a storage entry#
To create a new storage entry, follow these steps:
Create a POST request to the following endpoint:
https://{{INSTANCE}}/api/storage/
In the HTTP request header, include the parameter
Authorizationwith the valueBearer {{KEY}}.In the HTTP request header, include the parameter
Content-Typewith valueapplication/json.In the HTTP request body, include the following parameters and values:
- name
Use a unique name for the storage entry. The name must be unique across the entire tenant.
- stack
Use the
WORKSPACE_IDof the workspace this storage entry belongs to.- url
Use the full storage URL including the scheme. For example,
gcs://my-bucket/exportsors3://my-bucket/path. Supported schemes:gcs,s3,azure,sftp,ftp,ftp+passive,smb.- auth
(Optional, Google Cloud Storage only) Use the
AUTH_IDof the Google Cloud Storage authorization.
Example of the request body:
{ "name": "NEW_STORAGE_NAME", "stack": {{WORKSPACE_ID}}, "url": "gcs://my-bucket/exports", "auth": {{AUTH_ID}} }
Send the request.
A successful request returns HTTP 201 and the created record, including
its id. Save this id if you intend to configure bulk loading for
a Google BigQuery destination. For more information, see Enabling
bulk loading for Google BigQuery in Management API.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location --request POST 'https://{{INSTANCE}}/api/storage/' \
--header 'Authorization: Bearer {{KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "NEW_STORAGE_NAME",
"stack": {{WORKSPACE_ID}},
"url": "gcs://my-bucket/exports",
"auth": {{AUTH_ID}}
}'
Updating a storage entry#
To update a storage entry, follow these steps:
Create a PATCH request to the following endpoint:
https://{{INSTANCE}}/api/storage/{{STORAGE_ID}}/
In the HTTP request header, include the parameter
Authorizationwith the valueBearer {{KEY}}.In the HTTP request header, include the parameter
Content-Typewith valueapplication/json.In the HTTP request body, include the parameters you want to update.
Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location --request PATCH \
'https://{{INSTANCE}}/api/storage/{{STORAGE_ID}}/' \
--header 'Authorization: Bearer {{KEY}}' \
--header 'Content-Type: application/json' \
--data-raw '{"name": "UPDATED_STORAGE_NAME"}'
Deleting a storage entry#
To delete a storage entry, follow these steps:
Create a DELETE request to the following endpoint:
https://{{INSTANCE}}/api/storage/{{STORAGE_ID}}/
In the HTTP request header, include the parameter
Authorizationwith the valueBearer {{KEY}}.Send the request.
Import the request example as raw text to your HTTP client (such as Postman). The cURL request example is the following:
curl --location --request DELETE \
'https://{{INSTANCE}}/api/storage/{{STORAGE_ID}}/' \
--header 'Authorization: Bearer {{KEY}}'
Troubleshooting#
Symptom |
Likely cause and action |
|---|---|
403 Forbidden on POST, PATCH, or DELETE |
Your API key belongs to a user without the Administrator workspace role. Use a key from an Administrator account. |
400 “Auth is only valid for Google Cloud Storage.” |
The |
400 mentioning name uniqueness |
The |