Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support to synthetic alert creation using JSON payload (parameter --from-json) #91

Closed
DenisMedeiros opened this issue Jun 26, 2024 · 2 comments
Assignees

Comments

@DenisMedeiros
Copy link

DenisMedeiros commented Jun 26, 2024

Hi team,

Is it possible to add the feature to allow the creation of alerts using a JSON file, similar to how we can do to create tests?

For example, the command below works:

synctl create test --type 0 --from-json monitor.json

Where my monitor.json is defined as below (this JSON content was exported by running synctl get test <id> --show-json):

{
  "label": "endpoint",
  "description": "Test",
  "active": true,
  "testFrequency": 5,
  "playbackMode": "Simultaneous",
  "locations": [
    "AAAAAAAAAAAAAAAAAAAA"
  ],
  "locationLabels": [
    "example"
  ],
  "locationDisplayLabels": [
    "us-east-1(NVirginia)"
  ],
  "configuration": {
    "syntheticType": "HTTPAction",
    "markSyntheticCall": true,
    "retries": 0,
    "retryInterval": 1,
    "timeout": "30s",
    "url": "https://example.com",
    "operation": "GET",
    "body": "",
    "validationString": "",
    "followRedirect": true,
    "allowInsecure": true
  },
  "customProperties": {}
}

We would like to run something like synctl create alert --from-json alert.json (we already can export the alert JSON representation using synctl get alert <id> --show-json).

Thanks!

@swethalohith2 swethalohith2 self-assigned this Jun 28, 2024
This was referenced Jun 28, 2024
@swethalohith2
Copy link
Contributor

Hi Denis,
this feature has been added to the tool. Please upgrade to the latest version, and you can use the command synctl create alert --from-json alert.json to create an alert.

@rongzhus
Copy link

rongzhus commented Aug 8, 2024

Added since version v1.1.3, and use -f instead of --from-json from v2.0.0.

@rongzhus rongzhus closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants