curl --request POST \ --url 'https://api.e2enetworks.com/myaccount/api/v1/gpu/datasets/?project_id=<PROJECT_ID>&location=<LOCATION>&apikey=<API_KEY>' \ --header 'Authorization: Bearer <API_TOKEN>' \ --header 'Content-Type: application/json' \ --data '{ "name": "string", "storage_type": "managed", "pvc": { "disk_size": 0, "pvc_type": "string" }, "bucket": { "bucket_name": "string", "endpoint": "string" }, "access_key": { "access_key": "string", "secret_key": "string" }, "encryption_enable": false, "encryption_type": "sse-kms", "description": "string"}'import requests
response = requests.post( "https://api.e2enetworks.com/myaccount/api/v1/gpu/datasets/", params={"project_id": "<PROJECT_ID>", "location": "<LOCATION>", "apikey": "<API_KEY>"}, headers={"Authorization": "Bearer <API_TOKEN>"}, json={ "name": "string", "storage_type": "managed", "pvc": { "disk_size": 0, "pvc_type": "string", }, "bucket": { "bucket_name": "string", "endpoint": "string", }, "access_key": { "access_key": "string", "secret_key": "string", }, "encryption_enable": False, "encryption_type": "sse-kms", "description": "string", },)print(response.json())const url = new URL("https://api.e2enetworks.com/myaccount/api/v1/gpu/datasets/");url.search = new URLSearchParams({ project_id: "<PROJECT_ID>", location: "<LOCATION>", apikey: "<API_KEY>" });
const response = await fetch(url, { method: "POST", headers: { "Authorization": "Bearer <API_TOKEN>", "Content-Type": "application/json" }, body: JSON.stringify({ "name": "string", "storage_type": "managed", "pvc": { "disk_size": 0, "pvc_type": "string" }, "bucket": { "bucket_name": "string", "endpoint": "string" }, "access_key": { "access_key": "string", "secret_key": "string" }, "encryption_enable": false, "encryption_type": "sse-kms", "description": "string" }),});console.log(await response.json());Create a new dataset with one of three storage types:
- managed: System creates and manages a new EOS bucket
- existing_bucket: Connect to an existing EOS bucket with provided credentials
- pvc: Create a dataset with disk storage
Optionally supports encryption (SSE-KMS or SSE-C) for managed and existing_bucket types.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Project ID
Active IAM ID (To access contact person account) Find your Active IAM ID here
Location
Request Bodyrequired
Section titled “Request Bodyrequired”object
Name of the dataset
Type of storage for the dataset
PVC configuration, required if storage_type is pvc
object
Disk size for the PVC in GB
Type of the PVC
Bucket configuration, required if storage_type is existing_bucket
object
Name of the existing bucket
Endpoint URL of the object store
Access key configuration, required if storage_type is existing_bucket
object
Access key for the bucket
Secret key for the bucket
Whether to enable encryption
Type of encryption to use (required if encryption_enable is true):
- sse-kms: Server-side encryption with KMS (E2E managed)
- sse-c: Server-side encryption with customer-provided keys (user managed)
Optional description of the dataset
Responses
Section titled “Responses”Success response indicating that the dataset was created.
object
HTTP status code for the operation.
object
Unique identifier of the dataset.
Name of the dataset.
ID of the project associated with the dataset.
Description of the dataset, which is null in this case.
Type of storage used for the dataset.
Persistent volume claim (PVC) details, which is null in this case.
object
Unique identifier of the bucket.
Name of the storage bucket.
URL of the bucket.
Endpoint URL of the object store.
Whether the bucket is managed.
EOS bucket permission ID.
object
Unique identifier for the access key.
The access key.
The secret key for accessing the bucket.
A tag associated with the access key.
Whether the access key is managed.
Type of encryption used, which is null in this case.
Whether encryption is enabled for the dataset.
Status of the dataset.
object
User ID of the creator.
Name of the creator.
Email of the creator.
Username of the creator.
Timestamp of when the dataset was created.
Timestamp of when the dataset was last updated.
Any errors encountered during the operation.
object
Message indicating the result of the operation.
Example
{ "code": 201, "data": { "id": 1310, "name": "eos-bucket", "project_id": 124, "storage_type": "managed", "bucket": { "id": 2525, "bucket_name": "d-gpu-b4273173-e5ab-4a85-ad89-dc8d6e698a93", "bucket_url": "s3://d-gpu-b4273173-e5ab-4a85-ad89-dc8d6e698a93/", "endpoint": "https://objectstore.e2enetworks.net", "is_managed": true, "eos_bucket_permission_id": 10214 }, "access_key": { "id": 2542, "access_key": "FWXL9EZZWS4BBSX9512V", "secret_key": "ZB3PM8XBNQGG4PFVDEI5915IO1TZHCFGEIO2LID9", "tag": "akgpu50a522c13dcd4708a5dbf6ae3da98bfa", "is_managed": true }, "encryption_enable": false, "status": "Pending", "created_by": { "id": 3573, "name": "Nipun", "email": "nipun.arora@e2enetworks.com", "username": "nipun.arora@e2enetworks.com" }, "created_at": "2024-11-14T12:57:36.293942Z", "updated_at": "2024-11-14T12:57:36.293994Z" }, "errors": {}, "message": "Created Successfully"}