Class: Infrawrench::StorageNamespace
- Inherits:
-
Object
- Object
- Infrawrench::StorageNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.storage
Instance Method Summary collapse
-
#delete(body:, org_id: nil, request_options: nil) ⇒ Hash
Delete a storage object.
-
#download(account_id:, bucket:, keys:, org_id: nil, request_options: nil) ⇒ String
Download one or many objects (zipped if more than one).
-
#initialize(transport) ⇒ StorageNamespace
constructor
private
A new instance of StorageNamespace.
-
#list(body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
List objects in a bucket / prefix.
-
#mkdir(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a folder marker in a bucket.
-
#upload(body:, org_id: nil, request_options: nil) ⇒ Hash
Upload a file to object storage.
Constructor Details
#initialize(transport) ⇒ StorageNamespace
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of StorageNamespace.
5077 5078 5079 |
# File 'lib/infrawrench/client.rb', line 5077 def initialize(transport) @transport = transport end |
Instance Method Details
#delete(body:, org_id: nil, request_options: nil) ⇒ Hash
Delete a storage object
Requires permission: storage:write.
POST /api/org/orgId/storage/delete
Raises on 400: Bad request
Raises on 404: Not found
5097 5098 5099 5100 5101 5102 5103 5104 5105 |
# File 'lib/infrawrench/client.rb', line 5097 def delete(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/storage/delete", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#download(account_id:, bucket:, keys:, org_id: nil, request_options: nil) ⇒ String
Download one or many objects (zipped if more than one)
Requires permission: storage:read.
GET /api/org/orgId/v1/storage/download
Raises on 400: Bad request
Raises on 404: Not found
Raises on 500: Server error
5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 |
# File 'lib/infrawrench/client.rb', line 5127 def download(account_id:, bucket:, keys:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/v1/storage/download", path_params: { "orgId" => org_id }, query: { "accountId" => account_id, "bucket" => bucket, "keys" => keys }, accept: :binary, request_options: ) end |
#list(body:, org_id: nil, request_options: nil) ⇒ Array<Hash>
List objects in a bucket / prefix
Requires permission: storage:read.
POST /api/org/orgId/storage/list
Raises on 400: Bad request
Raises on 404: Not found
5155 5156 5157 5158 5159 5160 5161 5162 5163 |
# File 'lib/infrawrench/client.rb', line 5155 def list(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/storage/list", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#mkdir(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a folder marker in a bucket
Requires permission: storage:write.
POST /api/org/orgId/storage/mkdir
Raises on 400: Bad request
Raises on 404: Not found
5181 5182 5183 5184 5185 5186 5187 5188 5189 |
# File 'lib/infrawrench/client.rb', line 5181 def mkdir(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/storage/mkdir", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#upload(body:, org_id: nil, request_options: nil) ⇒ Hash
Upload a file to object storage
Multipart/form-data. Plugin must implement uploadStorageObject.
Requires permission: storage:write.
POST /api/org/orgId/v1/storage/upload
Raises on 400: Bad request
Raises on 404: Not found
5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 |
# File 'lib/infrawrench/client.rb', line 5209 def upload(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/v1/storage/upload", path_params: { "orgId" => org_id }, form: body, form_files: ["file"], request_options: ) end |