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.
8055 8056 8057 |
# File 'lib/infrawrench/client.rb', line 8055 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
8079 8080 8081 8082 8083 8084 8085 8086 8087 |
# File 'lib/infrawrench/client.rb', line 8079 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
8101 8102 8103 8104 8105 8106 8107 8108 8109 |
# File 'lib/infrawrench/client.rb', line 8101 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
8125 8126 8127 8128 8129 8130 8131 8132 |
# File 'lib/infrawrench/client.rb', line 8125 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 |