Mount endpoint
Use the Mount endpoint to connect external drives to a workspace on AI Hub, such as an Amazon S3 bucket or Azure Blob Storage container. This endpoint doesn’t support mounting organization drives. To mount organization drives, use the AI Hub UI.
In this document, URL_BASE
refers to the root URL of your Instabase instance, such as aihub.instabase.com
. API_ROOT
defines where to route API requests for file operations, and its value is URL_BASE
appended by /api/v1/drives
.
To make calls to AI Hub APIs, you must define your API token and send it with your requests. <API_TOKEN>
in the following examples refers to your API token. You can generate and manage API tokens from your AI Hub user settings. See the authorization documentation for details.
Mount paths
Use the mount path to specify the workspace in which to mount the drive. The format of the mount path varies if you have a community or organization account.
-
Community accounts:
/<USER-ID>/my-repo/fs
-
Organization accounts:
/<ORGANIZATION-ID>/<WORKSPACE>/fs
Mount drive
Description
Mount a drive by sending a POST
request to API_ROOT/<MOUNT-PATH>
, specifying the workspace in which to connect the drive using MOUNT-PATH in the request URL.
Request headers
Amazon S3 bucket mount details
Mounting Amazon S3 buckets is supported for organization accounts. For an S3 bucket, provide mount details in the following structure:
s3_sse_encryption_type
is set to aws_sse_kms
, define the Amazon resource name (ARN) for the KMS key in s3_sse_kms_key_id
. For example, 'arn:aws:kms:us-west-2:123456789012:key/abcd1234-5678-90ab-cdef-EXAMPLE11111'
. See the AWS Finding the key ID and key ARN documentation for additional information.Azure Blob Storage mount details
Mounting Amazon S3 buckets is supported for organization accounts. Azure Blob Storage drives can be mounted with a connection string or a service principal as the authentication type.
If mounting an Azure Blob Storage container with a connection string, provide mount details in the following structure:
See the following sample connection string structure for an Azure storage account with default configurations. Connection strings can embed a different subset of fields:
If mounting an Azure Blob Storage container with a service principal, provide mount details in the following structure:
Request body
This request contains no body.
Response status
A 2XX status code indicates the request was successful.
Response headers
Headers are always present if the request was successful unless marked as optional.
Response schema
All keys are returned in the response by default, unless marked as optional.
Examples
Request
This request creates an Azure Blob Storage drive with the name azure-blob-mount-point
.
Response
Update drive credentials
Description
Update a drive’s credentials by sending a PUT
request to API_ROOT/<MOUNT-PATH>
, specifying the workspace in which the drive is connected using MOUNT-PATH in the request URL.
Request headers
mount_details
object. See the following examples for supported fields.For an S3 bucket, you can update the following drive credentials fields:
For Azure Blob Storage drives mounted with a connection string, you can update the following drive credentials fields:
For Azure Blob Storage drives mounted with a service principal, you can update the following drive credentials fields:
Request body
This request contains no body.
Response status
A 2XX status code indicates the request was successful.
Response headers
Headers are always present if the request was successful unless marked as optional.
Response schema
All keys are returned in the response by default, unless marked as optional.
Examples
Request
This request updates the connection string of the existing Azure Blob Storage drive “azure-blob-mount-point”.
Response
If the drive credentials were successfully updated:
Unmount drive
Description
Remove a mounted drive by sending a DELETE
request to API_ROOT/<MOUNT-PATH>
, specifying the workspace in which the drive is connected using MOUNT-PATH in the request URL.
Request headers
Request body
This request contains no body.
Response status
A 2XX status code indicates the request was successful.
Response headers
Headers are always present if the request was successful unless marked as optional.
Response schema
All keys are returned in the response by default, unless marked as optional.
Examples
Request
Response
If the credentials to the drive was successfully unmounted: