-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Regenerate client from commit 1dae0a3f of spec repo
- Loading branch information
ci.datadog-api-spec
committed
Aug 11, 2022
1 parent
66796bb
commit d44e283
Showing
12 changed files
with
149 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
/** | ||
* Create a monitor with options returns "OK" response | ||
*/ | ||
|
||
import { client, v1 } from "@datadog/datadog-api-client"; | ||
|
||
const configuration = client.createConfiguration(); | ||
const apiInstance = new v1.MonitorsApi(configuration); | ||
|
||
const params: v1.MonitorsApiCreateMonitorRequest = { | ||
body: { | ||
name: "Example-Create_a_monitor_with_options_returns_OK_response", | ||
type: "log alert", | ||
query: `logs("service:foo AND type:error").index("main").rollup("count").by("source").last("5m") > 2`, | ||
message: "some message Notify: @hipchat-channel", | ||
tags: ["test:examplecreateamonitorwithoptionsreturnsokresponse", "env:ci"], | ||
priority: 3, | ||
options: { | ||
enableLogsSample: true, | ||
escalationMessage: "the situation has escalated", | ||
evaluationDelay: 700, | ||
groupRetentionDuration: "2h", | ||
groupbySimpleMonitor: true, | ||
includeTags: true, | ||
locked: false, | ||
newHostDelay: 600, | ||
noDataTimeframe: undefined, | ||
notifyAudit: false, | ||
notifyNoData: false, | ||
onMissingData: "show_and_notify_no_data", | ||
renotifyInterval: 60, | ||
requireFullWindow: true, | ||
timeoutH: 24, | ||
thresholds: { | ||
critical: 2, | ||
warning: 1, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
apiInstance | ||
.createMonitor(params) | ||
.then((data: v1.Monitor) => { | ||
console.log( | ||
"API called successfully. Returned data: " + JSON.stringify(data) | ||
); | ||
}) | ||
.catch((error: any) => console.error(error)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
packages/datadog-api-client-v1/models/OnMissingDataOption.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
/** | ||
* 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 2020-Present Datadog, Inc. | ||
*/ | ||
|
||
export type OnMissingDataOption = | ||
| typeof DEFAULT | ||
| typeof SHOW_NO_DATA | ||
| typeof SHOW_AND_NOTIFY_NO_DATA | ||
| typeof RESOLVE; | ||
export const DEFAULT = "default"; | ||
export const SHOW_NO_DATA = "show_no_data"; | ||
export const SHOW_AND_NOTIFY_NO_DATA = "show_and_notify_no_data"; | ||
export const RESOLVE = "resolve"; |