Class: Infrawrench::ResourcesSecretVersionsNamespace

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

Overview

client.resources.secret_versions

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ ResourcesSecretVersionsNamespace

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

Parameters:



2367
2368
2369
# File 'lib/infrawrench/client.rb', line 2367

def initialize(transport)
  @transport = transport
end

Instance Method Details

#access(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Reveal the plaintext value of a specific version (one-time)

Requires permission: secrets:read.

POST /api/org/orgId/resources/pluginId/typeId/secret-versions/access

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)
  • type_id (String)
  • body (Hash)

    Request body, shaped as SecretAccessRequest.

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

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

  • plugin_id: (plugin_id)
  • type_id: (resource_type_id)
  • body: (secret_access_request)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



2390
2391
2392
2393
2394
2395
2396
2397
2398
# File 'lib/infrawrench/client.rb', line 2390

def access(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/access",
    path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
    body: body,
    request_options: request_options
  )
end

#add(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Add a new secret version

Requires permission: secrets:write.

POST /api/org/orgId/resources/pluginId/typeId/secret-versions/add

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)
  • type_id (String)
  • body (Hash)

    Request body, shaped as SecretAddRequest.

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

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

  • plugin_id: (plugin_id)
  • type_id: (resource_type_id)
  • body: (secret_add_request)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



2419
2420
2421
2422
2423
2424
2425
2426
2427
# File 'lib/infrawrench/client.rb', line 2419

def add(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/add",
    path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
    body: body,
    request_options: request_options
  )
end

#get(plugin_id:, type_id:, resource_id:, account_id:, org_id: nil, parent_resource_id: nil, request_options: nil) ⇒ Hash

List secret versions for a versioned-secret resource

Requires permission: secrets:read.

GET /api/org/orgId/resources/pluginId/typeId/secret-versions

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)
  • type_id (String)
  • resource_id (String)
  • account_id (String)
  • parent_resource_id (String, nil) (defaults to: nil)
  • request_options (Hash, nil) (defaults to: nil)

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

  • plugin_id: (plugin_id)
  • type_id: (resource_type_id)
  • resource_id: (resource_id)
  • account_id: (String)
  • org_id: (String, nil) (defaults to: nil)
  • parent_resource_id: (resource_id, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
# File 'lib/infrawrench/client.rb', line 2450

def get(
  plugin_id:,
  type_id:,
  resource_id:,
  account_id:,
  org_id: nil,
  parent_resource_id: nil,
  request_options: nil
)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions",
    path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
    query: {
      "resourceId" => resource_id,
      "accountId" => ,
      "parentResourceId" => parent_resource_id
    },
    request_options: request_options
  )
end

#modify(plugin_id:, type_id:, body:, org_id: nil, request_options: nil) ⇒ Hash

Enable/disable/destroy a secret version

Requires permission: secrets:write.

POST /api/org/orgId/resources/pluginId/typeId/secret-versions/modify

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)
  • type_id (String)
  • body (Hash)

    Request body, shaped as SecretModifyRequest.

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

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

  • plugin_id: (plugin_id)
  • type_id: (resource_type_id)
  • body: (secret_modify_request)
  • org_id: (String, nil) (defaults to: nil)
  • request_options: (Hash[Symbol, untyped], nil) (defaults to: nil)

Returns:

  • (Hash)

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

Raises:



2491
2492
2493
2494
2495
2496
2497
2498
2499
# File 'lib/infrawrench/client.rb', line 2491

def modify(plugin_id:, type_id:, body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "POST",
    path: "/api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/modify",
    path_params: { "orgId" => org_id, "pluginId" => plugin_id, "typeId" => type_id },
    body: body,
    request_options: request_options
  )
end