diff --git a/.generator/schemas/v2/openapi.yaml b/.generator/schemas/v2/openapi.yaml index 1798ff51a84..1523c21d0f4 100644 --- a/.generator/schemas/v2/openapi.yaml +++ b/.generator/schemas/v2/openapi.yaml @@ -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 @@ -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: @@ -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`. @@ -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. @@ -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" @@ -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" @@ -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: @@ -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` @@ -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` diff --git a/examples/v2/monitors/CreateMonitorNotificationRule_292428701.java b/examples/v2/monitors/CreateMonitorNotificationRule_292428701.java new file mode 100644 index 00000000000..f5569078595 --- /dev/null +++ b/examples/v2/monitors/CreateMonitorNotificationRule_292428701.java @@ -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(); + } + } +} diff --git a/examples/v2/monitors/UpdateMonitorNotificationRule_365435820.java b/examples/v2/monitors/UpdateMonitorNotificationRule_365435820.java new file mode 100644 index 00000000000..e2dbd42acb5 --- /dev/null +++ b/examples/v2/monitors/UpdateMonitorNotificationRule_365435820.java @@ -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(); + } + } +} diff --git a/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java b/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java index c76491c777b..a90eae63da0 100644 --- a/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java +++ b/src/main/java/com/datadog/api/client/v2/api/RestrictionPoliciesApi.java @@ -51,14 +51,15 @@ public void setApiClient(ApiClient apiClient) { *

See {@link #deleteRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @throws ApiException if fails to make API call @@ -73,14 +74,15 @@ public void deleteRestrictionPolicy(String resourceId) throws ApiException { *

See {@link #deleteRestrictionPolicyWithHttpInfoAsync}. * * @param resourceId 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, + * 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. (required) * @return CompletableFuture @@ -94,17 +96,20 @@ public CompletableFuture deleteRestrictionPolicyAsync(String resourceId) { } /** - * Deletes the restriction policy associated with a specified resource. + * 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. * * @param resourceId 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, + * 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. (required) * @return ApiResponse<Void> @@ -162,14 +167,15 @@ public ApiResponse deleteRestrictionPolicyWithHttpInfo(String resourceId) *

See {@link #deleteRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @return CompletableFuture<ApiResponse<Void>> @@ -228,14 +234,15 @@ public CompletableFuture> deleteRestrictionPolicyWithHttpInfoA *

See {@link #getRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @return RestrictionPolicyResponse @@ -251,14 +258,15 @@ public RestrictionPolicyResponse getRestrictionPolicy(String resourceId) throws *

See {@link #getRestrictionPolicyWithHttpInfoAsync}. * * @param resourceId 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, + * 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. (required) * @return CompletableFuture<RestrictionPolicyResponse> @@ -272,17 +280,20 @@ public CompletableFuture getRestrictionPolicyAsync(St } /** - * Retrieves the restriction policy associated with a specified resource. + * 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. * * @param resourceId 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, + * 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. (required) * @return ApiResponse<RestrictionPolicyResponse> @@ -294,6 +305,7 @@ public CompletableFuture getRestrictionPolicyAsync(St * 200 OK - * 400 Bad Request - * 403 Not Authorized - + * 404 Not Found - * 429 Too many requests - * */ @@ -340,14 +352,15 @@ public ApiResponse getRestrictionPolicyWithHttpInfo(S *

See {@link #getRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @return CompletableFuture<ApiResponse<RestrictionPolicyResponse>> @@ -425,14 +438,15 @@ public UpdateRestrictionPolicyOptionalParameters allowSelfLockout(Boolean allowS *

See {@link #updateRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @param body Restriction policy payload (required) @@ -452,14 +466,15 @@ resourceId, body, new UpdateRestrictionPolicyOptionalParameters()) *

See {@link #updateRestrictionPolicyWithHttpInfoAsync}. * * @param resourceId 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, + * 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. (required) * @param body Restriction policy payload (required) @@ -481,14 +496,15 @@ resourceId, body, new UpdateRestrictionPolicyOptionalParameters()) *

See {@link #updateRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @param body Restriction policy payload (required) @@ -510,14 +526,15 @@ public RestrictionPolicyResponse updateRestrictionPolicy( *

See {@link #updateRestrictionPolicyWithHttpInfoAsync}. * * @param resourceId 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, + * 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. (required) * @param body Restriction policy payload (required) @@ -540,58 +557,67 @@ public CompletableFuture updateRestrictionPolicyAsync * *

Supported resources

* - *

Restriction policies can be applied to the following resources: - Dashboards: - * dashboard - Integration Services: integration-service - Integration - * Webhooks: integration-webhook - Notebooks: notebook - Powerpacks: - * powerpack - Reference Tables: reference-table - Security Rules: - * security-rule - Service Level Objectives: slo - Synthetic Global - * Variables: synthetics-global-variable - Synthetic Tests: synthetics-test - * - Synthetic Private Locations: synthetics-private-location - Monitors: - * monitor - Workflows: workflow - App Builder Apps: - * app-builder-app - Connections: connection - Connection Groups: - * connection-group - RUM Applications: rum-application - Cross Org - * Connections: cross-org-connection - Spreadsheets: spreadsheet - - * On-Call Schedules: on-call-schedule - On-Call Escalation Policies: - * on-call-escalation-policy - On-Call Team Routing Rules: on-call-team-routing-rules - * - Logs Pipelines: logs-pipeline - Case Management Projects: - * case-management-project - Monitor Notification Rules: monitor-notification-rule - * - Status Pages: status-page - Feature Flags: feature-flag - - * Network Path Configs: network-path-config + *

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 - + * Notebooks: notebook - Powerpacks: powerpack - Reference Tables: + * reference-table - Security Rules: security-rule - Service Level + * Objectives: slo - Synthetic Global Variables: synthetics-global-variable + * - Synthetic Tests: synthetics-test - Synthetic Private Locations: + * synthetics-private-location - Monitors: monitor - Workflows: workflow + * - App Builder Apps: app-builder-app - Connections: connection + * - Connection Groups: connection-group - RUM Applications: rum-application + * - Cross Org Connections: cross-org-connection - Spreadsheets: + * spreadsheet - On-Call Schedules: on-call-schedule - On-Call Escalation + * Policies: on-call-escalation-policy - On-Call Team Routing Rules: + * on-call-team-routing-rules - Logs Pipelines: logs-pipeline - Case + * Management Projects: case-management-project - Monitor Notification Rules: + * monitor-notification-rule - Status Pages: status-page - 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 ----------------------------|-------------------------- - * Dashboards | viewer, editor Integration Services | viewer - * , editor Integration Webhooks | viewer, editor - * Notebooks | viewer, editor Powerpacks | viewer, - * editor Security Rules | viewer, editor Service Level - * Objectives | viewer, editor Synthetic Global Variables | viewer - * , editor Synthetic Tests | viewer, editor - * Synthetic Private Locations | viewer, editor Monitors | viewer - * , editor Reference Tables | viewer, editor - * Workflows | viewer, runner, editor App Builder Apps | - * viewer, editor Connections | viewer, resolver - * , editor Connection Groups | viewer, editor RUM - * Application | viewer, editor Cross Org Connections | viewer - * , editor Spreadsheets | viewer, editor On-Call - * Schedules | viewer, overrider, editor On-Call Escalation - * Policies | viewer, editor On-Call Team Routing Rules | viewer - * , editor Logs Pipelines | viewer, processors_editor - * , editor Case Management Projects | viewer, contributor - * , manager Monitor Notification Rules | viewer, editor - * Status Pages | viewer, responder, manager - * Feature Flags | viewer, contributor, editor Network Path - * Configs | viewer, editor + * AI Gateway Providers | viewer, editor Dashboards | viewer + * , editor Integration Services | viewer, editor + * Integration Webhooks | viewer, editor Notebooks | viewer + * , editor Powerpacks | viewer, editor Security Rules | + * viewer, editor Service Level Objectives | viewer, + * editor Synthetic Global Variables | viewer, editor Synthetic + * Tests | viewer, editor Synthetic Private Locations | viewer + * , editor Monitors | viewer, editor Reference + * Tables | viewer, editor Workflows | viewer, runner + * , editor App Builder Apps | viewer, editor + * Connections | viewer, resolver, editor Connection Groups + * | viewer, editor RUM Application | viewer, editor + * Cross Org Connections | viewer, editor Spreadsheets | + * viewer, editor On-Call Schedules | viewer, overrider + * , editor On-Call Escalation Policies | viewer, editor + * On-Call Team Routing Rules | viewer, editor Logs Pipelines | + * viewer, processors_editor, editor Case Management + * Projects | viewer, contributor, manager Monitor + * Notification Rules | viewer, editor Status Pages | viewer + * , responder, manager Feature Flags | viewer, + * contributor, editor Network Path Configs | viewer, + * editor * * @param resourceId 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, + * 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. (required) * @param body Restriction policy payload (required) @@ -665,14 +691,15 @@ public ApiResponse updateRestrictionPolicyWithHttpInf *

See {@link #updateRestrictionPolicyWithHttpInfo}. * * @param resourceId 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, + * 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. (required) * @param body Restriction policy payload (required) diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleAttributes.java index cafd40ebb1e..7072b15e482 100644 --- a/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleAttributes.java @@ -21,7 +21,8 @@ MonitorNotificationRuleAttributes.JSON_PROPERTY_CONDITIONAL_RECIPIENTS, MonitorNotificationRuleAttributes.JSON_PROPERTY_FILTER, MonitorNotificationRuleAttributes.JSON_PROPERTY_NAME, - MonitorNotificationRuleAttributes.JSON_PROPERTY_RECIPIENTS + MonitorNotificationRuleAttributes.JSON_PROPERTY_RECIPIENTS, + MonitorNotificationRuleAttributes.JSON_PROPERTY_RULE_OPTIONS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -42,6 +43,9 @@ public class MonitorNotificationRuleAttributes { public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; private List recipients = null; + public static final String JSON_PROPERTY_RULE_OPTIONS = "rule_options"; + private MonitorNotificationRuleOptions ruleOptions; + public MonitorNotificationRuleAttributes() {} @JsonCreator @@ -181,6 +185,31 @@ public void setRecipients(List recipients) { this.recipients = recipients; } + public MonitorNotificationRuleAttributes ruleOptions(MonitorNotificationRuleOptions ruleOptions) { + this.ruleOptions = ruleOptions; + this.unparsed |= ruleOptions.unparsed; + return this; + } + + /** + * Additional options for the monitor notification rule. + * + * @return ruleOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MonitorNotificationRuleOptions getRuleOptions() { + return ruleOptions; + } + + public void setRuleOptions(MonitorNotificationRuleOptions ruleOptions) { + this.ruleOptions = ruleOptions; + if (ruleOptions != null) { + this.unparsed |= ruleOptions.unparsed; + } + } + /** Return true if this MonitorNotificationRuleAttributes object is equal to o. */ @Override public boolean equals(Object o) { @@ -197,12 +226,13 @@ public boolean equals(Object o) { this.conditionalRecipients, monitorNotificationRuleAttributes.conditionalRecipients) && Objects.equals(this.filter, monitorNotificationRuleAttributes.filter) && Objects.equals(this.name, monitorNotificationRuleAttributes.name) - && Objects.equals(this.recipients, monitorNotificationRuleAttributes.recipients); + && Objects.equals(this.recipients, monitorNotificationRuleAttributes.recipients) + && Objects.equals(this.ruleOptions, monitorNotificationRuleAttributes.ruleOptions); } @Override public int hashCode() { - return Objects.hash(bundleConfig, conditionalRecipients, filter, name, recipients); + return Objects.hash(bundleConfig, conditionalRecipients, filter, name, recipients, ruleOptions); } @Override @@ -216,6 +246,7 @@ public String toString() { sb.append(" filter: ").append(toIndentedString(filter)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" ruleOptions: ").append(toIndentedString(ruleOptions)).append("\n"); sb.append('}'); return sb.toString(); } diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleOptions.java b/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleOptions.java new file mode 100644 index 00000000000..dccec088fc2 --- /dev/null +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleOptions.java @@ -0,0 +1,147 @@ +/* + * Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License. + * This product includes software developed at Datadog (https://www.datadoghq.com/). + * Copyright 2019-Present Datadog, Inc. + */ + +package com.datadog.api.client.v2.model; + +import com.fasterxml.jackson.annotation.JsonAnyGetter; +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; + +/** Additional options for the monitor notification rule. */ +@JsonPropertyOrder({MonitorNotificationRuleOptions.JSON_PROPERTY_IS_THREADED}) +@jakarta.annotation.Generated( + value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") +public class MonitorNotificationRuleOptions { + @JsonIgnore public boolean unparsed = false; + public static final String JSON_PROPERTY_IS_THREADED = "is_threaded"; + private Boolean isThreaded; + + public MonitorNotificationRuleOptions() {} + + @JsonCreator + public MonitorNotificationRuleOptions( + @JsonProperty(required = true, value = JSON_PROPERTY_IS_THREADED) Boolean isThreaded) { + this.isThreaded = isThreaded; + } + + public MonitorNotificationRuleOptions isThreaded(Boolean isThreaded) { + this.isThreaded = isThreaded; + return this; + } + + /** + * 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. + * + * @return isThreaded + */ + @JsonProperty(JSON_PROPERTY_IS_THREADED) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public Boolean getIsThreaded() { + return isThreaded; + } + + public void setIsThreaded(Boolean isThreaded) { + this.isThreaded = isThreaded; + } + + /** + * A container for additional, undeclared properties. This is a holder for any undeclared + * properties as specified with the 'additionalProperties' keyword in the OAS document. + */ + private Map additionalProperties; + + /** + * Set the additional (undeclared) property with the specified name and value. If the property + * does not already exist, create it otherwise replace it. + * + * @param key The arbitrary key to set + * @param value The associated value + * @return MonitorNotificationRuleOptions + */ + @JsonAnySetter + public MonitorNotificationRuleOptions putAdditionalProperty(String key, Object value) { + if (this.additionalProperties == null) { + this.additionalProperties = new HashMap(); + } + this.additionalProperties.put(key, value); + return this; + } + + /** + * Return the additional (undeclared) property. + * + * @return The additional properties + */ + @JsonAnyGetter + public Map getAdditionalProperties() { + return additionalProperties; + } + + /** + * Return the additional (undeclared) property with the specified name. + * + * @param key The arbitrary key to get + * @return The specific additional property for the given key + */ + public Object getAdditionalProperty(String key) { + if (this.additionalProperties == null) { + return null; + } + return this.additionalProperties.get(key); + } + + /** Return true if this MonitorNotificationRuleOptions object is equal to o. */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + MonitorNotificationRuleOptions monitorNotificationRuleOptions = + (MonitorNotificationRuleOptions) o; + return Objects.equals(this.isThreaded, monitorNotificationRuleOptions.isThreaded) + && Objects.equals( + this.additionalProperties, monitorNotificationRuleOptions.additionalProperties); + } + + @Override + public int hashCode() { + return Objects.hash(isThreaded, additionalProperties); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class MonitorNotificationRuleOptions {\n"); + sb.append(" isThreaded: ").append(toIndentedString(isThreaded)).append("\n"); + sb.append(" additionalProperties: ") + .append(toIndentedString(additionalProperties)) + .append("\n"); + sb.append('}'); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } +} diff --git a/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleResponseAttributes.java b/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleResponseAttributes.java index 395dd51142e..a7964c77754 100644 --- a/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleResponseAttributes.java +++ b/src/main/java/com/datadog/api/client/v2/model/MonitorNotificationRuleResponseAttributes.java @@ -27,7 +27,8 @@ MonitorNotificationRuleResponseAttributes.JSON_PROPERTY_FILTER, MonitorNotificationRuleResponseAttributes.JSON_PROPERTY_MODIFIED, MonitorNotificationRuleResponseAttributes.JSON_PROPERTY_NAME, - MonitorNotificationRuleResponseAttributes.JSON_PROPERTY_RECIPIENTS + MonitorNotificationRuleResponseAttributes.JSON_PROPERTY_RECIPIENTS, + MonitorNotificationRuleResponseAttributes.JSON_PROPERTY_RULE_OPTIONS }) @jakarta.annotation.Generated( value = "https://github.com/DataDog/datadog-api-client-java/blob/master/.generator") @@ -54,6 +55,9 @@ public class MonitorNotificationRuleResponseAttributes { public static final String JSON_PROPERTY_RECIPIENTS = "recipients"; private List recipients = null; + public static final String JSON_PROPERTY_RULE_OPTIONS = "rule_options"; + private MonitorNotificationRuleOptions ruleOptions; + public MonitorNotificationRuleResponseAttributes bundleConfig( MonitorNotificationRuleBundleConfig bundleConfig) { this.bundleConfig = bundleConfig; @@ -228,6 +232,32 @@ public void setRecipients(List recipients) { this.recipients = recipients; } + public MonitorNotificationRuleResponseAttributes ruleOptions( + MonitorNotificationRuleOptions ruleOptions) { + this.ruleOptions = ruleOptions; + this.unparsed |= ruleOptions.unparsed; + return this; + } + + /** + * Additional options for the monitor notification rule. + * + * @return ruleOptions + */ + @jakarta.annotation.Nullable + @JsonProperty(JSON_PROPERTY_RULE_OPTIONS) + @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) + public MonitorNotificationRuleOptions getRuleOptions() { + return ruleOptions; + } + + public void setRuleOptions(MonitorNotificationRuleOptions ruleOptions) { + this.ruleOptions = ruleOptions; + if (ruleOptions != null) { + this.unparsed |= ruleOptions.unparsed; + } + } + /** * A container for additional, undeclared properties. This is a holder for any undeclared * properties as specified with the 'additionalProperties' keyword in the OAS document. @@ -294,6 +324,7 @@ public boolean equals(Object o) { && Objects.equals(this.modified, monitorNotificationRuleResponseAttributes.modified) && Objects.equals(this.name, monitorNotificationRuleResponseAttributes.name) && Objects.equals(this.recipients, monitorNotificationRuleResponseAttributes.recipients) + && Objects.equals(this.ruleOptions, monitorNotificationRuleResponseAttributes.ruleOptions) && Objects.equals( this.additionalProperties, monitorNotificationRuleResponseAttributes.additionalProperties); @@ -309,6 +340,7 @@ public int hashCode() { modified, name, recipients, + ruleOptions, additionalProperties); } @@ -325,6 +357,7 @@ public String toString() { sb.append(" modified: ").append(toIndentedString(modified)).append("\n"); sb.append(" name: ").append(toIndentedString(name)).append("\n"); sb.append(" recipients: ").append(toIndentedString(recipients)).append("\n"); + sb.append(" ruleOptions: ").append(toIndentedString(ruleOptions)).append("\n"); sb.append(" additionalProperties: ") .append(toIndentedString(additionalProperties)) .append("\n"); diff --git a/src/test/resources/com/datadog/api/client/v2/api/monitors.feature b/src/test/resources/com/datadog/api/client/v2/api/monitors.feature index adda06d2e6c..6ecbfc44e28 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/monitors.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/monitors.feature @@ -70,6 +70,15 @@ Feature: Monitors Then the response status is 200 OK And the response "data.attributes.name" is equal to "test rule" + @team:ddoghq/monitor-app + Scenario: Create a monitor notification rule with rule options returns "OK" response + Given new "CreateMonitorNotificationRule" request + And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}"]}, "name": "test rule", "recipients": ["slack-test-channel"], "rule_options": {"is_threaded": true}}, "type": "monitor-notification-rule"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "test rule" + And the response "data.attributes.rule_options.is_threaded" is equal to true + @team:ddoghq/monitor-app Scenario: Create a monitor notification rule with scope returns "OK" response Given new "CreateMonitorNotificationRule" request @@ -311,6 +320,17 @@ Feature: Monitors Then the response status is 200 OK And the response "data.attributes.name" is equal to "updated rule" + @team:ddoghq/monitor-app + Scenario: Update a monitor notification rule with rule options returns "OK" response + Given there is a valid "monitor_notification_rule" in the system + And new "UpdateMonitorNotificationRule" request + And request contains "rule_id" parameter from "monitor_notification_rule.data.id" + And body with value {"data": {"attributes": {"filter": {"tags": ["test:{{ unique_lower }}"]}, "name": "updated rule", "recipients": ["slack-test-channel"], "rule_options": {"is_threaded": false}}, "id": "{{ monitor_notification_rule.data.id }}", "type": "monitor-notification-rule"}} + When the request is sent + Then the response status is 200 OK + And the response "data.attributes.name" is equal to "updated rule" + And the response "data.attributes.rule_options.is_threaded" is equal to false + @team:ddoghq/monitor-app Scenario: Update a monitor notification rule with scope returns "OK" response Given there is a valid "monitor_notification_rule" in the system diff --git a/src/test/resources/com/datadog/api/client/v2/api/restriction_policies.feature b/src/test/resources/com/datadog/api/client/v2/api/restriction_policies.feature index f741650c94c..05d12e64ad7 100644 --- a/src/test/resources/com/datadog/api/client/v2/api/restriction_policies.feature +++ b/src/test/resources/com/datadog/api/client/v2/api/restriction_policies.feature @@ -31,6 +31,13 @@ Feature: Restriction Policies When the request is sent Then the response status is 400 Bad Request + @generated @skip @team:ddoghq/access-policies-lifecycle + Scenario: Get a restriction policy returns "Not Found" response + Given new "GetRestrictionPolicy" request + And request contains "resource_id" parameter from "REPLACE.ME" + When the request is sent + Then the response status is 404 Not Found + @team:ddoghq/access-policies-lifecycle Scenario: Get a restriction policy returns "OK" response Given new "GetRestrictionPolicy" request diff --git a/src/test/resources/generated-test/test-runner-data/manifest.json b/src/test/resources/generated-test/test-runner-data/manifest.json index 23331f0a6c0..36bf0f07344 100644 --- a/src/test/resources/generated-test/test-runner-data/manifest.json +++ b/src/test/resources/generated-test/test-runner-data/manifest.json @@ -8414,6 +8414,13 @@ "scenario": "Create a monitor notification rule with conditional recipients returns \"OK\" response", "version": "v2" }, + { + "feature": "Monitors", + "feature_file": "../../com/datadog/api/client/v2/api/monitors.feature", + "file": "v2/monitors/create-a-monitor-notification-rule-with-rule-options-returns-ok-response.json", + "scenario": "Create a monitor notification rule with rule options returns \"OK\" response", + "version": "v2" + }, { "feature": "Monitors", "feature_file": "../../com/datadog/api/client/v2/api/monitors.feature", @@ -8596,6 +8603,13 @@ "scenario": "Update a monitor notification rule with conditional_recipients returns \"OK\" response", "version": "v2" }, + { + "feature": "Monitors", + "feature_file": "../../com/datadog/api/client/v2/api/monitors.feature", + "file": "v2/monitors/update-a-monitor-notification-rule-with-rule-options-returns-ok-response.json", + "scenario": "Update a monitor notification rule with rule options returns \"OK\" response", + "version": "v2" + }, { "feature": "Monitors", "feature_file": "../../com/datadog/api/client/v2/api/monitors.feature", diff --git a/src/test/resources/generated-test/test-runner-data/v2/monitors/create-a-monitor-notification-rule-with-rule-options-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/monitors/create-a-monitor-notification-rule-with-rule-options-returns-ok-response.json new file mode 100644 index 00000000000..00dcd8c847e --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/monitors/create-a-monitor-notification-rule-with-rule-options-returns-ok-response.json @@ -0,0 +1,44 @@ +{ + "api": "Monitors", + "expected_status": 200, + "feature": "Monitors", + "id": "v2/Monitors/Create a monitor notification rule with rule options returns \"OK\" response", + "operation_id": "CreateMonitorNotificationRule", + "request": { + "body": { + "schema": { + "format": null, + "ref": "MonitorNotificationRuleCreateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "filter": { + "tags": [ + "test:{{ unique_lower }}" + ] + }, + "name": "test rule", + "recipients": [ + "slack-test-channel" + ], + "rule_options": { + "is_threaded": true + } + }, + "type": "monitor-notification-rule" + } + } + }, + "content_type": "application/json", + "method": "POST", + "pagination": false, + "parameters": [], + "path": "/api/v2/monitor/notification_rule" + }, + "scenario": "Create a monitor notification rule with rule options returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-runner-data/v2/monitors/update-a-monitor-notification-rule-with-rule-options-returns-ok-response.json b/src/test/resources/generated-test/test-runner-data/v2/monitors/update-a-monitor-notification-rule-with-rule-options-returns-ok-response.json new file mode 100644 index 00000000000..7a98cd0b530 --- /dev/null +++ b/src/test/resources/generated-test/test-runner-data/v2/monitors/update-a-monitor-notification-rule-with-rule-options-returns-ok-response.json @@ -0,0 +1,62 @@ +{ + "api": "Monitors", + "expected_status": 200, + "feature": "Monitors", + "id": "v2/Monitors/Update a monitor notification rule with rule options returns \"OK\" response", + "operation_id": "UpdateMonitorNotificationRule", + "request": { + "body": { + "schema": { + "format": null, + "ref": "MonitorNotificationRuleUpdateRequest", + "type": "object" + }, + "source": "inline", + "value": { + "data": { + "attributes": { + "filter": { + "tags": [ + "test:{{ unique_lower }}" + ] + }, + "name": "updated rule", + "recipients": [ + "slack-test-channel" + ], + "rule_options": { + "is_threaded": false + } + }, + "id": "{{ monitor_notification_rule.data.id }}", + "type": "monitor-notification-rule" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "pagination": false, + "parameters": [ + { + "explode": null, + "in": "path", + "name": "rule_id", + "required": true, + "schema": { + "format": null, + "ref": null, + "type": "string" + }, + "source": { + "path": "monitor_notification_rule.data.id", + "type": "fixture" + }, + "style": null + } + ], + "path": "/api/v2/monitor/notification_rule/{rule_id}" + }, + "scenario": "Update a monitor notification rule with rule options returns \"OK\" response", + "schema_version": 1, + "version": "v2" +} diff --git a/src/test/resources/generated-test/test-server-data/v2/monitors.json b/src/test/resources/generated-test/test-server-data/v2/monitors.json index bec7dd9efd2..1f459341830 100644 --- a/src/test/resources/generated-test/test-server-data/v2/monitors.json +++ b/src/test/resources/generated-test/test-server-data/v2/monitors.json @@ -447,6 +447,78 @@ "scenario": "Create a monitor notification rule with conditional recipients returns \"OK\" response", "version": "v2" }, + { + "feature": "Monitors", + "frozen_at": "2026-10-30T20:36:08.126Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "filter": { + "tags": [ + "test:test-create_a_monitor_notification_rule_with_rule_options_returns_ok_response-1793392568" + ] + }, + "name": "test rule", + "recipients": [ + "slack-test-channel" + ], + "rule_options": { + "is_threaded": true + } + }, + "type": "monitor-notification-rule" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/monitor/notification_rule", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"740e35fe-ba09-4bd7-981b-df1197331db5\",\"attributes\":{\"name\":\"test rule\",\"created_at\":\"2026-10-30T20:36:08.241525+00:00\",\"modified_at\":\"2026-10-30T20:36:08.260322+00:00\",\"filter\":{\"tags\":[\"test:test-create_a_monitor_notification_rule_with_rule_options_returns_ok_response-1793392568\"]},\"recipients\":[\"slack-test-channel\"],\"rule_options\":{\"is_threaded\":true}},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\",\"attributes\":{\"uuid\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\",\"name\":\"Shane Yuan\",\"handle\":\"shane.yuan@datadoghq.com\",\"created_at\":\"2026-10-30T20:27:13.026594+00:00\",\"modified_at\":\"2026-10-30T20:27:25.236531+00:00\",\"email\":\"shane.yuan@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/188fa6df65bb6c77c82677908094fbdb?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null}}]}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/monitor/notification_rule/740e35fe-ba09-4bd7-981b-df1197331db5", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": { + "content-type": "text/html; charset=utf-8" + }, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Create a monitor notification rule with rule options returns \"OK\" response", + "version": "v2" + }, { "feature": "Monitors", "frozen_at": "2025-11-11T21:28:39.129Z", @@ -2388,6 +2460,117 @@ "scenario": "Update a monitor notification rule with conditional_recipients returns \"OK\" response", "version": "v2" }, + { + "feature": "Monitors", + "frozen_at": "2026-10-30T20:36:32.533Z", + "interactions": [ + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "filter": { + "tags": [ + "app:test-update_a_monitor_notification_rule_with_rule_options_returns_ok_response-1793392592" + ] + }, + "name": "test rule", + "recipients": [ + "slack-monitor-app" + ] + }, + "type": "monitor-notification-rule" + } + } + }, + "content_type": "application/json", + "method": "POST", + "path": "/api/v2/monitor/notification_rule", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"586901e2-3384-4a4e-89c3-b7ba7906bcc0\",\"attributes\":{\"name\":\"test rule\",\"created_at\":\"2026-10-30T20:36:32.665098+00:00\",\"modified_at\":\"2026-10-30T20:36:32.679819+00:00\",\"filter\":{\"tags\":[\"app:test-update_a_monitor_notification_rule_with_rule_options_returns_ok_response-1793392592\"]},\"recipients\":[\"slack-monitor-app\"]},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\",\"attributes\":{\"uuid\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\",\"name\":\"Shane Yuan\",\"handle\":\"shane.yuan@datadoghq.com\",\"created_at\":\"2026-10-30T20:27:13.026594+00:00\",\"modified_at\":\"2026-10-30T20:27:25.236531+00:00\",\"email\":\"shane.yuan@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/188fa6df65bb6c77c82677908094fbdb?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null}}]}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "json", + "value": { + "data": { + "attributes": { + "filter": { + "tags": [ + "test:test-update_a_monitor_notification_rule_with_rule_options_returns_ok_response-1793392592" + ] + }, + "name": "updated rule", + "recipients": [ + "slack-test-channel" + ], + "rule_options": { + "is_threaded": false + } + }, + "id": "586901e2-3384-4a4e-89c3-b7ba7906bcc0", + "type": "monitor-notification-rule" + } + } + }, + "content_type": "application/json", + "method": "PATCH", + "path": "/api/v2/monitor/notification_rule/586901e2-3384-4a4e-89c3-b7ba7906bcc0", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "{\"data\":{\"type\":\"monitor-notification-rule\",\"id\":\"586901e2-3384-4a4e-89c3-b7ba7906bcc0\",\"attributes\":{\"name\":\"updated rule\",\"created_at\":\"2026-10-30T20:36:32.665098+00:00\",\"modified_at\":\"2026-10-30T20:36:32.849285+00:00\",\"filter\":{\"tags\":[\"test:test-update_a_monitor_notification_rule_with_rule_options_returns_ok_response-1793392592\"]},\"recipients\":[\"slack-test-channel\"],\"rule_options\":{\"is_threaded\":false}},\"relationships\":{\"created_by\":{\"data\":{\"type\":\"users\",\"id\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\"}}}},\"included\":[{\"type\":\"users\",\"id\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\",\"attributes\":{\"uuid\":\"8c875225-6d15-408c-9dcc-dd539cd02fa5\",\"name\":\"Shane Yuan\",\"handle\":\"shane.yuan@datadoghq.com\",\"created_at\":\"2026-10-30T20:27:13.026594+00:00\",\"modified_at\":\"2026-10-30T20:27:25.236531+00:00\",\"email\":\"shane.yuan@datadoghq.com\",\"icon\":\"https://secure.gravatar.com/avatar/188fa6df65bb6c77c82677908094fbdb?s=48&d=retro\",\"title\":null,\"verified\":true,\"service_account\":false,\"disabled\":false,\"allowed_login_methods\":[],\"status\":\"Active\",\"last_login_time\":null}}]}\n" + }, + "headers": { + "content-type": "application/json" + }, + "reason": "OK", + "status": 200 + } + }, + { + "request": { + "body": { + "type": "empty", + "value": null + }, + "content_type": "", + "method": "DELETE", + "path": "/api/v2/monitor/notification_rule/586901e2-3384-4a4e-89c3-b7ba7906bcc0", + "query": [] + }, + "response": { + "body": { + "encoding": "text", + "value": "" + }, + "headers": { + "content-type": "text/html; charset=utf-8" + }, + "reason": "No Content", + "status": 204 + } + } + ], + "scenario": "Update a monitor notification rule with rule options returns \"OK\" response", + "version": "v2" + }, { "feature": "Monitors", "frozen_at": "2025-11-11T21:28:40.357Z",