Class: SeatLayer::Workspaces
- Defined in:
- lib/seatlayer/inventory.rb
Overview
Workspaces isolate one tenant's charts and events from another's.
Constant Summary
Constants inherited from Resource
Instance Method Summary collapse
- #create(name:, external_ref: UNSET, idempotency_key: nil) ⇒ Object
- #list ⇒ Object
- #retrieve(workspace_id) ⇒ Object
-
#update(workspace_id, fields) ⇒ Object
Rename, re-reference, or disable a workspace.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from SeatLayer::Resource
Instance Method Details
#create(name:, external_ref: UNSET, idempotency_key: nil) ⇒ Object
256 257 258 259 260 261 262 |
# File 'lib/seatlayer/inventory.rb', line 256 def create(name:, external_ref: UNSET, idempotency_key: nil) body = { "name" => name } body.merge!(supplied({ "externalRef" => external_ref })) @client.post( "/v1/workspaces", body, idempotency_key: idempotency_key, retry_policy: :header_replay ) end |
#list ⇒ Object
252 253 254 |
# File 'lib/seatlayer/inventory.rb', line 252 def list @client.get("/v1/workspaces") end |
#retrieve(workspace_id) ⇒ Object
264 265 266 |
# File 'lib/seatlayer/inventory.rb', line 264 def retrieve(workspace_id) @client.get("/v1/workspaces/#{encode(workspace_id)}") end |
#update(workspace_id, fields) ⇒ Object
Rename, re-reference, or disable a workspace.
The organisation's default workspace cannot be disabled — the API answers
409 default_workspace_required. Promote another one first.
272 273 274 |
# File 'lib/seatlayer/inventory.rb', line 272 def update(workspace_id, fields) @client.patch("/v1/workspaces/#{encode(workspace_id)}", fields) end |