Skip to main content
Version: v1

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

ParameterTypeConstraintsDescriptionExample
project_idinteger> 0, requiredProject ID associated with the resource2
namestring0 < length < 256, requiredResource namestorage-europe
provider_idinteger> 0, requiredS3 provider ID2
provider_protostringhttp | https, requiredS3 provider URL schemehttps
provider_hoststring0 < length < 256, requiredS3 provider hostnamestorage.googleapis.com
provider_portinteger> 0, < 65536, requiredS3 provider port number443
note

Resource name must be unique within a single project

Response Parameters

JSON body

ParameterTypeDescription
task_idstringTask 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"
}