Sha256: 58724614e61766427295d6f685585817ef24fe76ba54f0b59c0d9e7b77320957

Contents?: true

Size: 1.05 KB

Versions: 2

Compression:

Stored size: 1.05 KB

Contents

# Edit an AuthN Mapping returns "OK" response

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

# there is a valid "authn_mapping" in the system
AUTHN_MAPPING_DATA_ID = ENV["AUTHN_MAPPING_DATA_ID"]

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

body = DatadogAPIClient::V2::AuthNMappingUpdateRequest.new({
  data: DatadogAPIClient::V2::AuthNMappingUpdateData.new({
    attributes: DatadogAPIClient::V2::AuthNMappingUpdateAttributes.new({
      attribute_key: "member-of",
      attribute_value: "Development",
    }),
    id: AUTHN_MAPPING_DATA_ID,
    relationships: DatadogAPIClient::V2::AuthNMappingUpdateRelationships.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.update_auth_n_mapping(AUTHN_MAPPING_DATA_ID, body)

Version data entries

2 entries across 2 versions & 1 rubygems

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