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.
3984 3985 3986 |
# File 'lib/infrawrench/client.rb', line 3984 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
4006 4007 4008 4009 4010 4011 4012 4013 4014 |
# File 'lib/infrawrench/client.rb', line 4006 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
4032 4033 4034 4035 4036 4037 4038 4039 |
# File 'lib/infrawrench/client.rb', line 4032 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
4055 4056 4057 4058 4059 4060 4061 4062 |
# File 'lib/infrawrench/client.rb', line 4055 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
4076 4077 4078 4079 4080 4081 4082 4083 |
# File 'lib/infrawrench/client.rb', line 4076 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
4106 4107 4108 4109 4110 4111 4112 4113 |
# File 'lib/infrawrench/client.rb', line 4106 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
4137 4138 4139 4140 4141 4142 4143 4144 4145 |
# File 'lib/infrawrench/client.rb', line 4137 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 |