Skip to content
Merged
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
131 changes: 95 additions & 36 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35651,21 +35651,6 @@ components:
format: int64
type: integer
type: object
DeviceTagsBySource:
description: Tags associated with a device from a specific source.
properties:
source:
description: The source of the tags.
example: user
type: string
tags:
description: The list of tags for the source.
example: ["tag:test", "tag:testbis"]
items:
description: A tag string in `key:value` format.
type: string
type: array
type: object
DevicesListData:
description: The devices list data
properties:
Expand Down Expand Up @@ -66483,12 +66468,6 @@ components:
ListTagsResponseDataAttributes:
description: The definition of ListTagsResponseDataAttributes object.
properties:
by_source:
description: The list of device tags grouped by source.
items:
$ref: "#/components/schemas/DeviceTagsBySource"
readOnly: true
type: array
tags:
description: The list of tags
example: ["tag:test", "tag:testbis"]
Expand Down Expand Up @@ -71358,6 +71337,32 @@ components:
required:
- data
type: object
MonitorConfigPolicyDowntimePolicy:
additionalProperties: false
description: Downtime duration attributes of a monitor configuration policy.
properties:
max_duration_ms:
description: The maximum allowed downtime duration, in milliseconds.
example: 3600000
format: int64
minimum: 1
type: integer
required:
- max_duration_ms
type: object
MonitorConfigPolicyDowntimePolicyCreateRequest:
additionalProperties: false
description: Downtime duration attributes of a monitor configuration policy.
properties:
max_duration_ms:
description: The maximum allowed downtime duration, in milliseconds.
example: 3600000
format: int64
minimum: 1
type: integer
required:
- max_duration_ms
type: object
MonitorConfigPolicyEditData:
description: A monitor configuration policy data.
properties:
Expand Down Expand Up @@ -71395,10 +71400,12 @@ components:
description: Configuration for the policy.
oneOf:
- $ref: "#/components/schemas/MonitorConfigPolicyTagPolicy"
- $ref: "#/components/schemas/MonitorConfigPolicyDowntimePolicy"
MonitorConfigPolicyPolicyCreateRequest:
description: Configuration for the policy.
oneOf:
- $ref: "#/components/schemas/MonitorConfigPolicyTagPolicyCreateRequest"
- $ref: "#/components/schemas/MonitorConfigPolicyDowntimePolicyCreateRequest"
MonitorConfigPolicyResourceType:
default: monitor-config-policy
description: Monitor configuration policy resource type.
Expand Down Expand Up @@ -71427,6 +71434,7 @@ components:
$ref: "#/components/schemas/MonitorConfigPolicyResourceType"
type: object
MonitorConfigPolicyTagPolicy:
additionalProperties: false
description: Tag attributes of a monitor configuration policy.
properties:
tag_key:
Expand All @@ -71448,6 +71456,7 @@ components:
type: array
type: object
MonitorConfigPolicyTagPolicyCreateRequest:
additionalProperties: false
description: Tag attributes of a monitor configuration policy.
properties:
tag_key:
Expand All @@ -71474,13 +71483,18 @@ components:
type: object
MonitorConfigPolicyType:
default: tag
description: The monitor configuration policy type.
description: |-
The monitor configuration policy type.
`tag` enforces required tags on monitors.
`downtime` sets a maximum downtime duration for the organization.
enum:
- tag
- downtime
example: "tag"
type: string
x-enum-varnames:
- TAG
- DOWNTIME
MonitorDowntimeMatchResourceType:
default: downtime_match
description: Monitor Downtime Match resource type.
Expand Down Expand Up @@ -181964,6 +181978,16 @@ paths:
policy_type: tag
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
downtime:
summary: Downtime duration policy
value:
data:
- attributes:
policy:
max_duration_ms: 3600000
policy_type: downtime
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
schema:
$ref: "#/components/schemas/MonitorConfigPolicyListResponse"
description: OK
Expand Down Expand Up @@ -182006,6 +182030,15 @@ paths:
- staging
policy_type: tag
type: monitor-config-policy
downtime:
summary: Downtime duration policy
value:
data:
attributes:
policy:
max_duration_ms: 3600000
policy_type: downtime
type: monitor-config-policy
schema:
$ref: "#/components/schemas/MonitorConfigPolicyCreateRequest"
description: Create a monitor configuration policy request body.
Expand All @@ -182028,6 +182061,16 @@ paths:
policy_type: tag
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
downtime:
summary: Downtime duration policy
value:
data:
attributes:
policy:
max_duration_ms: 3600000
policy_type: downtime
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
schema:
$ref: "#/components/schemas/MonitorConfigPolicyResponse"
description: OK
Expand Down Expand Up @@ -182124,6 +182167,16 @@ paths:
policy_type: tag
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
downtime:
summary: Downtime duration policy
value:
data:
attributes:
policy:
max_duration_ms: 3600000
policy_type: downtime
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
schema:
$ref: "#/components/schemas/MonitorConfigPolicyResponse"
description: OK
Expand Down Expand Up @@ -182181,6 +182234,16 @@ paths:
policy_type: tag
id: 00000000-0000-1234-0000-000000000000
type: monitor-config-policy
downtime:
summary: Downtime duration policy
value:
data:
attributes:
policy:
max_duration_ms: 3600000
policy_type: downtime
id: 00000000-0000-1234-0000-000000000000
type: monitor-config-policy
schema:
$ref: "#/components/schemas/MonitorConfigPolicyEditRequest"
description: Description of the update.
Expand All @@ -182203,6 +182266,16 @@ paths:
policy_type: tag
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
downtime:
summary: Downtime duration policy
value:
data:
attributes:
policy:
max_duration_ms: 3600000
policy_type: downtime
id: "00000000-0000-1234-0000-000000000000"
type: monitor-config-policy
schema:
$ref: "#/components/schemas/MonitorConfigPolicyResponse"
description: OK
Expand Down Expand Up @@ -182907,20 +182980,6 @@ paths:
content:
application/json:
examples:
by_source:
value:
data:
attributes:
by_source:
- source: user
tags:
- "tag:test"
- "tag:testbis"
- source: snmp
tags:
- "device_ip:1.2.3.4"
id: foiwf7rgw38fh
type: tags
default:
value:
data:
Expand Down
44 changes: 44 additions & 0 deletions examples/v2/monitors/CreateMonitorConfigPolicy_1934105875.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
// Create a downtime duration monitor configuration policy 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.MonitorConfigPolicyAttributeCreateRequest;
import com.datadog.api.client.v2.model.MonitorConfigPolicyCreateData;
import com.datadog.api.client.v2.model.MonitorConfigPolicyCreateRequest;
import com.datadog.api.client.v2.model.MonitorConfigPolicyDowntimePolicyCreateRequest;
import com.datadog.api.client.v2.model.MonitorConfigPolicyPolicyCreateRequest;
import com.datadog.api.client.v2.model.MonitorConfigPolicyResourceType;
import com.datadog.api.client.v2.model.MonitorConfigPolicyResponse;
import com.datadog.api.client.v2.model.MonitorConfigPolicyType;

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

MonitorConfigPolicyCreateRequest body =
new MonitorConfigPolicyCreateRequest()
.data(
new MonitorConfigPolicyCreateData()
.attributes(
new MonitorConfigPolicyAttributeCreateRequest()
.policyType(MonitorConfigPolicyType.DOWNTIME)
.policy(
new MonitorConfigPolicyPolicyCreateRequest(
new MonitorConfigPolicyDowntimePolicyCreateRequest()
.maxDurationMs(3600000L))))
.type(MonitorConfigPolicyResourceType.MONITOR_CONFIG_POLICY));

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