Class: Infrawrench::CostExportsNamespace
- Inherits:
-
Object
- Object
- Infrawrench::CostExportsNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.cost_exports
Instance Method Summary collapse
-
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a cost export.
-
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a cost export.
-
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get a cost export.
-
#initialize(transport) ⇒ CostExportsNamespace
constructor
private
A new instance of CostExportsNamespace.
-
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List scheduled cost exports.
-
#run(id:, org_id: nil, request_options: nil) ⇒ Hash
Run a cost export now.
-
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a cost export.
Constructor Details
#initialize(transport) ⇒ CostExportsNamespace
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 CostExportsNamespace.
4456 4457 4458 |
# File 'lib/infrawrench/client.rb', line 4456 def initialize(transport) @transport = transport end |
Instance Method Details
#create(body:, org_id: nil, request_options: nil) ⇒ Hash
Create a cost export
Credentials are required on create. They are encrypted at rest and no
route ever returns them; responses carry a redacted credentialHint
instead.
Requires permission: org:settings:write.
POST /api/org/orgId/cost-exports
Raises on 400: Bad request
4478 4479 4480 4481 4482 4483 4484 4485 4486 |
# File 'lib/infrawrench/client.rb', line 4478 def create(body:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/cost-exports", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(id:, org_id: nil, request_options: nil) ⇒ Hash
Delete a cost export
Soft delete. Objects already written to the destination are left alone.
Requires permission: org:settings:write.
DELETE /api/org/orgId/cost-exports/id
Raises on 404: Not found
4504 4505 4506 4507 4508 4509 4510 4511 |
# File 'lib/infrawrench/client.rb', line 4504 def delete(id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/cost-exports/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#get(id:, org_id: nil, request_options: nil) ⇒ Hash
Get a cost export
Requires permission: costs:read.
GET /api/org/orgId/cost-exports/id
Raises on 404: Not found
4527 4528 4529 4530 4531 4532 4533 4534 |
# File 'lib/infrawrench/client.rb', line 4527 def get(id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/cost-exports/{id}", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#list(org_id: nil, request_options: nil) ⇒ Array<Hash>
List scheduled cost exports
Requires permission: costs:read.
GET /api/org/orgId/cost-exports
4548 4549 4550 4551 4552 4553 4554 4555 |
# File 'lib/infrawrench/client.rb', line 4548 def list(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/cost-exports", path_params: { "orgId" => org_id }, request_options: ) end |
#run(id:, org_id: nil, request_options: nil) ⇒ Hash
Run a cost export now
Runs the export immediately against the same code path the poller uses,
writing every period in the restatement window. Answers 200 with status: "failed" and a message rather than an error status when the destination
rejects the write — the caller wants the reason, and the same failure is
recorded on the export.
Requires permission: org:settings:write.
POST /api/org/orgId/cost-exports/id/run
Raises on 404: Not found
4578 4579 4580 4581 4582 4583 4584 4585 |
# File 'lib/infrawrench/client.rb', line 4578 def run(id:, org_id: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/cost-exports/{id}/run", path_params: { "orgId" => org_id, "id" => id }, request_options: ) end |
#update(id:, body:, org_id: nil, request_options: nil) ⇒ Hash
Update a cost export
Replaces everything but the credential. Omit
accessKeyId/secretAccessKey/url to keep the stored credential;
changing the destination type requires supplying a new one. Saving
reschedules the export from now.
Requires permission: org:settings:write.
PUT /api/org/orgId/cost-exports/id
Raises on 400: Bad request
Raises on 404: Not found
4609 4610 4611 4612 4613 4614 4615 4616 4617 |
# File 'lib/infrawrench/client.rb', line 4609 def update(id:, body:, org_id: nil, request_options: nil) @transport.request( http_method: "PUT", path: "/api/org/{orgId}/cost-exports/{id}", path_params: { "orgId" => org_id, "id" => id }, body: body, request_options: ) end |