Class: Infrawrench::IacNamespace
- Inherits:
-
Object
- Object
- Infrawrench::IacNamespace
- Defined in:
- lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs
Overview
client.iac
Instance Attribute Summary collapse
-
#states ⇒ IacStatesNamespace
readonly
client.iac.states.
Instance Method Summary collapse
-
#import_plan(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Generate Terraform import blocks for unmanaged resources.
-
#initialize(transport) ⇒ IacNamespace
constructor
private
A new instance of IacNamespace.
-
#reconciliation(state_id:, org_id: nil, request_options: nil) ⇒ Hash
Classify inventory against a state document.
-
#resource(resource_id:, org_id: nil, request_options: nil) ⇒ Hash
IaC status for one resource.
Constructor Details
#initialize(transport) ⇒ IacNamespace
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 IacNamespace.
7616 7617 7618 7619 |
# File 'lib/infrawrench/client.rb', line 7616 def initialize(transport) @transport = transport @states = IacStatesNamespace.new(@transport) end |
Instance Attribute Details
#states ⇒ IacStatesNamespace (readonly)
Returns client.iac.states.
7612 7613 7614 |
# File 'lib/infrawrench/client.rb', line 7612 def states @states end |
Instance Method Details
#import_plan(org_id: nil, body: nil, request_options: nil) ⇒ Hash
Generate Terraform import blocks for unmanaged resources
Terraform 1.5+ import blocks plus the matching resource stanzas,
generated by the same plugin export mappers and HCL serializer that back
"Export to Terraform…". Resources no plugin can express are returned in
unsupported with a reason, never dropped.
POST /api/org/orgId/iac/import-plan
Raises on 400: Bad request
Raises on 404: Not found
7641 7642 7643 7644 7645 7646 7647 7648 7649 |
# File 'lib/infrawrench/client.rb', line 7641 def import_plan(org_id: nil, body: nil, request_options: nil) @transport.request( http_method: "POST", path: "/api/org/{orgId}/iac/import-plan", path_params: { "orgId" => org_id }, body: body, request_options: ) end |
#reconciliation(state_id:, org_id: nil, request_options: nil) ⇒ Hash
Classify inventory against a state document
Every synced resource classified as managed, drifted or unmanaged against one uploaded state, plus state entries with no inventory match. Unmanaged resources carry the ownership and first-seen join that answers "who made this by hand, and when".
GET /api/org/orgId/iac/reconciliation
Raises on 400: Bad request
Raises on 404: Not found
7671 7672 7673 7674 7675 7676 7677 7678 7679 |
# File 'lib/infrawrench/client.rb', line 7671 def reconciliation(state_id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/iac/reconciliation", path_params: { "orgId" => org_id }, query: { "stateId" => state_id }, request_options: ) end |
#resource(resource_id:, org_id: nil, request_options: nil) ⇒ Hash
IaC status for one resource
The managed/unmanaged badge for a resource detail page, computed against
the newest state document. status is null when the organization has
uploaded none — absence of a state is not evidence of ClickOps. A query
parameter rather than a path segment because composite resource ids
contain slashes.
GET /api/org/orgId/iac/resource
Raises on 400: Bad request
7700 7701 7702 7703 7704 7705 7706 7707 7708 |
# File 'lib/infrawrench/client.rb', line 7700 def resource(resource_id:, org_id: nil, request_options: nil) @transport.request( http_method: "GET", path: "/api/org/{orgId}/iac/resource", path_params: { "orgId" => org_id }, query: { "resourceId" => resource_id }, request_options: ) end |