Cloud Storage Service

Scroll down for code samples, example requests and responses. Select a language for code samples from the tabs above or the mobile navigation menu.

Authentication

  • HTTP Authentication, scheme: bearer

Object

Retrieve a signed URL for object file upload.

Code samples

URL obj = new URL("/cloud-storage/projects/{projectId}/upload-url?object_name=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /cloud-storage/projects/{projectId}/upload-url

This endpoint provides a signed URL for uploading the specified object file. You need to call the returned signed-url using the “PUT” HTTP method with the file included in the request body.

Parameters

Name In Type Required Description
projectId path integer true The ID of the project to be accessed.
object_name query string true The name of the object file to be uploaded.

Example responses

200 Response

"https://example.url/ex?ex=e"

default Response

{
  "code": "string",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK Operation successful. string
default Default An unexpected error occurred. Inline

Response Schema

Status Code default

Name Type Required Restrictions Description
» code string true none none
» message string true none none

Download an object file.

Code samples

URL obj = new URL("/cloud-storage/projects/{projectId}/download?object_name=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /cloud-storage/projects/{projectId}/download

This endpoint retrieves an object file from the specified project ID’s folder.

Parameters

Name In Type Required Description
projectId path integer true The ID of the project to be accessed.
object_name query string true The name of the object file to be downloaded.

Example responses

200 Response

default Response

{
  "code": "string",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK Operation successful. The response includes a binary string body. string
default Default An unexpected error occurred. Inline

Response Schema

Status Code default

Name Type Required Restrictions Description
» code string true none none
» message string true none none

Retrieve a signed URL for object file download.

Code samples

URL obj = new URL("/cloud-storage/projects/{projectId}/download-url?object_name=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /cloud-storage/projects/{projectId}/download-url

This endpoint provides a signed URL for downloading the specified object file. The returned signed URL should be invoked using the “GET” method.

Parameters

Name In Type Required Description
projectId path integer true The ID of the project to be accessed.
object_name query string true The name of the object file to be downloaded.
url_duration query string false The duration for which the download URL should be valid.

Example responses

200 Response

"https://example.url/ex?ex=e"

default Response

{
  "code": "string",
  "message": "string"
}

Responses

Status Meaning Description Schema
200 OK Operation successful. string
default Default An unexpected error occurred. Inline

Response Schema

Status Code default

Name Type Required Restrictions Description
» code string true none none
» message string true none none

List object attributes.

Code samples

URL obj = new URL("/cloud-storage/projects/{projectId}/list?path=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /cloud-storage/projects/{projectId}/list

This endpoint lists the attributes (name & size) of objects located at the specified path.

Parameters

Name In Type Required Description
projectId path integer true The ID of the project to be accessed.
path query string true The path from which to retrieve objects.

Example responses

200 Response

[
  {
    "name": "string",
    "size": 0
  }
]

Responses

Status Meaning Description Schema
200 OK Operation successful. Inline
default Default An unexpected error occurred. Inline

Response Schema

Status Code 200

Name Type Required Restrictions Description
» name string true none none
» size integer true none none

Status Code default

Name Type Required Restrictions Description
» code string true none none
» message string true none none

Delete an object file.

Code samples

URL obj = new URL("/cloud-storage/projects/{projectId}/delete?object_name=string");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("DELETE");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

DELETE /cloud-storage/projects/{projectId}/delete

This endpoint deletes the specified object file from the project ID’s folder.

Parameters

Name In Type Required Description
projectId path integer true The ID of the project to be accessed.
object_name query string true The name of the object file to be deleted.

Example responses

default Response

{
  "code": "string",
  "message": "string"
}

Responses

Status Meaning Description Schema
204 No Content Operation successful. In the absence of automatic redirection, a 307 response will be received with the signed URL located in the ‘Location’ header. None
default Default An unexpected error occurred. Inline

Response Schema

Status Code default

Name Type Required Restrictions Description
» code string true none none
» message string true none none

Schemas

ObjectInfo

{
  "name": "string",
  "size": 0
}

Properties

Name Type Required Restrictions Description
name string true none none
size integer true none none

Error

{
  "code": "string",
  "message": "string"
}

Properties

Name Type Required Restrictions Description
code string true none none
message string true none none