Class: Infrawrench::IacStatesNamespace
- Inherits:
-
Object
- Object
- Infrawrench::IacStatesNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.iac.states
Instance Method Summary collapse
-
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Upload a Terraform state document.
-
#delete(state_id:, org_id: nil, request_options: nil) ⇒ nil
Delete an uploaded state document.
-
#get(org_id: nil, request_options: nil) ⇒ Hash
List uploaded Terraform state documents.
-
#initialize(transport) ⇒ IacStatesNamespace
constructor
private
A new instance of IacStatesNamespace.
Constructor Details
#initialize(transport) ⇒ IacStatesNamespace
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 IacStatesNamespace.
7583 7584 7585 |
# File 'lib/infrawrench/client.rb', line 7583 def initialize(transport) @transport = transport end |
Instance Method Details
#create(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Upload a Terraform state document
Parses a .tfstate (format version 4) or terraform show -json output
(format_version 1.x) and records the resource instances it contains.
Attributes the state marks sensitive are dropped before anything is
written. The format version is checked, not assumed: an unsupported
version is a 400 rather than a partial read.
POST /api/org/orgId/iac/states
Raises on 400: Bad request
Raises on 404: Not found
7607 7608 7609 7610 7611 7612 7613 7614 7615 |
# File 'lib/infrawrench/client.rb', line 7607 def create(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/iac/states", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#delete(state_id:, org_id: nil, request_options: nil) ⇒ nil
Delete an uploaded state document
DELETE /api/org/orgId/iac/states/stateId
Raises on 404: Not found
7629 7630 7631 7632 7633 7634 7635 7636 7637 |
# File 'lib/infrawrench/client.rb', line 7629 def delete(state_id:, org_id: nil, request_options: nil) @transport.request( http_method: "DELETE", path: "/api/org/{orgId}/iac/states/{stateId}", path_params: { "orgId" => org_id, "stateId" => state_id }, accept: :empty, request_options: ) end |
#get(org_id: nil, request_options: nil) ⇒ Hash
List uploaded Terraform state documents
Every state document the organization has uploaded, newest first. The documents themselves are never stored — only the parsed, redacted projection.
GET /api/org/orgId/iac/states
7653 7654 7655 7656 7657 7658 7659 7660 |
# File 'lib/infrawrench/client.rb', line 7653 def get(org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/iac/states", path_params: { "orgId" => org_id }, request_options: ) end |