Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 34 additions & 3 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1750,7 +1750,7 @@ components:
type: string
ResourceID:
description: |-
Identifier, formatted as `type:id`. Supported types: `dashboard`, `integration-service`, `integration-webhook`, `notebook`, `powerpack`, `reference-table`, `security-rule`, `slo`, `synthetics-global-variable`, `synthetics-test`, `synthetics-private-location`, `monitor`, `workflow`, `app-builder-app`, `connection`, `connection-group`, `rum-application`, `cross-org-connection`, `spreadsheet`, `on-call-schedule`, `on-call-escalation-policy`, `on-call-team-routing-rules`, `logs-pipeline`, `case-management-project`, `monitor-notification-rule`, `status-page`, `feature-flag`, `network-path-config`.
Identifier, formatted as `type:id`. Supported types: `ai-gateway-provider`, `dashboard`, `integration-service`, `integration-webhook`, `notebook`, `powerpack`, `reference-table`, `security-rule`, `slo`, `synthetics-global-variable`, `synthetics-test`, `synthetics-private-location`, `monitor`, `workflow`, `app-builder-app`, `connection`, `connection-group`, `rum-application`, `cross-org-connection`, `spreadsheet`, `on-call-schedule`, `on-call-escalation-policy`, `on-call-team-routing-rules`, `logs-pipeline`, `case-management-project`, `monitor-notification-rule`, `status-page`, `feature-flag`, `network-path-config`.
example: "dashboard:abc-def-ghi"
in: path
name: resource_id
Expand Down Expand Up @@ -83346,6 +83346,8 @@ components:
$ref: "#/components/schemas/MonitorNotificationRuleName"
recipients:
$ref: "#/components/schemas/MonitorNotificationRuleRecipients"
rule_options:
$ref: "#/components/schemas/MonitorNotificationRuleOptions"
required: [name]
type: object
MonitorNotificationRuleBundleConfig:
Expand Down Expand Up @@ -83486,6 +83488,17 @@ components:
maxLength: 1000
minLength: 1
type: string
MonitorNotificationRuleOptions:
description: Additional options for the monitor notification rule.
properties:
is_threaded:
description: |-
Whether notifications from this rule are threaded. When `true`, follow-up notifications for the same monitor alert are posted in Slack as replies to the first notification.
Cannot be `true` when `bundle_config` is set.
example: true
type: boolean
required: [is_threaded]
type: object
MonitorNotificationRuleRecipients:
description: |-
A list of recipients to notify. Uses the same format as the monitor `message` field. Must not start with an '@'. Cannot be used with `conditional_recipients`.
Expand Down Expand Up @@ -83563,6 +83576,8 @@ components:
$ref: "#/components/schemas/MonitorNotificationRuleName"
recipients:
$ref: "#/components/schemas/MonitorNotificationRuleRecipients"
rule_options:
$ref: "#/components/schemas/MonitorNotificationRuleOptions"
type: object
MonitorNotificationRuleResponseIncludedItem:
description: An object related to a monitor notification rule.
Expand Down Expand Up @@ -220788,7 +220803,10 @@ paths:
x-codegen-request-body-name: body
/api/v2/restriction_policy/{resource_id}:
delete:
description: Deletes the restriction policy associated with a specified resource.
description: |-
Deletes the restriction policy associated with a specified resource.
For AI Gateway providers, requires `ai_gateway_config_write` and provider Edit.
Deleting a provider policy restores normal unrestricted defaults.
operationId: DeleteRestrictionPolicy
parameters:
- $ref: "#/components/parameters/ResourceID"
Expand All @@ -220812,7 +220830,9 @@ paths:
operator: OPEN
permissions: []
get:
description: Retrieves the restriction policy associated with a specified resource.
description: |-
Retrieves the restriction policy associated with a specified resource.
For AI Gateway providers, requires `ai_gateway_config_read` and provider View. Hidden providers return 404.
operationId: GetRestrictionPolicy
parameters:
- $ref: "#/components/parameters/ResourceID"
Expand All @@ -220838,6 +220858,8 @@ paths:
$ref: "#/components/responses/BadRequestResponse"
"403":
$ref: "#/components/responses/NotAuthorizedResponse"
"404":
$ref: "#/components/responses/NotFoundResponse"
"429":
$ref: "#/components/responses/TooManyRequestsResponse"
security:
Expand All @@ -220856,6 +220878,7 @@ paths:

#### Supported resources
Restriction policies can be applied to the following resources:
- AI Gateway Providers: `ai-gateway-provider`
- Dashboards: `dashboard`
- Integration Services: `integration-service`
- Integration Webhooks: `integration-webhook`
Expand Down Expand Up @@ -220885,9 +220908,17 @@ paths:
- Feature Flags: `feature-flag`
- Network Path Configs: `network-path-config`

