Sha256: 02f74069cef6f36f6b536f8e62309b8679fc805066b3e69e5537247a420911f2

Contents?: true

Size: 941 Bytes

Versions: 12

Compression:

Stored size: 941 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: "exampleauthnmapping",
      attribute_value: "Example-AuthN-Mapping",
    }),
    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_authn_mapping(body)

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
datadog_api_client-2.21.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.20.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.19.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.18.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.17.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.16.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.15.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.14.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.13.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.12.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.11.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.10.0 examples/v2/authn-mappings/CreateAuthNMapping.rb