Class: Infrawrench::TagPolicyNamespace

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

Overview

client.tag_policy

Instance Method Summary collapse

Constructor Details

#initialize(transport) ⇒ TagPolicyNamespace

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

Parameters:



7373
7374
7375
# File 'lib/infrawrench/client.rb', line 7373

def initialize(transport)
  @transport = transport
end

Instance Method Details

#compliance(org_id: nil, request_options: nil) ⇒ Hash

Per-account tag compliance scores

For each account: how many of its resources expose tags and how many of those carry every required tag with an allowed value. score is over the evaluated (tag-capable) set so untaggable resource types don't drag it.

Requires permission: resources:read.

GET /api/org/orgId/tag-policy/compliance

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:

  • (Hash)

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

Raises:



7393
7394
7395
7396
7397
7398
7399
7400
# File 'lib/infrawrench/client.rb', line 7393

def compliance(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/tag-policy/compliance",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#get(org_id: nil, request_options: nil) ⇒ Hash

The org's required-tag policy

Requires permission: resources:read.

GET /api/org/orgId/tag-policy

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:

  • (Hash)

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

Raises:



7413
7414
7415
7416
7417
7418
7419
7420
# File 'lib/infrawrench/client.rb', line 7413

def get(org_id: nil, request_options: nil)
  @transport.request(
    http_method: "GET",
    path: "/api/org/{orgId}/tag-policy",
    path_params: { "orgId" => org_id },
    request_options: request_options
  )
end

#update(body:, org_id: nil, request_options: nil) ⇒ Hash

Replace the org's tag policy

Sets the required tag keys (each optionally restricted to allowed values) and whether resource creation is blocked when they are missing. Keys are matched case-insensitively against the generic tags/labels field convention.

Requires permission: org:settings:write.

PUT /api/org/orgId/tag-policy

Raises on 400: Bad request

Parameters:

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

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

  • body (Hash)

    Request body, shaped as TagPolicy.

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

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

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

Returns:

  • (Hash)

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

Raises:



7441
7442
7443
7444
7445
7446
7447
7448
7449
# File 'lib/infrawrench/client.rb', line 7441

def update(body:, org_id: nil, request_options: nil)
  @transport.request(
    http_method: "PUT",
    path: "/api/org/{orgId}/tag-policy",
    path_params: { "orgId" => org_id },
    body: body,
    request_options: request_options
  )
end