Create Resource
This method creates a new S3 resource. The resource will be associated with the specified project and provider.
info
A background task will be created upon successful request. You can track the task progress using the Tasks API
Request Parameters
POST /api/clients/v1/s3Resources/
Headers
- Content-Type: application/json
- Authorization: Bearer
$access_token
JSON body
| Parameter | Type | Constraints | Description | Example |
|---|---|---|---|---|
| project_id | integer | > 0, required | Project ID associated with the resource | 2 |
| name | string | 0 < length < 256, required | Resource name | storage-europe |
| provider_id | integer | > 0, required | S3 provider ID | 2 |
| provider_proto | string | http | https, required | S3 provider URL scheme | https |
| provider_host | string | 0 < length < 256, required | S3 provider hostname | storage.googleapis.com |
| provider_port | integer | > 0, < 65536, required | S3 provider port number | 443 |
note
Resource name must be unique within a single project
Response Parameters
JSON body
| Parameter | Type | Description |
|---|---|---|
| task_id | string | Task ID |
Examples
200 OK
Task ID for resource creation. The task result and created resource ID are contained in the task object
{
"task_id": "bb4dcd80-01a5-4a73-8c2b-62c5027a9b72"
}
400 Bad Request
Invalid or missing required body parameters
{
"provider_host": [
"This field may not be blank."
],
"provider_port": [
"Ensure this value is less than or equal to 65535."
]
}
401 Unauthorized
Authentication credentials missing or invalid
{
"detail": "Given token not valid for any token type",
"code": "token_not_valid",
"messages": [
{
"token_class": "AccessToken",
"token_type": "access",
"message": "Token is invalid or expired"
}
]
}
403 Forbidden
Resource can only be associated with your own project
{
"detail": "Only project participants can view this project's resources"
}
409 Conflict
Resource with these parameters already exists
{
"detail": "Resource with these parameters already exists"
}