Sha256: 9a50d86247bae4ddd6ae3a8cfb3f47f22af3a48b3ef2fe3d99e6f6fff48c4bdc

Contents?: true

Size: 1.05 KB

Versions: 27

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_authn_mapping(AUTHN_MAPPING_DATA_ID, body)

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
datadog_api_client-2.1.0 examples/v2/authn-mappings/UpdateAuthNMapping.rb
datadog_api_client-2.0.2 examples/v2/authn-mappings/UpdateAuthNMapping.rb
datadog_api_client-2.0.1 examples/v2/authn-mappings/UpdateAuthNMapping.rb
datadog_api_client-2.0.0 examples/v2/authn-mappings/UpdateAuthNMapping.rb
datadog_api_client-1.11.0 examples/v2/authn-mappings/UpdateAuthNMapping.rb
datadog_api_client-1.10.0 examples/v2/authn-mappings/UpdateAuthNMapping.rb
datadog_api_client-1.9.0 examples/v2/authn-mappings/UpdateAuthNMapping.rb