Class: SeatLayer::Workspaces
- Defined in:
- lib/seatlayer/inventory.rb
Overview
Workspaces isolate one tenant's charts and events from another's.
Instance Method Summary collapse
- #create(name:, external_ref: nil, 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: nil, idempotency_key: nil) ⇒ Object
219 220 221 222 |
# File 'lib/seatlayer/inventory.rb', line 219 def create(name:, external_ref: nil, idempotency_key: nil) body = compact({ "name" => name, "externalRef" => external_ref }) @client.post("/v1/workspaces", body, idempotency_key: idempotency_key) end |
#list ⇒ Object
215 216 217 |
# File 'lib/seatlayer/inventory.rb', line 215 def list @client.get("/v1/workspaces") end |
#retrieve(workspace_id) ⇒ Object
224 225 226 |
# File 'lib/seatlayer/inventory.rb', line 224 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.
232 233 234 |
# File 'lib/seatlayer/inventory.rb', line 232 def update(workspace_id, fields) @client.patch("/v1/workspaces/#{encode(workspace_id)}", fields) end |