AI Gateway provider policies control configuration and inherited model/catalog/pricing visibility.
The editor relation includes View. Providers have no Run relation; restriction policies don't affect inference.
Reading requires `ai_gateway_config_read` and provider View. Updating or deleting requires
`ai_gateway_config_write` and provider Edit.
Providers without a restriction policy retain the normal unrestricted defaults. Administrator status
alone does not bypass provider restrictions.

#### Supported relations for resources
Resource Type | Supported Relations
----------------------------|--------------------------
AI Gateway Providers | `viewer`, `editor`
Dashboards | `viewer`, `editor`
Integration Services | `viewer`, `editor`
Integration Webhooks | `viewer`, `editor`
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
// Create a monitor notification rule with rule options returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.MonitorsApi;
import com.datadog.api.client.v2.model.MonitorNotificationRuleAttributes;
import com.datadog.api.client.v2.model.MonitorNotificationRuleCreateRequest;
import com.datadog.api.client.v2.model.MonitorNotificationRuleCreateRequestData;
import com.datadog.api.client.v2.model.MonitorNotificationRuleFilter;
import com.datadog.api.client.v2.model.MonitorNotificationRuleFilterTags;
import com.datadog.api.client.v2.model.MonitorNotificationRuleOptions;
import com.datadog.api.client.v2.model.MonitorNotificationRuleResourceType;
import com.datadog.api.client.v2.model.MonitorNotificationRuleResponse;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
MonitorsApi apiInstance = new MonitorsApi(defaultClient);

MonitorNotificationRuleCreateRequest body =
new MonitorNotificationRuleCreateRequest()
.data(
new MonitorNotificationRuleCreateRequestData()
.attributes(
new MonitorNotificationRuleAttributes()
.filter(
new MonitorNotificationRuleFilter(
new MonitorNotificationRuleFilterTags()
.tags(Collections.singletonList("test:example-monitor"))))
.name("test rule")
.recipients(Collections.singletonList("slack-test-channel"))
.ruleOptions(new MonitorNotificationRuleOptions().isThreaded(true)))
.type(MonitorNotificationRuleResourceType.MONITOR_NOTIFICATION_RULE));

try {
MonitorNotificationRuleResponse result = apiInstance.createMonitorNotificationRule(body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MonitorsApi#createMonitorNotificationRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
// Update a monitor notification rule with rule options returns "OK" response

import com.datadog.api.client.ApiClient;
import com.datadog.api.client.ApiException;
import com.datadog.api.client.v2.api.MonitorsApi;
import com.datadog.api.client.v2.model.MonitorNotificationRuleAttributes;
import com.datadog.api.client.v2.model.MonitorNotificationRuleFilter;
import com.datadog.api.client.v2.model.MonitorNotificationRuleFilterTags;
import com.datadog.api.client.v2.model.MonitorNotificationRuleOptions;
import com.datadog.api.client.v2.model.MonitorNotificationRuleResourceType;
import com.datadog.api.client.v2.model.MonitorNotificationRuleResponse;
import com.datadog.api.client.v2.model.MonitorNotificationRuleUpdateRequest;
import com.datadog.api.client.v2.model.MonitorNotificationRuleUpdateRequestData;
import java.util.Collections;

public class Example {
public static void main(String[] args) {
ApiClient defaultClient = ApiClient.getDefaultApiClient();
defaultClient.setAccessToken(System.getenv("DD_BEARER_TOKEN"));
MonitorsApi apiInstance = new MonitorsApi(defaultClient);

// there is a valid "monitor_notification_rule" in the system
String MONITOR_NOTIFICATION_RULE_DATA_ID = System.getenv("MONITOR_NOTIFICATION_RULE_DATA_ID");

MonitorNotificationRuleUpdateRequest body =
new MonitorNotificationRuleUpdateRequest()
.data(
new MonitorNotificationRuleUpdateRequestData()
.attributes(
new MonitorNotificationRuleAttributes()
.filter(
new MonitorNotificationRuleFilter(
new MonitorNotificationRuleFilterTags()
.tags(Collections.singletonList("test:example-monitor"))))
.name("updated rule")
.recipients(Collections.singletonList("slack-test-channel"))
.ruleOptions(new MonitorNotificationRuleOptions().isThreaded(false)))
.id(MONITOR_NOTIFICATION_RULE_DATA_ID)
.type(MonitorNotificationRuleResourceType.MONITOR_NOTIFICATION_RULE));

try {
MonitorNotificationRuleResponse result =
apiInstance.updateMonitorNotificationRule(MONITOR_NOTIFICATION_RULE_DATA_ID, body);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling MonitorsApi#updateMonitorNotificationRule");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
Loading
Loading