Sha256: 5b7bd34eea92b29ece05c864eb9d1e3bc53a5d21efbe8b8f53224eb38f7a20eb

Contents?: true

Size: 940 Bytes

Versions: 7

Compression:

Stored size: 940 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::AuthNMappingRelationshipToRole.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

7 entries across 7 versions & 1 rubygems

Version Path
datadog_api_client-2.28.1 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.27.1 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.26.1 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.26.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.25.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.24.0 examples/v2/authn-mappings/CreateAuthNMapping.rb
datadog_api_client-2.22.0 examples/v2/authn-mappings/CreateAuthNMapping.rb