Sha256: 005a80e3b1983d02e32fd65e151ce6b729356b72fdfcf9ff72f7aba69bc882ed

Contents?: true

Size: 881 Bytes

Versions: 21

Compression:

Stored size: 881 Bytes

Contents

# Update a restriction policy returns "OK" response

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

# there is a valid "user" in the system
USER_DATA_RELATIONSHIPS_ORG_DATA_ID = ENV["USER_DATA_RELATIONSHIPS_ORG_DATA_ID"]

body = DatadogAPIClient::V2::RestrictionPolicyUpdateRequest.new({
  data: DatadogAPIClient::V2::RestrictionPolicy.new({
    id: "dashboard:test-update",
    type: DatadogAPIClient::V2::RestrictionPolicyType::RESTRICTION_POLICY,
    attributes: DatadogAPIClient::V2::RestrictionPolicyAttributes.new({
      bindings: [
        DatadogAPIClient::V2::RestrictionPolicyBinding.new({
          relation: "editor",
          principals: [
            "org:00000000-0000-beef-0000-000000000000",
          ],
        }),
      ],
    }),
  }),
})
p api_instance.update_restriction_policy("dashboard:test-update", body)

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
datadog_api_client-2.29.1 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.28.1 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.27.1 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.26.1 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.26.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.25.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.24.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.22.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.21.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.20.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.19.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.18.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.17.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.16.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.15.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.14.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.13.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.12.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.11.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb
datadog_api_client-2.10.0 examples/v2/restriction-policies/UpdateRestrictionPolicy.rb