Sha256: f89dbf89816d20470b196e7b8d8c11fae1e66674f37b6af7bcc328003f3b8508

Contents?: true

Size: 997 Bytes

Versions: 2

Compression:

Stored size: 997 Bytes

Contents

# Create an AuthN Mapping returns "OK" response

require "datadog_api_client"
api_instance = DatadogAPIClient::V2::AuthNMappingsAPI.new

# there is a valid "role" in the system
ROLE_DATA_ID = ENV["ROLE_DATA_ID"]

body = DatadogAPIClient::V2::AuthNMappingCreateRequest.new({
  data: DatadogAPIClient::V2::AuthNMappingCreateData.new({
    attributes: DatadogAPIClient::V2::AuthNMappingCreateAttributes.new({
      attribute_key: "examplecreateanauthnmappingreturnsokresponse",
      attribute_value: "Example-Create_an_AuthN_Mapping_returns_OK_response",
    }),
    relationships: DatadogAPIClient::V2::AuthNMappingCreateRelationships.new({
      role: DatadogAPIClient::V2::RelationshipToRole.new({
        data: DatadogAPIClient::V2::RelationshipToRoleData.new({
          id: ROLE_DATA_ID,
          type: DatadogAPIClient::V2::RolesType::ROLES,
        }),
      }),
    }),
    type: DatadogAPIClient::V2::AuthNMappingsType::AUTHN_MAPPINGS,
  }),
})
p api_instance.create_auth_n_mapping(body)

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
datadog_api_client-1.8.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-1.7.0 examples/v2/authn-mappings/CreateAuthNMapping.rb