Class: Infrawrench::AccountsPluginsNamespace

Inherits:
Object
  • Object
show all
Defined in:
lib/infrawrench/client.rb,
sig/infrawrench/sdk.rbs

Overview

client.accounts.plugins

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ AccountsPluginsNamespace

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 AccountsPluginsNamespace.

Parameters:



86
87
88
# File 'lib/infrawrench/client.rb', line 86

def initialize(transport)
  @transport = transport
end

Instance Method Details

#list(org_id: nil, request_options: nil) ⇒ Array<Hash>

List installed plugins and their credential fields

Requires permission: accounts:read.

GET /api/org/orgId/accounts/plugins

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Array<Hash>)

    Parsed JSON, shaped as Array<PluginSummary> — see sig/infrawrench/sdk.rbs.

Raises:



102
103
104
105
106
107
108
109
# File 'lib/infrawrench/client.rb', line 102

def list(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/accounts/plugins",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#policy_template(plugin_id:, org_id: nil, capabilities: nil, request_options: nil) ⇒ Hash

Generate a least-privilege credential template for a plugin

Returns the paste-ready credential document (IAM policy JSON, custom role YAML, token template…) scoped to the requested capability ids. Omitting capabilities (or sending it empty) selects every declared capability; any unknown capability id is rejected with 400. 400 also for plugins that don't provide a template.

Requires permission: accounts:read.

GET /api/org/orgId/accounts/plugins/pluginId/policy-template

Raises on 400: Bad request

Raises on 404: Not found

Parameters:

  • org_id (String, nil) (defaults to: nil)

    Organization id. Defaults to the org_id the client was constructed with.

  • plugin_id (String)
  • capabilities (String, nil) (defaults to: nil)

    Comma-separated capability ids, e.g. resources,costs.

  • request_options (Hash, nil) (defaults to: nil)

    Per-call :headers, :timeout and :open_timeout.

  • plugin_id: (plugin_id)
  • org_id: (String, nil) (defaults to: nil)
  • capabilities: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

    Parsed JSON, shaped as PolicyTemplateResponse — see sig/infrawrench/sdk.rbs.

Raises:



135
136
137
138
139
140
141
142
143
# File 'lib/infrawrench/client.rb', line 135

def policy_template(plugin_id:, org_id: nil, capabilities: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/accounts/plugins/{pluginId}/policy-template",
    path_params: { "orgId" => org_id, "pluginId" => plugin_id },
    query: { "capabilities" => capabilities },
    request_options: request_options
  )
end