Amazon Lookout for Metrics
POST
ActivateAnomalyDetector
{{baseUrl}}/ActivateAnomalyDetector
BODY json
{
"AnomalyDetectorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ActivateAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ActivateAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorArn ""}})
require "http/client"
url = "{{baseUrl}}/ActivateAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ActivateAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ActivateAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ActivateAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ActivateAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"AnomalyDetectorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ActivateAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ActivateAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ActivateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ActivateAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ActivateAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ActivateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ActivateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ActivateAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ActivateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ActivateAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ActivateAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ActivateAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ActivateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ActivateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ActivateAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ActivateAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ActivateAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ActivateAnomalyDetector', [
'body' => '{
"AnomalyDetectorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ActivateAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ActivateAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ActivateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ActivateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ActivateAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ActivateAnomalyDetector"
payload = { "AnomalyDetectorArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ActivateAnomalyDetector"
payload <- "{\n \"AnomalyDetectorArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ActivateAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ActivateAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ActivateAnomalyDetector";
let payload = json!({"AnomalyDetectorArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ActivateAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": ""
}'
echo '{
"AnomalyDetectorArn": ""
}' | \
http POST {{baseUrl}}/ActivateAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": ""\n}' \
--output-document \
- {{baseUrl}}/ActivateAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AnomalyDetectorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ActivateAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
BackTestAnomalyDetector
{{baseUrl}}/BackTestAnomalyDetector
BODY json
{
"AnomalyDetectorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/BackTestAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/BackTestAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorArn ""}})
require "http/client"
url = "{{baseUrl}}/BackTestAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/BackTestAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/BackTestAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/BackTestAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/BackTestAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"AnomalyDetectorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/BackTestAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/BackTestAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/BackTestAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/BackTestAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/BackTestAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/BackTestAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/BackTestAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/BackTestAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/BackTestAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/BackTestAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/BackTestAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/BackTestAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/BackTestAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/BackTestAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/BackTestAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/BackTestAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/BackTestAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/BackTestAnomalyDetector', [
'body' => '{
"AnomalyDetectorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/BackTestAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/BackTestAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/BackTestAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/BackTestAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/BackTestAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/BackTestAnomalyDetector"
payload = { "AnomalyDetectorArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/BackTestAnomalyDetector"
payload <- "{\n \"AnomalyDetectorArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/BackTestAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/BackTestAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/BackTestAnomalyDetector";
let payload = json!({"AnomalyDetectorArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/BackTestAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": ""
}'
echo '{
"AnomalyDetectorArn": ""
}' | \
http POST {{baseUrl}}/BackTestAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": ""\n}' \
--output-document \
- {{baseUrl}}/BackTestAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AnomalyDetectorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/BackTestAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateAlert
{{baseUrl}}/CreateAlert
BODY json
{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CreateAlert");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CreateAlert" {:content-type :json
:form-params {:AlertName ""
:AlertSensitivityThreshold 0
:AlertDescription ""
:AnomalyDetectorArn ""
:Action {:SNSConfiguration ""
:LambdaConfiguration ""}
:Tags {}
:AlertFilters {:MetricList ""
:DimensionFilterList ""}}})
require "http/client"
url = "{{baseUrl}}/CreateAlert"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/CreateAlert"),
Content = new StringContent("{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/CreateAlert");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CreateAlert"
payload := strings.NewReader("{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/CreateAlert HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 277
{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CreateAlert")
.setHeader("content-type", "application/json")
.setBody("{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CreateAlert"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CreateAlert")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CreateAlert")
.header("content-type", "application/json")
.body("{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
AlertName: '',
AlertSensitivityThreshold: 0,
AlertDescription: '',
AnomalyDetectorArn: '',
Action: {
SNSConfiguration: '',
LambdaConfiguration: ''
},
Tags: {},
AlertFilters: {
MetricList: '',
DimensionFilterList: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CreateAlert');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateAlert',
headers: {'content-type': 'application/json'},
data: {
AlertName: '',
AlertSensitivityThreshold: 0,
AlertDescription: '',
AnomalyDetectorArn: '',
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
Tags: {},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CreateAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertName":"","AlertSensitivityThreshold":0,"AlertDescription":"","AnomalyDetectorArn":"","Action":{"SNSConfiguration":"","LambdaConfiguration":""},"Tags":{},"AlertFilters":{"MetricList":"","DimensionFilterList":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/CreateAlert',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AlertName": "",\n "AlertSensitivityThreshold": 0,\n "AlertDescription": "",\n "AnomalyDetectorArn": "",\n "Action": {\n "SNSConfiguration": "",\n "LambdaConfiguration": ""\n },\n "Tags": {},\n "AlertFilters": {\n "MetricList": "",\n "DimensionFilterList": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CreateAlert")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/CreateAlert',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AlertName: '',
AlertSensitivityThreshold: 0,
AlertDescription: '',
AnomalyDetectorArn: '',
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
Tags: {},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateAlert',
headers: {'content-type': 'application/json'},
body: {
AlertName: '',
AlertSensitivityThreshold: 0,
AlertDescription: '',
AnomalyDetectorArn: '',
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
Tags: {},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/CreateAlert');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AlertName: '',
AlertSensitivityThreshold: 0,
AlertDescription: '',
AnomalyDetectorArn: '',
Action: {
SNSConfiguration: '',
LambdaConfiguration: ''
},
Tags: {},
AlertFilters: {
MetricList: '',
DimensionFilterList: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateAlert',
headers: {'content-type': 'application/json'},
data: {
AlertName: '',
AlertSensitivityThreshold: 0,
AlertDescription: '',
AnomalyDetectorArn: '',
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
Tags: {},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CreateAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertName":"","AlertSensitivityThreshold":0,"AlertDescription":"","AnomalyDetectorArn":"","Action":{"SNSConfiguration":"","LambdaConfiguration":""},"Tags":{},"AlertFilters":{"MetricList":"","DimensionFilterList":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AlertName": @"",
@"AlertSensitivityThreshold": @0,
@"AlertDescription": @"",
@"AnomalyDetectorArn": @"",
@"Action": @{ @"SNSConfiguration": @"", @"LambdaConfiguration": @"" },
@"Tags": @{ },
@"AlertFilters": @{ @"MetricList": @"", @"DimensionFilterList": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CreateAlert"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/CreateAlert" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CreateAlert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AlertName' => '',
'AlertSensitivityThreshold' => 0,
'AlertDescription' => '',
'AnomalyDetectorArn' => '',
'Action' => [
'SNSConfiguration' => '',
'LambdaConfiguration' => ''
],
'Tags' => [
],
'AlertFilters' => [
'MetricList' => '',
'DimensionFilterList' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/CreateAlert', [
'body' => '{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CreateAlert');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AlertName' => '',
'AlertSensitivityThreshold' => 0,
'AlertDescription' => '',
'AnomalyDetectorArn' => '',
'Action' => [
'SNSConfiguration' => '',
'LambdaConfiguration' => ''
],
'Tags' => [
],
'AlertFilters' => [
'MetricList' => '',
'DimensionFilterList' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AlertName' => '',
'AlertSensitivityThreshold' => 0,
'AlertDescription' => '',
'AnomalyDetectorArn' => '',
'Action' => [
'SNSConfiguration' => '',
'LambdaConfiguration' => ''
],
'Tags' => [
],
'AlertFilters' => [
'MetricList' => '',
'DimensionFilterList' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/CreateAlert');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/CreateAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CreateAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CreateAlert", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CreateAlert"
payload = {
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CreateAlert"
payload <- "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/CreateAlert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/CreateAlert') do |req|
req.body = "{\n \"AlertName\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"AlertDescription\": \"\",\n \"AnomalyDetectorArn\": \"\",\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"Tags\": {},\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CreateAlert";
let payload = json!({
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": json!({
"SNSConfiguration": "",
"LambdaConfiguration": ""
}),
"Tags": json!({}),
"AlertFilters": json!({
"MetricList": "",
"DimensionFilterList": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/CreateAlert \
--header 'content-type: application/json' \
--data '{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}'
echo '{
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"Tags": {},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}' | \
http POST {{baseUrl}}/CreateAlert \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AlertName": "",\n "AlertSensitivityThreshold": 0,\n "AlertDescription": "",\n "AnomalyDetectorArn": "",\n "Action": {\n "SNSConfiguration": "",\n "LambdaConfiguration": ""\n },\n "Tags": {},\n "AlertFilters": {\n "MetricList": "",\n "DimensionFilterList": ""\n }\n}' \
--output-document \
- {{baseUrl}}/CreateAlert
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AlertName": "",
"AlertSensitivityThreshold": 0,
"AlertDescription": "",
"AnomalyDetectorArn": "",
"Action": [
"SNSConfiguration": "",
"LambdaConfiguration": ""
],
"Tags": [],
"AlertFilters": [
"MetricList": "",
"DimensionFilterList": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CreateAlert")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateAnomalyDetector
{{baseUrl}}/CreateAnomalyDetector
BODY json
{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CreateAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CreateAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorName ""
:AnomalyDetectorDescription ""
:AnomalyDetectorConfig {:AnomalyDetectorFrequency ""}
:KmsKeyArn ""
:Tags {}}})
require "http/client"
url = "{{baseUrl}}/CreateAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/CreateAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/CreateAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CreateAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/CreateAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 169
{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CreateAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CreateAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CreateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CreateAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorName: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {
AnomalyDetectorFrequency: ''
},
KmsKeyArn: '',
Tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CreateAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorName: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''},
KmsKeyArn: '',
Tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CreateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorName":"","AnomalyDetectorDescription":"","AnomalyDetectorConfig":{"AnomalyDetectorFrequency":""},"KmsKeyArn":"","Tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/CreateAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorName": "",\n "AnomalyDetectorDescription": "",\n "AnomalyDetectorConfig": {\n "AnomalyDetectorFrequency": ""\n },\n "KmsKeyArn": "",\n "Tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CreateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/CreateAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorName: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''},
KmsKeyArn: '',
Tags: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorName: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''},
KmsKeyArn: '',
Tags: {}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/CreateAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorName: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {
AnomalyDetectorFrequency: ''
},
KmsKeyArn: '',
Tags: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorName: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''},
KmsKeyArn: '',
Tags: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CreateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorName":"","AnomalyDetectorDescription":"","AnomalyDetectorConfig":{"AnomalyDetectorFrequency":""},"KmsKeyArn":"","Tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorName": @"",
@"AnomalyDetectorDescription": @"",
@"AnomalyDetectorConfig": @{ @"AnomalyDetectorFrequency": @"" },
@"KmsKeyArn": @"",
@"Tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CreateAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/CreateAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CreateAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorName' => '',
'AnomalyDetectorDescription' => '',
'AnomalyDetectorConfig' => [
'AnomalyDetectorFrequency' => ''
],
'KmsKeyArn' => '',
'Tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/CreateAnomalyDetector', [
'body' => '{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CreateAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorName' => '',
'AnomalyDetectorDescription' => '',
'AnomalyDetectorConfig' => [
'AnomalyDetectorFrequency' => ''
],
'KmsKeyArn' => '',
'Tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorName' => '',
'AnomalyDetectorDescription' => '',
'AnomalyDetectorConfig' => [
'AnomalyDetectorFrequency' => ''
],
'KmsKeyArn' => '',
'Tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/CreateAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/CreateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CreateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CreateAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CreateAnomalyDetector"
payload = {
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": { "AnomalyDetectorFrequency": "" },
"KmsKeyArn": "",
"Tags": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CreateAnomalyDetector"
payload <- "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/CreateAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/CreateAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorName\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n },\n \"KmsKeyArn\": \"\",\n \"Tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CreateAnomalyDetector";
let payload = json!({
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": json!({"AnomalyDetectorFrequency": ""}),
"KmsKeyArn": "",
"Tags": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/CreateAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}'
echo '{
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
},
"KmsKeyArn": "",
"Tags": {}
}' | \
http POST {{baseUrl}}/CreateAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorName": "",\n "AnomalyDetectorDescription": "",\n "AnomalyDetectorConfig": {\n "AnomalyDetectorFrequency": ""\n },\n "KmsKeyArn": "",\n "Tags": {}\n}' \
--output-document \
- {{baseUrl}}/CreateAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorName": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": ["AnomalyDetectorFrequency": ""],
"KmsKeyArn": "",
"Tags": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CreateAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
CreateMetricSet
{{baseUrl}}/CreateMetricSet
BODY json
{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/CreateMetricSet");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/CreateMetricSet" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:MetricSetName ""
:MetricSetDescription ""
:MetricList [{:MetricName ""
:AggregationFunction ""
:Namespace ""}]
:Offset 0
:TimestampColumn {:ColumnName ""
:ColumnFormat ""}
:DimensionList []
:MetricSetFrequency ""
:MetricSource {:S3SourceConfig {:RoleArn ""
:TemplatedPathList ""
:HistoricalDataPathList ""
:FileFormatDescriptor ""}
:AppFlowConfig ""
:CloudWatchConfig ""
:RDSSourceConfig ""
:RedshiftSourceConfig ""
:AthenaSourceConfig ""}
:Timezone ""
:Tags {}
:DimensionFilterList [{:Name ""
:FilterList ""}]}})
require "http/client"
url = "{{baseUrl}}/CreateMetricSet"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/CreateMetricSet"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/CreateMetricSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/CreateMetricSet"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/CreateMetricSet HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 771
{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/CreateMetricSet")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/CreateMetricSet"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/CreateMetricSet")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/CreateMetricSet")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
MetricSetName: '',
MetricSetDescription: '',
MetricList: [
{
MetricName: '',
AggregationFunction: '',
Namespace: ''
}
],
Offset: 0,
TimestampColumn: {
ColumnName: '',
ColumnFormat: ''
},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
Timezone: '',
Tags: {},
DimensionFilterList: [
{
Name: '',
FilterList: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/CreateMetricSet');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateMetricSet',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
MetricSetName: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
Timezone: '',
Tags: {},
DimensionFilterList: [{Name: '', FilterList: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/CreateMetricSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","MetricSetName":"","MetricSetDescription":"","MetricList":[{"MetricName":"","AggregationFunction":"","Namespace":""}],"Offset":0,"TimestampColumn":{"ColumnName":"","ColumnFormat":""},"DimensionList":[],"MetricSetFrequency":"","MetricSource":{"S3SourceConfig":{"RoleArn":"","TemplatedPathList":"","HistoricalDataPathList":"","FileFormatDescriptor":""},"AppFlowConfig":"","CloudWatchConfig":"","RDSSourceConfig":"","RedshiftSourceConfig":"","AthenaSourceConfig":""},"Timezone":"","Tags":{},"DimensionFilterList":[{"Name":"","FilterList":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/CreateMetricSet',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "MetricSetName": "",\n "MetricSetDescription": "",\n "MetricList": [\n {\n "MetricName": "",\n "AggregationFunction": "",\n "Namespace": ""\n }\n ],\n "Offset": 0,\n "TimestampColumn": {\n "ColumnName": "",\n "ColumnFormat": ""\n },\n "DimensionList": [],\n "MetricSetFrequency": "",\n "MetricSource": {\n "S3SourceConfig": {\n "RoleArn": "",\n "TemplatedPathList": "",\n "HistoricalDataPathList": "",\n "FileFormatDescriptor": ""\n },\n "AppFlowConfig": "",\n "CloudWatchConfig": "",\n "RDSSourceConfig": "",\n "RedshiftSourceConfig": "",\n "AthenaSourceConfig": ""\n },\n "Timezone": "",\n "Tags": {},\n "DimensionFilterList": [\n {\n "Name": "",\n "FilterList": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/CreateMetricSet")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/CreateMetricSet',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorArn: '',
MetricSetName: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
Timezone: '',
Tags: {},
DimensionFilterList: [{Name: '', FilterList: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateMetricSet',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorArn: '',
MetricSetName: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
Timezone: '',
Tags: {},
DimensionFilterList: [{Name: '', FilterList: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/CreateMetricSet');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
MetricSetName: '',
MetricSetDescription: '',
MetricList: [
{
MetricName: '',
AggregationFunction: '',
Namespace: ''
}
],
Offset: 0,
TimestampColumn: {
ColumnName: '',
ColumnFormat: ''
},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
Timezone: '',
Tags: {},
DimensionFilterList: [
{
Name: '',
FilterList: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/CreateMetricSet',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
MetricSetName: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
Timezone: '',
Tags: {},
DimensionFilterList: [{Name: '', FilterList: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/CreateMetricSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","MetricSetName":"","MetricSetDescription":"","MetricList":[{"MetricName":"","AggregationFunction":"","Namespace":""}],"Offset":0,"TimestampColumn":{"ColumnName":"","ColumnFormat":""},"DimensionList":[],"MetricSetFrequency":"","MetricSource":{"S3SourceConfig":{"RoleArn":"","TemplatedPathList":"","HistoricalDataPathList":"","FileFormatDescriptor":""},"AppFlowConfig":"","CloudWatchConfig":"","RDSSourceConfig":"","RedshiftSourceConfig":"","AthenaSourceConfig":""},"Timezone":"","Tags":{},"DimensionFilterList":[{"Name":"","FilterList":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"MetricSetName": @"",
@"MetricSetDescription": @"",
@"MetricList": @[ @{ @"MetricName": @"", @"AggregationFunction": @"", @"Namespace": @"" } ],
@"Offset": @0,
@"TimestampColumn": @{ @"ColumnName": @"", @"ColumnFormat": @"" },
@"DimensionList": @[ ],
@"MetricSetFrequency": @"",
@"MetricSource": @{ @"S3SourceConfig": @{ @"RoleArn": @"", @"TemplatedPathList": @"", @"HistoricalDataPathList": @"", @"FileFormatDescriptor": @"" }, @"AppFlowConfig": @"", @"CloudWatchConfig": @"", @"RDSSourceConfig": @"", @"RedshiftSourceConfig": @"", @"AthenaSourceConfig": @"" },
@"Timezone": @"",
@"Tags": @{ },
@"DimensionFilterList": @[ @{ @"Name": @"", @"FilterList": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/CreateMetricSet"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/CreateMetricSet" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/CreateMetricSet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'MetricSetName' => '',
'MetricSetDescription' => '',
'MetricList' => [
[
'MetricName' => '',
'AggregationFunction' => '',
'Namespace' => ''
]
],
'Offset' => 0,
'TimestampColumn' => [
'ColumnName' => '',
'ColumnFormat' => ''
],
'DimensionList' => [
],
'MetricSetFrequency' => '',
'MetricSource' => [
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => ''
],
'AppFlowConfig' => '',
'CloudWatchConfig' => '',
'RDSSourceConfig' => '',
'RedshiftSourceConfig' => '',
'AthenaSourceConfig' => ''
],
'Timezone' => '',
'Tags' => [
],
'DimensionFilterList' => [
[
'Name' => '',
'FilterList' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/CreateMetricSet', [
'body' => '{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/CreateMetricSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'MetricSetName' => '',
'MetricSetDescription' => '',
'MetricList' => [
[
'MetricName' => '',
'AggregationFunction' => '',
'Namespace' => ''
]
],
'Offset' => 0,
'TimestampColumn' => [
'ColumnName' => '',
'ColumnFormat' => ''
],
'DimensionList' => [
],
'MetricSetFrequency' => '',
'MetricSource' => [
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => ''
],
'AppFlowConfig' => '',
'CloudWatchConfig' => '',
'RDSSourceConfig' => '',
'RedshiftSourceConfig' => '',
'AthenaSourceConfig' => ''
],
'Timezone' => '',
'Tags' => [
],
'DimensionFilterList' => [
[
'Name' => '',
'FilterList' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'MetricSetName' => '',
'MetricSetDescription' => '',
'MetricList' => [
[
'MetricName' => '',
'AggregationFunction' => '',
'Namespace' => ''
]
],
'Offset' => 0,
'TimestampColumn' => [
'ColumnName' => '',
'ColumnFormat' => ''
],
'DimensionList' => [
],
'MetricSetFrequency' => '',
'MetricSource' => [
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => ''
],
'AppFlowConfig' => '',
'CloudWatchConfig' => '',
'RDSSourceConfig' => '',
'RedshiftSourceConfig' => '',
'AthenaSourceConfig' => ''
],
'Timezone' => '',
'Tags' => [
],
'DimensionFilterList' => [
[
'Name' => '',
'FilterList' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/CreateMetricSet');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/CreateMetricSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/CreateMetricSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/CreateMetricSet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/CreateMetricSet"
payload = {
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/CreateMetricSet"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/CreateMetricSet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/CreateMetricSet') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetName\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"Timezone\": \"\",\n \"Tags\": {},\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/CreateMetricSet";
let payload = json!({
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": (
json!({
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
})
),
"Offset": 0,
"TimestampColumn": json!({
"ColumnName": "",
"ColumnFormat": ""
}),
"DimensionList": (),
"MetricSetFrequency": "",
"MetricSource": json!({
"S3SourceConfig": json!({
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
}),
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
}),
"Timezone": "",
"Tags": json!({}),
"DimensionFilterList": (
json!({
"Name": "",
"FilterList": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/CreateMetricSet \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}'
echo '{
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"Timezone": "",
"Tags": {},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}' | \
http POST {{baseUrl}}/CreateMetricSet \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "MetricSetName": "",\n "MetricSetDescription": "",\n "MetricList": [\n {\n "MetricName": "",\n "AggregationFunction": "",\n "Namespace": ""\n }\n ],\n "Offset": 0,\n "TimestampColumn": {\n "ColumnName": "",\n "ColumnFormat": ""\n },\n "DimensionList": [],\n "MetricSetFrequency": "",\n "MetricSource": {\n "S3SourceConfig": {\n "RoleArn": "",\n "TemplatedPathList": "",\n "HistoricalDataPathList": "",\n "FileFormatDescriptor": ""\n },\n "AppFlowConfig": "",\n "CloudWatchConfig": "",\n "RDSSourceConfig": "",\n "RedshiftSourceConfig": "",\n "AthenaSourceConfig": ""\n },\n "Timezone": "",\n "Tags": {},\n "DimensionFilterList": [\n {\n "Name": "",\n "FilterList": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/CreateMetricSet
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"MetricSetName": "",
"MetricSetDescription": "",
"MetricList": [
[
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
]
],
"Offset": 0,
"TimestampColumn": [
"ColumnName": "",
"ColumnFormat": ""
],
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": [
"S3SourceConfig": [
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
],
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
],
"Timezone": "",
"Tags": [],
"DimensionFilterList": [
[
"Name": "",
"FilterList": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/CreateMetricSet")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeactivateAnomalyDetector
{{baseUrl}}/DeactivateAnomalyDetector
BODY json
{
"AnomalyDetectorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DeactivateAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DeactivateAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorArn ""}})
require "http/client"
url = "{{baseUrl}}/DeactivateAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DeactivateAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DeactivateAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DeactivateAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DeactivateAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"AnomalyDetectorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DeactivateAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DeactivateAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DeactivateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DeactivateAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DeactivateAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DeactivateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DeactivateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DeactivateAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DeactivateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DeactivateAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DeactivateAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DeactivateAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DeactivateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DeactivateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DeactivateAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DeactivateAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DeactivateAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DeactivateAnomalyDetector', [
'body' => '{
"AnomalyDetectorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DeactivateAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DeactivateAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DeactivateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DeactivateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DeactivateAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DeactivateAnomalyDetector"
payload = { "AnomalyDetectorArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DeactivateAnomalyDetector"
payload <- "{\n \"AnomalyDetectorArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DeactivateAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DeactivateAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DeactivateAnomalyDetector";
let payload = json!({"AnomalyDetectorArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DeactivateAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": ""
}'
echo '{
"AnomalyDetectorArn": ""
}' | \
http POST {{baseUrl}}/DeactivateAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": ""\n}' \
--output-document \
- {{baseUrl}}/DeactivateAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AnomalyDetectorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DeactivateAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteAlert
{{baseUrl}}/DeleteAlert
BODY json
{
"AlertArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DeleteAlert");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AlertArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DeleteAlert" {:content-type :json
:form-params {:AlertArn ""}})
require "http/client"
url = "{{baseUrl}}/DeleteAlert"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AlertArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DeleteAlert"),
Content = new StringContent("{\n \"AlertArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DeleteAlert");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AlertArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DeleteAlert"
payload := strings.NewReader("{\n \"AlertArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DeleteAlert HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"AlertArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DeleteAlert")
.setHeader("content-type", "application/json")
.setBody("{\n \"AlertArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DeleteAlert"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AlertArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AlertArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DeleteAlert")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DeleteAlert")
.header("content-type", "application/json")
.body("{\n \"AlertArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AlertArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DeleteAlert');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteAlert',
headers: {'content-type': 'application/json'},
data: {AlertArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DeleteAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DeleteAlert',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AlertArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AlertArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DeleteAlert")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DeleteAlert',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AlertArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteAlert',
headers: {'content-type': 'application/json'},
body: {AlertArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DeleteAlert');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AlertArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteAlert',
headers: {'content-type': 'application/json'},
data: {AlertArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DeleteAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AlertArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DeleteAlert"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DeleteAlert" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AlertArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DeleteAlert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AlertArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DeleteAlert', [
'body' => '{
"AlertArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DeleteAlert');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AlertArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AlertArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DeleteAlert');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DeleteAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DeleteAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AlertArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DeleteAlert", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DeleteAlert"
payload = { "AlertArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DeleteAlert"
payload <- "{\n \"AlertArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DeleteAlert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AlertArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DeleteAlert') do |req|
req.body = "{\n \"AlertArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DeleteAlert";
let payload = json!({"AlertArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DeleteAlert \
--header 'content-type: application/json' \
--data '{
"AlertArn": ""
}'
echo '{
"AlertArn": ""
}' | \
http POST {{baseUrl}}/DeleteAlert \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AlertArn": ""\n}' \
--output-document \
- {{baseUrl}}/DeleteAlert
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AlertArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DeleteAlert")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DeleteAnomalyDetector
{{baseUrl}}/DeleteAnomalyDetector
BODY json
{
"AnomalyDetectorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DeleteAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DeleteAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorArn ""}})
require "http/client"
url = "{{baseUrl}}/DeleteAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DeleteAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DeleteAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DeleteAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DeleteAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"AnomalyDetectorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DeleteAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DeleteAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DeleteAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DeleteAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DeleteAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DeleteAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DeleteAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DeleteAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DeleteAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DeleteAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DeleteAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DeleteAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DeleteAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DeleteAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DeleteAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DeleteAnomalyDetector', [
'body' => '{
"AnomalyDetectorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DeleteAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DeleteAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DeleteAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DeleteAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DeleteAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DeleteAnomalyDetector"
payload = { "AnomalyDetectorArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DeleteAnomalyDetector"
payload <- "{\n \"AnomalyDetectorArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DeleteAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DeleteAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DeleteAnomalyDetector";
let payload = json!({"AnomalyDetectorArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DeleteAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": ""
}'
echo '{
"AnomalyDetectorArn": ""
}' | \
http POST {{baseUrl}}/DeleteAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": ""\n}' \
--output-document \
- {{baseUrl}}/DeleteAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AnomalyDetectorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DeleteAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeAlert
{{baseUrl}}/DescribeAlert
BODY json
{
"AlertArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeAlert");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AlertArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeAlert" {:content-type :json
:form-params {:AlertArn ""}})
require "http/client"
url = "{{baseUrl}}/DescribeAlert"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AlertArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DescribeAlert"),
Content = new StringContent("{\n \"AlertArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DescribeAlert");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AlertArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeAlert"
payload := strings.NewReader("{\n \"AlertArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeAlert HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 20
{
"AlertArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeAlert")
.setHeader("content-type", "application/json")
.setBody("{\n \"AlertArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeAlert"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AlertArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AlertArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeAlert")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeAlert")
.header("content-type", "application/json")
.body("{\n \"AlertArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AlertArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeAlert');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAlert',
headers: {'content-type': 'application/json'},
data: {AlertArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DescribeAlert',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AlertArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AlertArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeAlert")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeAlert',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AlertArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAlert',
headers: {'content-type': 'application/json'},
body: {AlertArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DescribeAlert');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AlertArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAlert',
headers: {'content-type': 'application/json'},
data: {AlertArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AlertArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeAlert"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DescribeAlert" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AlertArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeAlert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AlertArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeAlert', [
'body' => '{
"AlertArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeAlert');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AlertArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AlertArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DescribeAlert');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AlertArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeAlert", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeAlert"
payload = { "AlertArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeAlert"
payload <- "{\n \"AlertArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeAlert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AlertArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DescribeAlert') do |req|
req.body = "{\n \"AlertArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeAlert";
let payload = json!({"AlertArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeAlert \
--header 'content-type: application/json' \
--data '{
"AlertArn": ""
}'
echo '{
"AlertArn": ""
}' | \
http POST {{baseUrl}}/DescribeAlert \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AlertArn": ""\n}' \
--output-document \
- {{baseUrl}}/DescribeAlert
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AlertArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeAlert")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeAnomalyDetectionExecutions
{{baseUrl}}/DescribeAnomalyDetectionExecutions
BODY json
{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeAnomalyDetectionExecutions");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeAnomalyDetectionExecutions" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:Timestamp ""
:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/DescribeAnomalyDetectionExecutions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DescribeAnomalyDetectionExecutions"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DescribeAnomalyDetectionExecutions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeAnomalyDetectionExecutions"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeAnomalyDetectionExecutions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 87
{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeAnomalyDetectionExecutions")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeAnomalyDetectionExecutions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeAnomalyDetectionExecutions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeAnomalyDetectionExecutions")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
Timestamp: '',
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeAnomalyDetectionExecutions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAnomalyDetectionExecutions',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', Timestamp: '', MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeAnomalyDetectionExecutions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","Timestamp":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DescribeAnomalyDetectionExecutions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "Timestamp": "",\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeAnomalyDetectionExecutions")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeAnomalyDetectionExecutions',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: '', Timestamp: '', MaxResults: 0, NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAnomalyDetectionExecutions',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: '', Timestamp: '', MaxResults: 0, NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DescribeAnomalyDetectionExecutions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
Timestamp: '',
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAnomalyDetectionExecutions',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', Timestamp: '', MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeAnomalyDetectionExecutions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","Timestamp":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"Timestamp": @"",
@"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeAnomalyDetectionExecutions"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DescribeAnomalyDetectionExecutions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeAnomalyDetectionExecutions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'Timestamp' => '',
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeAnomalyDetectionExecutions', [
'body' => '{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeAnomalyDetectionExecutions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'Timestamp' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'Timestamp' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DescribeAnomalyDetectionExecutions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeAnomalyDetectionExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeAnomalyDetectionExecutions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeAnomalyDetectionExecutions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeAnomalyDetectionExecutions"
payload = {
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeAnomalyDetectionExecutions"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeAnomalyDetectionExecutions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DescribeAnomalyDetectionExecutions') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"Timestamp\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeAnomalyDetectionExecutions";
let payload = json!({
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeAnomalyDetectionExecutions \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/DescribeAnomalyDetectionExecutions \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "Timestamp": "",\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/DescribeAnomalyDetectionExecutions
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"Timestamp": "",
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeAnomalyDetectionExecutions")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeAnomalyDetector
{{baseUrl}}/DescribeAnomalyDetector
BODY json
{
"AnomalyDetectorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorArn ""}})
require "http/client"
url = "{{baseUrl}}/DescribeAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DescribeAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DescribeAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"AnomalyDetectorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DescribeAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DescribeAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DescribeAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeAnomalyDetector', [
'body' => '{
"AnomalyDetectorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DescribeAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeAnomalyDetector"
payload = { "AnomalyDetectorArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeAnomalyDetector"
payload <- "{\n \"AnomalyDetectorArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DescribeAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeAnomalyDetector";
let payload = json!({"AnomalyDetectorArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": ""
}'
echo '{
"AnomalyDetectorArn": ""
}' | \
http POST {{baseUrl}}/DescribeAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": ""\n}' \
--output-document \
- {{baseUrl}}/DescribeAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["AnomalyDetectorArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DescribeMetricSet
{{baseUrl}}/DescribeMetricSet
BODY json
{
"MetricSetArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DescribeMetricSet");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MetricSetArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DescribeMetricSet" {:content-type :json
:form-params {:MetricSetArn ""}})
require "http/client"
url = "{{baseUrl}}/DescribeMetricSet"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"MetricSetArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DescribeMetricSet"),
Content = new StringContent("{\n \"MetricSetArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DescribeMetricSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MetricSetArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DescribeMetricSet"
payload := strings.NewReader("{\n \"MetricSetArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DescribeMetricSet HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 24
{
"MetricSetArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DescribeMetricSet")
.setHeader("content-type", "application/json")
.setBody("{\n \"MetricSetArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DescribeMetricSet"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MetricSetArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MetricSetArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DescribeMetricSet")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DescribeMetricSet")
.header("content-type", "application/json")
.body("{\n \"MetricSetArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
MetricSetArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DescribeMetricSet');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeMetricSet',
headers: {'content-type': 'application/json'},
data: {MetricSetArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DescribeMetricSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MetricSetArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DescribeMetricSet',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "MetricSetArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MetricSetArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DescribeMetricSet")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DescribeMetricSet',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MetricSetArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeMetricSet',
headers: {'content-type': 'application/json'},
body: {MetricSetArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DescribeMetricSet');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
MetricSetArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DescribeMetricSet',
headers: {'content-type': 'application/json'},
data: {MetricSetArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DescribeMetricSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MetricSetArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MetricSetArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DescribeMetricSet"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DescribeMetricSet" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"MetricSetArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DescribeMetricSet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MetricSetArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DescribeMetricSet', [
'body' => '{
"MetricSetArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DescribeMetricSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MetricSetArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MetricSetArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/DescribeMetricSet');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DescribeMetricSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MetricSetArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DescribeMetricSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MetricSetArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MetricSetArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DescribeMetricSet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DescribeMetricSet"
payload = { "MetricSetArn": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DescribeMetricSet"
payload <- "{\n \"MetricSetArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DescribeMetricSet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"MetricSetArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DescribeMetricSet') do |req|
req.body = "{\n \"MetricSetArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DescribeMetricSet";
let payload = json!({"MetricSetArn": ""});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DescribeMetricSet \
--header 'content-type: application/json' \
--data '{
"MetricSetArn": ""
}'
echo '{
"MetricSetArn": ""
}' | \
http POST {{baseUrl}}/DescribeMetricSet \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "MetricSetArn": ""\n}' \
--output-document \
- {{baseUrl}}/DescribeMetricSet
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["MetricSetArn": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DescribeMetricSet")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
DetectMetricSetConfig
{{baseUrl}}/DetectMetricSetConfig
BODY json
{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/DetectMetricSetConfig");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/DetectMetricSetConfig" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:AutoDetectionMetricSource {:S3SourceConfig ""}}})
require "http/client"
url = "{{baseUrl}}/DetectMetricSetConfig"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/DetectMetricSetConfig"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/DetectMetricSetConfig");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/DetectMetricSetConfig"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/DetectMetricSetConfig HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 93
{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/DetectMetricSetConfig")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/DetectMetricSetConfig"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/DetectMetricSetConfig")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/DetectMetricSetConfig")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
AutoDetectionMetricSource: {
S3SourceConfig: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/DetectMetricSetConfig');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/DetectMetricSetConfig',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', AutoDetectionMetricSource: {S3SourceConfig: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/DetectMetricSetConfig';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AutoDetectionMetricSource":{"S3SourceConfig":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/DetectMetricSetConfig',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "AutoDetectionMetricSource": {\n "S3SourceConfig": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/DetectMetricSetConfig")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/DetectMetricSetConfig',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: '', AutoDetectionMetricSource: {S3SourceConfig: ''}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/DetectMetricSetConfig',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: '', AutoDetectionMetricSource: {S3SourceConfig: ''}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/DetectMetricSetConfig');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
AutoDetectionMetricSource: {
S3SourceConfig: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/DetectMetricSetConfig',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', AutoDetectionMetricSource: {S3SourceConfig: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/DetectMetricSetConfig';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AutoDetectionMetricSource":{"S3SourceConfig":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"AutoDetectionMetricSource": @{ @"S3SourceConfig": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/DetectMetricSetConfig"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/DetectMetricSetConfig" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/DetectMetricSetConfig",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'AutoDetectionMetricSource' => [
'S3SourceConfig' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/DetectMetricSetConfig', [
'body' => '{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/DetectMetricSetConfig');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'AutoDetectionMetricSource' => [
'S3SourceConfig' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'AutoDetectionMetricSource' => [
'S3SourceConfig' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/DetectMetricSetConfig');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/DetectMetricSetConfig' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/DetectMetricSetConfig' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/DetectMetricSetConfig", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/DetectMetricSetConfig"
payload = {
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": { "S3SourceConfig": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/DetectMetricSetConfig"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/DetectMetricSetConfig")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/DetectMetricSetConfig') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AutoDetectionMetricSource\": {\n \"S3SourceConfig\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/DetectMetricSetConfig";
let payload = json!({
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": json!({"S3SourceConfig": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/DetectMetricSetConfig \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}'
echo '{
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": {
"S3SourceConfig": ""
}
}' | \
http POST {{baseUrl}}/DetectMetricSetConfig \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "AutoDetectionMetricSource": {\n "S3SourceConfig": ""\n }\n}' \
--output-document \
- {{baseUrl}}/DetectMetricSetConfig
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"AutoDetectionMetricSource": ["S3SourceConfig": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/DetectMetricSetConfig")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetAnomalyGroup
{{baseUrl}}/GetAnomalyGroup
BODY json
{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GetAnomalyGroup");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GetAnomalyGroup" {:content-type :json
:form-params {:AnomalyGroupId ""
:AnomalyDetectorArn ""}})
require "http/client"
url = "{{baseUrl}}/GetAnomalyGroup"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/GetAnomalyGroup"),
Content = new StringContent("{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/GetAnomalyGroup");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GetAnomalyGroup"
payload := strings.NewReader("{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/GetAnomalyGroup HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GetAnomalyGroup")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GetAnomalyGroup"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GetAnomalyGroup")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GetAnomalyGroup")
.header("content-type", "application/json")
.body("{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyGroupId: '',
AnomalyDetectorArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GetAnomalyGroup');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GetAnomalyGroup',
headers: {'content-type': 'application/json'},
data: {AnomalyGroupId: '', AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GetAnomalyGroup';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyGroupId":"","AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/GetAnomalyGroup',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyGroupId": "",\n "AnomalyDetectorArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GetAnomalyGroup")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/GetAnomalyGroup',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyGroupId: '', AnomalyDetectorArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GetAnomalyGroup',
headers: {'content-type': 'application/json'},
body: {AnomalyGroupId: '', AnomalyDetectorArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/GetAnomalyGroup');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyGroupId: '',
AnomalyDetectorArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/GetAnomalyGroup',
headers: {'content-type': 'application/json'},
data: {AnomalyGroupId: '', AnomalyDetectorArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GetAnomalyGroup';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyGroupId":"","AnomalyDetectorArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyGroupId": @"",
@"AnomalyDetectorArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GetAnomalyGroup"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/GetAnomalyGroup" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GetAnomalyGroup",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyGroupId' => '',
'AnomalyDetectorArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/GetAnomalyGroup', [
'body' => '{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GetAnomalyGroup');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyGroupId' => '',
'AnomalyDetectorArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyGroupId' => '',
'AnomalyDetectorArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/GetAnomalyGroup');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/GetAnomalyGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GetAnomalyGroup' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GetAnomalyGroup", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GetAnomalyGroup"
payload = {
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GetAnomalyGroup"
payload <- "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/GetAnomalyGroup")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/GetAnomalyGroup') do |req|
req.body = "{\n \"AnomalyGroupId\": \"\",\n \"AnomalyDetectorArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GetAnomalyGroup";
let payload = json!({
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/GetAnomalyGroup \
--header 'content-type: application/json' \
--data '{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}'
echo '{
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
}' | \
http POST {{baseUrl}}/GetAnomalyGroup \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyGroupId": "",\n "AnomalyDetectorArn": ""\n}' \
--output-document \
- {{baseUrl}}/GetAnomalyGroup
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyGroupId": "",
"AnomalyDetectorArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GetAnomalyGroup")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetDataQualityMetrics
{{baseUrl}}/GetDataQualityMetrics
BODY json
{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GetDataQualityMetrics");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GetDataQualityMetrics" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:MetricSetArn ""}})
require "http/client"
url = "{{baseUrl}}/GetDataQualityMetrics"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/GetDataQualityMetrics"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/GetDataQualityMetrics");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GetDataQualityMetrics"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/GetDataQualityMetrics HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 52
{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GetDataQualityMetrics")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GetDataQualityMetrics"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GetDataQualityMetrics")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GetDataQualityMetrics")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
MetricSetArn: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GetDataQualityMetrics');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GetDataQualityMetrics',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', MetricSetArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GetDataQualityMetrics';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","MetricSetArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/GetDataQualityMetrics',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "MetricSetArn": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GetDataQualityMetrics")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/GetDataQualityMetrics',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: '', MetricSetArn: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GetDataQualityMetrics',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: '', MetricSetArn: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/GetDataQualityMetrics');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
MetricSetArn: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/GetDataQualityMetrics',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', MetricSetArn: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GetDataQualityMetrics';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","MetricSetArn":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"MetricSetArn": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GetDataQualityMetrics"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/GetDataQualityMetrics" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GetDataQualityMetrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'MetricSetArn' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/GetDataQualityMetrics', [
'body' => '{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GetDataQualityMetrics');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'MetricSetArn' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'MetricSetArn' => ''
]));
$request->setRequestUrl('{{baseUrl}}/GetDataQualityMetrics');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/GetDataQualityMetrics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GetDataQualityMetrics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GetDataQualityMetrics", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GetDataQualityMetrics"
payload = {
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GetDataQualityMetrics"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/GetDataQualityMetrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/GetDataQualityMetrics') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"MetricSetArn\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GetDataQualityMetrics";
let payload = json!({
"AnomalyDetectorArn": "",
"MetricSetArn": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/GetDataQualityMetrics \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}'
echo '{
"AnomalyDetectorArn": "",
"MetricSetArn": ""
}' | \
http POST {{baseUrl}}/GetDataQualityMetrics \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "MetricSetArn": ""\n}' \
--output-document \
- {{baseUrl}}/GetDataQualityMetrics
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"MetricSetArn": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GetDataQualityMetrics")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetFeedback
{{baseUrl}}/GetFeedback
BODY json
{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GetFeedback");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GetFeedback" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:AnomalyGroupTimeSeriesFeedback {:AnomalyGroupId ""
:TimeSeriesId ""}
:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/GetFeedback"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/GetFeedback"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/GetFeedback");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GetFeedback"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/GetFeedback HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 160
{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GetFeedback")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GetFeedback"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GetFeedback")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GetFeedback")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {
AnomalyGroupId: '',
TimeSeriesId: ''
},
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GetFeedback');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GetFeedback',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: ''},
MaxResults: 0,
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GetFeedback';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupTimeSeriesFeedback":{"AnomalyGroupId":"","TimeSeriesId":""},"MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/GetFeedback',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupTimeSeriesFeedback": {\n "AnomalyGroupId": "",\n "TimeSeriesId": ""\n },\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GetFeedback")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/GetFeedback',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: ''},
MaxResults: 0,
NextToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GetFeedback',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: ''},
MaxResults: 0,
NextToken: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/GetFeedback');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {
AnomalyGroupId: '',
TimeSeriesId: ''
},
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/GetFeedback',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: ''},
MaxResults: 0,
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GetFeedback';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupTimeSeriesFeedback":{"AnomalyGroupId":"","TimeSeriesId":""},"MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"AnomalyGroupTimeSeriesFeedback": @{ @"AnomalyGroupId": @"", @"TimeSeriesId": @"" },
@"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GetFeedback"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/GetFeedback" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GetFeedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupTimeSeriesFeedback' => [
'AnomalyGroupId' => '',
'TimeSeriesId' => ''
],
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/GetFeedback', [
'body' => '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GetFeedback');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupTimeSeriesFeedback' => [
'AnomalyGroupId' => '',
'TimeSeriesId' => ''
],
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupTimeSeriesFeedback' => [
'AnomalyGroupId' => '',
'TimeSeriesId' => ''
],
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/GetFeedback');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/GetFeedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GetFeedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GetFeedback", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GetFeedback"
payload = {
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GetFeedback"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/GetFeedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/GetFeedback') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\"\n },\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GetFeedback";
let payload = json!({
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": json!({
"AnomalyGroupId": "",
"TimeSeriesId": ""
}),
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/GetFeedback \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": ""
},
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/GetFeedback \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupTimeSeriesFeedback": {\n "AnomalyGroupId": "",\n "TimeSeriesId": ""\n },\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/GetFeedback
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": [
"AnomalyGroupId": "",
"TimeSeriesId": ""
],
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GetFeedback")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
GetSampleData
{{baseUrl}}/GetSampleData
BODY json
{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/GetSampleData");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/GetSampleData" {:content-type :json
:form-params {:S3SourceConfig {:RoleArn ""
:TemplatedPathList ""
:HistoricalDataPathList ""
:FileFormatDescriptor {:CsvFormatDescriptor ""
:JsonFormatDescriptor ""}}}})
require "http/client"
url = "{{baseUrl}}/GetSampleData"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/GetSampleData"),
Content = new StringContent("{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/GetSampleData");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/GetSampleData"
payload := strings.NewReader("{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/GetSampleData HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 213
{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/GetSampleData")
.setHeader("content-type", "application/json")
.setBody("{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/GetSampleData"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/GetSampleData")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/GetSampleData")
.header("content-type", "application/json")
.body("{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}")
.asString();
const data = JSON.stringify({
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: {
CsvFormatDescriptor: '',
JsonFormatDescriptor: ''
}
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/GetSampleData');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/GetSampleData',
headers: {'content-type': 'application/json'},
data: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: {CsvFormatDescriptor: '', JsonFormatDescriptor: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/GetSampleData';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"S3SourceConfig":{"RoleArn":"","TemplatedPathList":"","HistoricalDataPathList":"","FileFormatDescriptor":{"CsvFormatDescriptor":"","JsonFormatDescriptor":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/GetSampleData',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "S3SourceConfig": {\n "RoleArn": "",\n "TemplatedPathList": "",\n "HistoricalDataPathList": "",\n "FileFormatDescriptor": {\n "CsvFormatDescriptor": "",\n "JsonFormatDescriptor": ""\n }\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/GetSampleData")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/GetSampleData',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: {CsvFormatDescriptor: '', JsonFormatDescriptor: ''}
}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/GetSampleData',
headers: {'content-type': 'application/json'},
body: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: {CsvFormatDescriptor: '', JsonFormatDescriptor: ''}
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/GetSampleData');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: {
CsvFormatDescriptor: '',
JsonFormatDescriptor: ''
}
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/GetSampleData',
headers: {'content-type': 'application/json'},
data: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: {CsvFormatDescriptor: '', JsonFormatDescriptor: ''}
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/GetSampleData';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"S3SourceConfig":{"RoleArn":"","TemplatedPathList":"","HistoricalDataPathList":"","FileFormatDescriptor":{"CsvFormatDescriptor":"","JsonFormatDescriptor":""}}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"S3SourceConfig": @{ @"RoleArn": @"", @"TemplatedPathList": @"", @"HistoricalDataPathList": @"", @"FileFormatDescriptor": @{ @"CsvFormatDescriptor": @"", @"JsonFormatDescriptor": @"" } } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/GetSampleData"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/GetSampleData" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/GetSampleData",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => [
'CsvFormatDescriptor' => '',
'JsonFormatDescriptor' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/GetSampleData', [
'body' => '{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/GetSampleData');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => [
'CsvFormatDescriptor' => '',
'JsonFormatDescriptor' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => [
'CsvFormatDescriptor' => '',
'JsonFormatDescriptor' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/GetSampleData');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/GetSampleData' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/GetSampleData' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/GetSampleData", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/GetSampleData"
payload = { "S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/GetSampleData"
payload <- "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/GetSampleData")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/GetSampleData') do |req|
req.body = "{\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": {\n \"CsvFormatDescriptor\": \"\",\n \"JsonFormatDescriptor\": \"\"\n }\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/GetSampleData";
let payload = json!({"S3SourceConfig": json!({
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": json!({
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
})
})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/GetSampleData \
--header 'content-type: application/json' \
--data '{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}'
echo '{
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": {
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
}
}
}' | \
http POST {{baseUrl}}/GetSampleData \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "S3SourceConfig": {\n "RoleArn": "",\n "TemplatedPathList": "",\n "HistoricalDataPathList": "",\n "FileFormatDescriptor": {\n "CsvFormatDescriptor": "",\n "JsonFormatDescriptor": ""\n }\n }\n}' \
--output-document \
- {{baseUrl}}/GetSampleData
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["S3SourceConfig": [
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": [
"CsvFormatDescriptor": "",
"JsonFormatDescriptor": ""
]
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/GetSampleData")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListAlerts
{{baseUrl}}/ListAlerts
BODY json
{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListAlerts");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListAlerts" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:NextToken ""
:MaxResults 0}})
require "http/client"
url = "{{baseUrl}}/ListAlerts"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ListAlerts"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ListAlerts");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ListAlerts"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListAlerts HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 68
{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListAlerts")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ListAlerts"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ListAlerts")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListAlerts")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
NextToken: '',
MaxResults: 0
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ListAlerts');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAlerts',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', NextToken: '', MaxResults: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListAlerts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","NextToken":"","MaxResults":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ListAlerts',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "NextToken": "",\n "MaxResults": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ListAlerts")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListAlerts',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: '', NextToken: '', MaxResults: 0}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAlerts',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: '', NextToken: '', MaxResults: 0},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ListAlerts');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
NextToken: '',
MaxResults: 0
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAlerts',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', NextToken: '', MaxResults: 0}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ListAlerts';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","NextToken":"","MaxResults":0}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"NextToken": @"",
@"MaxResults": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ListAlerts"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ListAlerts" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ListAlerts",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'NextToken' => '',
'MaxResults' => 0
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListAlerts', [
'body' => '{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListAlerts');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'NextToken' => '',
'MaxResults' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'NextToken' => '',
'MaxResults' => 0
]));
$request->setRequestUrl('{{baseUrl}}/ListAlerts');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListAlerts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListAlerts' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListAlerts", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListAlerts"
payload = {
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListAlerts"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListAlerts")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ListAlerts') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"NextToken\": \"\",\n \"MaxResults\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ListAlerts";
let payload = json!({
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListAlerts \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}'
echo '{
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
}' | \
http POST {{baseUrl}}/ListAlerts \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "NextToken": "",\n "MaxResults": 0\n}' \
--output-document \
- {{baseUrl}}/ListAlerts
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"NextToken": "",
"MaxResults": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ListAlerts")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListAnomalyDetectors
{{baseUrl}}/ListAnomalyDetectors
BODY json
{
"MaxResults": 0,
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListAnomalyDetectors");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListAnomalyDetectors" {:content-type :json
:form-params {:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/ListAnomalyDetectors"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ListAnomalyDetectors"),
Content = new StringContent("{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ListAnomalyDetectors");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ListAnomalyDetectors"
payload := strings.NewReader("{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListAnomalyDetectors HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 40
{
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListAnomalyDetectors")
.setHeader("content-type", "application/json")
.setBody("{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ListAnomalyDetectors"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ListAnomalyDetectors")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListAnomalyDetectors")
.header("content-type", "application/json")
.body("{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ListAnomalyDetectors');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyDetectors',
headers: {'content-type': 'application/json'},
data: {MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListAnomalyDetectors';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ListAnomalyDetectors',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ListAnomalyDetectors")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListAnomalyDetectors',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({MaxResults: 0, NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyDetectors',
headers: {'content-type': 'application/json'},
body: {MaxResults: 0, NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ListAnomalyDetectors');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyDetectors',
headers: {'content-type': 'application/json'},
data: {MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ListAnomalyDetectors';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ListAnomalyDetectors"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ListAnomalyDetectors" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ListAnomalyDetectors",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListAnomalyDetectors', [
'body' => '{
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListAnomalyDetectors');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ListAnomalyDetectors');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListAnomalyDetectors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListAnomalyDetectors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListAnomalyDetectors", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListAnomalyDetectors"
payload = {
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListAnomalyDetectors"
payload <- "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListAnomalyDetectors")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ListAnomalyDetectors') do |req|
req.body = "{\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ListAnomalyDetectors";
let payload = json!({
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListAnomalyDetectors \
--header 'content-type: application/json' \
--data '{
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/ListAnomalyDetectors \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/ListAnomalyDetectors
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ListAnomalyDetectors")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListAnomalyGroupRelatedMetrics");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListAnomalyGroupRelatedMetrics" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:AnomalyGroupId ""
:RelationshipTypeFilter ""
:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/ListAnomalyGroupRelatedMetrics"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ListAnomalyGroupRelatedMetrics"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ListAnomalyGroupRelatedMetrics");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ListAnomalyGroupRelatedMetrics"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListAnomalyGroupRelatedMetrics HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 124
{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListAnomalyGroupRelatedMetrics")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ListAnomalyGroupRelatedMetrics"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ListAnomalyGroupRelatedMetrics")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListAnomalyGroupRelatedMetrics")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupId: '',
RelationshipTypeFilter: '',
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ListAnomalyGroupRelatedMetrics');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupRelatedMetrics',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupId: '',
RelationshipTypeFilter: '',
MaxResults: 0,
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListAnomalyGroupRelatedMetrics';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupId":"","RelationshipTypeFilter":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ListAnomalyGroupRelatedMetrics',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupId": "",\n "RelationshipTypeFilter": "",\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ListAnomalyGroupRelatedMetrics")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListAnomalyGroupRelatedMetrics',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupId: '',
RelationshipTypeFilter: '',
MaxResults: 0,
NextToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupRelatedMetrics',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorArn: '',
AnomalyGroupId: '',
RelationshipTypeFilter: '',
MaxResults: 0,
NextToken: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ListAnomalyGroupRelatedMetrics');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
AnomalyGroupId: '',
RelationshipTypeFilter: '',
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupRelatedMetrics',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupId: '',
RelationshipTypeFilter: '',
MaxResults: 0,
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ListAnomalyGroupRelatedMetrics';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupId":"","RelationshipTypeFilter":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"AnomalyGroupId": @"",
@"RelationshipTypeFilter": @"",
@"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ListAnomalyGroupRelatedMetrics"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ListAnomalyGroupRelatedMetrics" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ListAnomalyGroupRelatedMetrics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupId' => '',
'RelationshipTypeFilter' => '',
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListAnomalyGroupRelatedMetrics', [
'body' => '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListAnomalyGroupRelatedMetrics');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupId' => '',
'RelationshipTypeFilter' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupId' => '',
'RelationshipTypeFilter' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ListAnomalyGroupRelatedMetrics');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListAnomalyGroupRelatedMetrics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListAnomalyGroupRelatedMetrics' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListAnomalyGroupRelatedMetrics", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListAnomalyGroupRelatedMetrics"
payload = {
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListAnomalyGroupRelatedMetrics"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListAnomalyGroupRelatedMetrics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ListAnomalyGroupRelatedMetrics') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"RelationshipTypeFilter\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ListAnomalyGroupRelatedMetrics";
let payload = json!({
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListAnomalyGroupRelatedMetrics \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/ListAnomalyGroupRelatedMetrics \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupId": "",\n "RelationshipTypeFilter": "",\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/ListAnomalyGroupRelatedMetrics
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"RelationshipTypeFilter": "",
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ListAnomalyGroupRelatedMetrics")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListAnomalyGroupSummaries
{{baseUrl}}/ListAnomalyGroupSummaries
BODY json
{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListAnomalyGroupSummaries");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListAnomalyGroupSummaries" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:SensitivityThreshold 0
:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/ListAnomalyGroupSummaries"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ListAnomalyGroupSummaries"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ListAnomalyGroupSummaries");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ListAnomalyGroupSummaries"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListAnomalyGroupSummaries HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 97
{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListAnomalyGroupSummaries")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ListAnomalyGroupSummaries"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ListAnomalyGroupSummaries")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListAnomalyGroupSummaries")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
SensitivityThreshold: 0,
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ListAnomalyGroupSummaries');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupSummaries',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', SensitivityThreshold: 0, MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListAnomalyGroupSummaries';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","SensitivityThreshold":0,"MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ListAnomalyGroupSummaries',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "SensitivityThreshold": 0,\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ListAnomalyGroupSummaries")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListAnomalyGroupSummaries',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: '', SensitivityThreshold: 0, MaxResults: 0, NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupSummaries',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: '', SensitivityThreshold: 0, MaxResults: 0, NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ListAnomalyGroupSummaries');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
SensitivityThreshold: 0,
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupSummaries',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', SensitivityThreshold: 0, MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ListAnomalyGroupSummaries';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","SensitivityThreshold":0,"MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"SensitivityThreshold": @0,
@"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ListAnomalyGroupSummaries"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ListAnomalyGroupSummaries" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ListAnomalyGroupSummaries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'SensitivityThreshold' => 0,
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListAnomalyGroupSummaries', [
'body' => '{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListAnomalyGroupSummaries');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'SensitivityThreshold' => 0,
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'SensitivityThreshold' => 0,
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ListAnomalyGroupSummaries');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListAnomalyGroupSummaries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListAnomalyGroupSummaries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListAnomalyGroupSummaries", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListAnomalyGroupSummaries"
payload = {
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListAnomalyGroupSummaries"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListAnomalyGroupSummaries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ListAnomalyGroupSummaries') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"SensitivityThreshold\": 0,\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ListAnomalyGroupSummaries";
let payload = json!({
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListAnomalyGroupSummaries \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/ListAnomalyGroupSummaries \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "SensitivityThreshold": 0,\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/ListAnomalyGroupSummaries
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"SensitivityThreshold": 0,
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ListAnomalyGroupSummaries")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListAnomalyGroupTimeSeries
{{baseUrl}}/ListAnomalyGroupTimeSeries
BODY json
{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListAnomalyGroupTimeSeries");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListAnomalyGroupTimeSeries" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:AnomalyGroupId ""
:MetricName ""
:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/ListAnomalyGroupTimeSeries"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ListAnomalyGroupTimeSeries"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ListAnomalyGroupTimeSeries");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ListAnomalyGroupTimeSeries"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListAnomalyGroupTimeSeries HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 112
{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListAnomalyGroupTimeSeries")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ListAnomalyGroupTimeSeries"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ListAnomalyGroupTimeSeries")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListAnomalyGroupTimeSeries")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupId: '',
MetricName: '',
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ListAnomalyGroupTimeSeries');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupTimeSeries',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupId: '',
MetricName: '',
MaxResults: 0,
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListAnomalyGroupTimeSeries';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupId":"","MetricName":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ListAnomalyGroupTimeSeries',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupId": "",\n "MetricName": "",\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ListAnomalyGroupTimeSeries")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListAnomalyGroupTimeSeries',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupId: '',
MetricName: '',
MaxResults: 0,
NextToken: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupTimeSeries',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorArn: '',
AnomalyGroupId: '',
MetricName: '',
MaxResults: 0,
NextToken: ''
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ListAnomalyGroupTimeSeries');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
AnomalyGroupId: '',
MetricName: '',
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ListAnomalyGroupTimeSeries',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupId: '',
MetricName: '',
MaxResults: 0,
NextToken: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ListAnomalyGroupTimeSeries';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupId":"","MetricName":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"AnomalyGroupId": @"",
@"MetricName": @"",
@"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ListAnomalyGroupTimeSeries"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ListAnomalyGroupTimeSeries" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ListAnomalyGroupTimeSeries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupId' => '',
'MetricName' => '',
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListAnomalyGroupTimeSeries', [
'body' => '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListAnomalyGroupTimeSeries');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupId' => '',
'MetricName' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupId' => '',
'MetricName' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ListAnomalyGroupTimeSeries');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListAnomalyGroupTimeSeries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListAnomalyGroupTimeSeries' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListAnomalyGroupTimeSeries", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListAnomalyGroupTimeSeries"
payload = {
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListAnomalyGroupTimeSeries"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListAnomalyGroupTimeSeries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ListAnomalyGroupTimeSeries') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupId\": \"\",\n \"MetricName\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ListAnomalyGroupTimeSeries";
let payload = json!({
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListAnomalyGroupTimeSeries \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/ListAnomalyGroupTimeSeries \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupId": "",\n "MetricName": "",\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/ListAnomalyGroupTimeSeries
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"AnomalyGroupId": "",
"MetricName": "",
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ListAnomalyGroupTimeSeries")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
ListMetricSets
{{baseUrl}}/ListMetricSets
BODY json
{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/ListMetricSets");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/ListMetricSets" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:MaxResults 0
:NextToken ""}})
require "http/client"
url = "{{baseUrl}}/ListMetricSets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/ListMetricSets"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/ListMetricSets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/ListMetricSets"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/ListMetricSets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 68
{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/ListMetricSets")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/ListMetricSets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/ListMetricSets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/ListMetricSets")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
MaxResults: 0,
NextToken: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/ListMetricSets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/ListMetricSets',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/ListMetricSets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/ListMetricSets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "MaxResults": 0,\n "NextToken": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/ListMetricSets")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/ListMetricSets',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({AnomalyDetectorArn: '', MaxResults: 0, NextToken: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/ListMetricSets',
headers: {'content-type': 'application/json'},
body: {AnomalyDetectorArn: '', MaxResults: 0, NextToken: ''},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/ListMetricSets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
MaxResults: 0,
NextToken: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/ListMetricSets',
headers: {'content-type': 'application/json'},
data: {AnomalyDetectorArn: '', MaxResults: 0, NextToken: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/ListMetricSets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","MaxResults":0,"NextToken":""}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"MaxResults": @0,
@"NextToken": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/ListMetricSets"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/ListMetricSets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/ListMetricSets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'MaxResults' => 0,
'NextToken' => ''
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/ListMetricSets', [
'body' => '{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/ListMetricSets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'MaxResults' => 0,
'NextToken' => ''
]));
$request->setRequestUrl('{{baseUrl}}/ListMetricSets');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/ListMetricSets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/ListMetricSets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/ListMetricSets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/ListMetricSets"
payload = {
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/ListMetricSets"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/ListMetricSets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/ListMetricSets') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"MaxResults\": 0,\n \"NextToken\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/ListMetricSets";
let payload = json!({
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/ListMetricSets \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}'
echo '{
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
}' | \
http POST {{baseUrl}}/ListMetricSets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "MaxResults": 0,\n "NextToken": ""\n}' \
--output-document \
- {{baseUrl}}/ListMetricSets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"MaxResults": 0,
"NextToken": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/ListMetricSets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
ListTagsForResource
{{baseUrl}}/tags/:resourceArn
QUERY PARAMS
resourceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/tags/:resourceArn")
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn"
response = HTTP::Client.get url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Get,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
GET /baseUrl/tags/:resourceArn HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/tags/:resourceArn")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn"))
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/tags/:resourceArn")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('GET', '{{baseUrl}}/tags/:resourceArn');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tags/:resourceArn',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/tags/:resourceArn');
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {method: 'GET', url: '{{baseUrl}}/tags/:resourceArn'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"GET"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tags/:resourceArn" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('GET', '{{baseUrl}}/tags/:resourceArn');
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tags/:resourceArn');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/tags/:resourceArn")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.get('/baseUrl/tags/:resourceArn') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/tags/:resourceArn
http GET {{baseUrl}}/tags/:resourceArn
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/tags/:resourceArn
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "GET"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
PutFeedback
{{baseUrl}}/PutFeedback
BODY json
{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/PutFeedback");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/PutFeedback" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:AnomalyGroupTimeSeriesFeedback {:AnomalyGroupId ""
:TimeSeriesId ""
:IsAnomaly ""}}})
require "http/client"
url = "{{baseUrl}}/PutFeedback"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/PutFeedback"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/PutFeedback");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/PutFeedback"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/PutFeedback HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 143
{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/PutFeedback")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/PutFeedback"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/PutFeedback")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/PutFeedback")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {
AnomalyGroupId: '',
TimeSeriesId: '',
IsAnomaly: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/PutFeedback');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/PutFeedback',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: '', IsAnomaly: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/PutFeedback';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupTimeSeriesFeedback":{"AnomalyGroupId":"","TimeSeriesId":"","IsAnomaly":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/PutFeedback',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupTimeSeriesFeedback": {\n "AnomalyGroupId": "",\n "TimeSeriesId": "",\n "IsAnomaly": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/PutFeedback")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/PutFeedback',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: '', IsAnomaly: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/PutFeedback',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: '', IsAnomaly: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/PutFeedback');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {
AnomalyGroupId: '',
TimeSeriesId: '',
IsAnomaly: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/PutFeedback',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
AnomalyGroupTimeSeriesFeedback: {AnomalyGroupId: '', TimeSeriesId: '', IsAnomaly: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/PutFeedback';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","AnomalyGroupTimeSeriesFeedback":{"AnomalyGroupId":"","TimeSeriesId":"","IsAnomaly":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"AnomalyGroupTimeSeriesFeedback": @{ @"AnomalyGroupId": @"", @"TimeSeriesId": @"", @"IsAnomaly": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/PutFeedback"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/PutFeedback" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/PutFeedback",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupTimeSeriesFeedback' => [
'AnomalyGroupId' => '',
'TimeSeriesId' => '',
'IsAnomaly' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/PutFeedback', [
'body' => '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/PutFeedback');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupTimeSeriesFeedback' => [
'AnomalyGroupId' => '',
'TimeSeriesId' => '',
'IsAnomaly' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'AnomalyGroupTimeSeriesFeedback' => [
'AnomalyGroupId' => '',
'TimeSeriesId' => '',
'IsAnomaly' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/PutFeedback');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/PutFeedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/PutFeedback' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/PutFeedback", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/PutFeedback"
payload = {
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/PutFeedback"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/PutFeedback")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/PutFeedback') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"AnomalyGroupTimeSeriesFeedback\": {\n \"AnomalyGroupId\": \"\",\n \"TimeSeriesId\": \"\",\n \"IsAnomaly\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/PutFeedback";
let payload = json!({
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": json!({
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/PutFeedback \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}'
echo '{
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": {
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
}
}' | \
http POST {{baseUrl}}/PutFeedback \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "AnomalyGroupTimeSeriesFeedback": {\n "AnomalyGroupId": "",\n "TimeSeriesId": "",\n "IsAnomaly": ""\n }\n}' \
--output-document \
- {{baseUrl}}/PutFeedback
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"AnomalyGroupTimeSeriesFeedback": [
"AnomalyGroupId": "",
"TimeSeriesId": "",
"IsAnomaly": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/PutFeedback")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
TagResource
{{baseUrl}}/tags/:resourceArn
QUERY PARAMS
resourceArn
BODY json
{
"tags": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"tags\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/tags/:resourceArn" {:content-type :json
:form-params {:tags {}}})
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"tags\": {}\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn"),
Content = new StringContent("{\n \"tags\": {}\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"tags\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn"
payload := strings.NewReader("{\n \"tags\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/tags/:resourceArn HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 16
{
"tags": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/tags/:resourceArn")
.setHeader("content-type", "application/json")
.setBody("{\n \"tags\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"tags\": {}\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"tags\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/tags/:resourceArn")
.header("content-type", "application/json")
.body("{\n \"tags\": {}\n}")
.asString();
const data = JSON.stringify({
tags: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/tags/:resourceArn');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
data: {tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tags/:resourceArn',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "tags": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"tags\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({tags: {}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
body: {tags: {}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/tags/:resourceArn');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
tags: {}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/tags/:resourceArn',
headers: {'content-type': 'application/json'},
data: {tags: {}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"tags":{}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"tags": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tags/:resourceArn" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"tags\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tags' => [
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/tags/:resourceArn', [
'body' => '{
"tags": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'tags' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'tags' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/tags/:resourceArn');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"tags": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"tags\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/tags/:resourceArn", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn"
payload = { "tags": {} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn"
payload <- "{\n \"tags\": {}\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"tags\": {}\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/tags/:resourceArn') do |req|
req.body = "{\n \"tags\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn";
let payload = json!({"tags": json!({})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/tags/:resourceArn \
--header 'content-type: application/json' \
--data '{
"tags": {}
}'
echo '{
"tags": {}
}' | \
http POST {{baseUrl}}/tags/:resourceArn \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "tags": {}\n}' \
--output-document \
- {{baseUrl}}/tags/:resourceArn
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["tags": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
UntagResource
{{baseUrl}}/tags/:resourceArn#tagKeys
QUERY PARAMS
tagKeys
resourceArn
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/tags/:resourceArn#tagKeys" {:query-params {:tagKeys ""}})
require "http/client"
url = "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"
response = HTTP::Client.delete url
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Delete,
RequestUri = new Uri("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"
req, _ := http.NewRequest("DELETE", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
DELETE /baseUrl/tags/:resourceArn?tagKeys= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"))
.method("DELETE", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.asString();
const data = null;
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('DELETE', '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
params: {tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/tags/:resourceArn?tagKeys=',
headers: {}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.end();
const request = require('request');
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
qs: {tagKeys: ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/tags/:resourceArn#tagKeys');
req.query({
tagKeys: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'DELETE',
url: '{{baseUrl}}/tags/:resourceArn#tagKeys',
params: {tagKeys: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys';
const options = {method: 'DELETE'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"DELETE"];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('DELETE', '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys');
echo $response->getBody();
setUrl('{{baseUrl}}/tags/:resourceArn#tagKeys');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'tagKeys' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/tags/:resourceArn#tagKeys');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'tagKeys' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/tags/:resourceArn?tagKeys=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/tags/:resourceArn#tagKeys"
querystring = {"tagKeys":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/tags/:resourceArn#tagKeys"
queryString <- list(tagKeys = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
)
response = conn.delete('/baseUrl/tags/:resourceArn') do |req|
req.params['tagKeys'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/tags/:resourceArn#tagKeys";
let querystring = [
("tagKeys", ""),
];
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
http DELETE '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys'
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/tags/:resourceArn?tagKeys=#tagKeys")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "DELETE"
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateAlert
{{baseUrl}}/UpdateAlert
BODY json
{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/UpdateAlert");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/UpdateAlert" {:content-type :json
:form-params {:AlertArn ""
:AlertDescription ""
:AlertSensitivityThreshold 0
:Action {:SNSConfiguration ""
:LambdaConfiguration ""}
:AlertFilters {:MetricList ""
:DimensionFilterList ""}}})
require "http/client"
url = "{{baseUrl}}/UpdateAlert"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/UpdateAlert"),
Content = new StringContent("{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/UpdateAlert");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/UpdateAlert"
payload := strings.NewReader("{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/UpdateAlert HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 234
{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/UpdateAlert")
.setHeader("content-type", "application/json")
.setBody("{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/UpdateAlert"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/UpdateAlert")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/UpdateAlert")
.header("content-type", "application/json")
.body("{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
AlertArn: '',
AlertDescription: '',
AlertSensitivityThreshold: 0,
Action: {
SNSConfiguration: '',
LambdaConfiguration: ''
},
AlertFilters: {
MetricList: '',
DimensionFilterList: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/UpdateAlert');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateAlert',
headers: {'content-type': 'application/json'},
data: {
AlertArn: '',
AlertDescription: '',
AlertSensitivityThreshold: 0,
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/UpdateAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertArn":"","AlertDescription":"","AlertSensitivityThreshold":0,"Action":{"SNSConfiguration":"","LambdaConfiguration":""},"AlertFilters":{"MetricList":"","DimensionFilterList":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/UpdateAlert',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AlertArn": "",\n "AlertDescription": "",\n "AlertSensitivityThreshold": 0,\n "Action": {\n "SNSConfiguration": "",\n "LambdaConfiguration": ""\n },\n "AlertFilters": {\n "MetricList": "",\n "DimensionFilterList": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/UpdateAlert")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/UpdateAlert',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AlertArn: '',
AlertDescription: '',
AlertSensitivityThreshold: 0,
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateAlert',
headers: {'content-type': 'application/json'},
body: {
AlertArn: '',
AlertDescription: '',
AlertSensitivityThreshold: 0,
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/UpdateAlert');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AlertArn: '',
AlertDescription: '',
AlertSensitivityThreshold: 0,
Action: {
SNSConfiguration: '',
LambdaConfiguration: ''
},
AlertFilters: {
MetricList: '',
DimensionFilterList: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateAlert',
headers: {'content-type': 'application/json'},
data: {
AlertArn: '',
AlertDescription: '',
AlertSensitivityThreshold: 0,
Action: {SNSConfiguration: '', LambdaConfiguration: ''},
AlertFilters: {MetricList: '', DimensionFilterList: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/UpdateAlert';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AlertArn":"","AlertDescription":"","AlertSensitivityThreshold":0,"Action":{"SNSConfiguration":"","LambdaConfiguration":""},"AlertFilters":{"MetricList":"","DimensionFilterList":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AlertArn": @"",
@"AlertDescription": @"",
@"AlertSensitivityThreshold": @0,
@"Action": @{ @"SNSConfiguration": @"", @"LambdaConfiguration": @"" },
@"AlertFilters": @{ @"MetricList": @"", @"DimensionFilterList": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/UpdateAlert"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/UpdateAlert" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/UpdateAlert",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AlertArn' => '',
'AlertDescription' => '',
'AlertSensitivityThreshold' => 0,
'Action' => [
'SNSConfiguration' => '',
'LambdaConfiguration' => ''
],
'AlertFilters' => [
'MetricList' => '',
'DimensionFilterList' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/UpdateAlert', [
'body' => '{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/UpdateAlert');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AlertArn' => '',
'AlertDescription' => '',
'AlertSensitivityThreshold' => 0,
'Action' => [
'SNSConfiguration' => '',
'LambdaConfiguration' => ''
],
'AlertFilters' => [
'MetricList' => '',
'DimensionFilterList' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AlertArn' => '',
'AlertDescription' => '',
'AlertSensitivityThreshold' => 0,
'Action' => [
'SNSConfiguration' => '',
'LambdaConfiguration' => ''
],
'AlertFilters' => [
'MetricList' => '',
'DimensionFilterList' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/UpdateAlert');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/UpdateAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/UpdateAlert' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/UpdateAlert", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/UpdateAlert"
payload = {
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/UpdateAlert"
payload <- "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/UpdateAlert")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/UpdateAlert') do |req|
req.body = "{\n \"AlertArn\": \"\",\n \"AlertDescription\": \"\",\n \"AlertSensitivityThreshold\": 0,\n \"Action\": {\n \"SNSConfiguration\": \"\",\n \"LambdaConfiguration\": \"\"\n },\n \"AlertFilters\": {\n \"MetricList\": \"\",\n \"DimensionFilterList\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/UpdateAlert";
let payload = json!({
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": json!({
"SNSConfiguration": "",
"LambdaConfiguration": ""
}),
"AlertFilters": json!({
"MetricList": "",
"DimensionFilterList": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/UpdateAlert \
--header 'content-type: application/json' \
--data '{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}'
echo '{
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": {
"SNSConfiguration": "",
"LambdaConfiguration": ""
},
"AlertFilters": {
"MetricList": "",
"DimensionFilterList": ""
}
}' | \
http POST {{baseUrl}}/UpdateAlert \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AlertArn": "",\n "AlertDescription": "",\n "AlertSensitivityThreshold": 0,\n "Action": {\n "SNSConfiguration": "",\n "LambdaConfiguration": ""\n },\n "AlertFilters": {\n "MetricList": "",\n "DimensionFilterList": ""\n }\n}' \
--output-document \
- {{baseUrl}}/UpdateAlert
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AlertArn": "",
"AlertDescription": "",
"AlertSensitivityThreshold": 0,
"Action": [
"SNSConfiguration": "",
"LambdaConfiguration": ""
],
"AlertFilters": [
"MetricList": "",
"DimensionFilterList": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/UpdateAlert")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateAnomalyDetector
{{baseUrl}}/UpdateAnomalyDetector
BODY json
{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/UpdateAnomalyDetector");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/UpdateAnomalyDetector" {:content-type :json
:form-params {:AnomalyDetectorArn ""
:KmsKeyArn ""
:AnomalyDetectorDescription ""
:AnomalyDetectorConfig {:AnomalyDetectorFrequency ""}}})
require "http/client"
url = "{{baseUrl}}/UpdateAnomalyDetector"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/UpdateAnomalyDetector"),
Content = new StringContent("{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/UpdateAnomalyDetector");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/UpdateAnomalyDetector"
payload := strings.NewReader("{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/UpdateAnomalyDetector HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 154
{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/UpdateAnomalyDetector")
.setHeader("content-type", "application/json")
.setBody("{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/UpdateAnomalyDetector"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/UpdateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/UpdateAnomalyDetector")
.header("content-type", "application/json")
.body("{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
AnomalyDetectorArn: '',
KmsKeyArn: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {
AnomalyDetectorFrequency: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/UpdateAnomalyDetector');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
KmsKeyArn: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/UpdateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","KmsKeyArn":"","AnomalyDetectorDescription":"","AnomalyDetectorConfig":{"AnomalyDetectorFrequency":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/UpdateAnomalyDetector',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "AnomalyDetectorArn": "",\n "KmsKeyArn": "",\n "AnomalyDetectorDescription": "",\n "AnomalyDetectorConfig": {\n "AnomalyDetectorFrequency": ""\n }\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/UpdateAnomalyDetector")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/UpdateAnomalyDetector',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
AnomalyDetectorArn: '',
KmsKeyArn: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateAnomalyDetector',
headers: {'content-type': 'application/json'},
body: {
AnomalyDetectorArn: '',
KmsKeyArn: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/UpdateAnomalyDetector');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
AnomalyDetectorArn: '',
KmsKeyArn: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {
AnomalyDetectorFrequency: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateAnomalyDetector',
headers: {'content-type': 'application/json'},
data: {
AnomalyDetectorArn: '',
KmsKeyArn: '',
AnomalyDetectorDescription: '',
AnomalyDetectorConfig: {AnomalyDetectorFrequency: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/UpdateAnomalyDetector';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"AnomalyDetectorArn":"","KmsKeyArn":"","AnomalyDetectorDescription":"","AnomalyDetectorConfig":{"AnomalyDetectorFrequency":""}}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"AnomalyDetectorArn": @"",
@"KmsKeyArn": @"",
@"AnomalyDetectorDescription": @"",
@"AnomalyDetectorConfig": @{ @"AnomalyDetectorFrequency": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/UpdateAnomalyDetector"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/UpdateAnomalyDetector" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/UpdateAnomalyDetector",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'AnomalyDetectorArn' => '',
'KmsKeyArn' => '',
'AnomalyDetectorDescription' => '',
'AnomalyDetectorConfig' => [
'AnomalyDetectorFrequency' => ''
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/UpdateAnomalyDetector', [
'body' => '{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/UpdateAnomalyDetector');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'AnomalyDetectorArn' => '',
'KmsKeyArn' => '',
'AnomalyDetectorDescription' => '',
'AnomalyDetectorConfig' => [
'AnomalyDetectorFrequency' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'AnomalyDetectorArn' => '',
'KmsKeyArn' => '',
'AnomalyDetectorDescription' => '',
'AnomalyDetectorConfig' => [
'AnomalyDetectorFrequency' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/UpdateAnomalyDetector');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/UpdateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/UpdateAnomalyDetector' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/UpdateAnomalyDetector", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/UpdateAnomalyDetector"
payload = {
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": { "AnomalyDetectorFrequency": "" }
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/UpdateAnomalyDetector"
payload <- "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/UpdateAnomalyDetector")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/UpdateAnomalyDetector') do |req|
req.body = "{\n \"AnomalyDetectorArn\": \"\",\n \"KmsKeyArn\": \"\",\n \"AnomalyDetectorDescription\": \"\",\n \"AnomalyDetectorConfig\": {\n \"AnomalyDetectorFrequency\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/UpdateAnomalyDetector";
let payload = json!({
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": json!({"AnomalyDetectorFrequency": ""})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/UpdateAnomalyDetector \
--header 'content-type: application/json' \
--data '{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}'
echo '{
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": {
"AnomalyDetectorFrequency": ""
}
}' | \
http POST {{baseUrl}}/UpdateAnomalyDetector \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "AnomalyDetectorArn": "",\n "KmsKeyArn": "",\n "AnomalyDetectorDescription": "",\n "AnomalyDetectorConfig": {\n "AnomalyDetectorFrequency": ""\n }\n}' \
--output-document \
- {{baseUrl}}/UpdateAnomalyDetector
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"AnomalyDetectorArn": "",
"KmsKeyArn": "",
"AnomalyDetectorDescription": "",
"AnomalyDetectorConfig": ["AnomalyDetectorFrequency": ""]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/UpdateAnomalyDetector")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
UpdateMetricSet
{{baseUrl}}/UpdateMetricSet
BODY json
{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/UpdateMetricSet");
struct curl_slist *headers = NULL;
headers = curl_slist_append(headers, "content-type: application/json");
curl_easy_setopt(hnd, CURLOPT_HTTPHEADER, headers);
curl_easy_setopt(hnd, CURLOPT_POSTFIELDS, "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/UpdateMetricSet" {:content-type :json
:form-params {:MetricSetArn ""
:MetricSetDescription ""
:MetricList [{:MetricName ""
:AggregationFunction ""
:Namespace ""}]
:Offset 0
:TimestampColumn {:ColumnName ""
:ColumnFormat ""}
:DimensionList []
:MetricSetFrequency ""
:MetricSource {:S3SourceConfig {:RoleArn ""
:TemplatedPathList ""
:HistoricalDataPathList ""
:FileFormatDescriptor ""}
:AppFlowConfig ""
:CloudWatchConfig ""
:RDSSourceConfig ""
:RedshiftSourceConfig ""
:AthenaSourceConfig ""}
:DimensionFilterList [{:Name ""
:FilterList ""}]}})
require "http/client"
url = "{{baseUrl}}/UpdateMetricSet"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/UpdateMetricSet"),
Content = new StringContent("{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/UpdateMetricSet");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/UpdateMetricSet"
payload := strings.NewReader("{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/UpdateMetricSet HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 710
{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/UpdateMetricSet")
.setHeader("content-type", "application/json")
.setBody("{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/UpdateMetricSet"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/UpdateMetricSet")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/UpdateMetricSet")
.header("content-type", "application/json")
.body("{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
MetricSetArn: '',
MetricSetDescription: '',
MetricList: [
{
MetricName: '',
AggregationFunction: '',
Namespace: ''
}
],
Offset: 0,
TimestampColumn: {
ColumnName: '',
ColumnFormat: ''
},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
DimensionFilterList: [
{
Name: '',
FilterList: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/UpdateMetricSet');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateMetricSet',
headers: {'content-type': 'application/json'},
data: {
MetricSetArn: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
DimensionFilterList: [{Name: '', FilterList: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/UpdateMetricSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MetricSetArn":"","MetricSetDescription":"","MetricList":[{"MetricName":"","AggregationFunction":"","Namespace":""}],"Offset":0,"TimestampColumn":{"ColumnName":"","ColumnFormat":""},"DimensionList":[],"MetricSetFrequency":"","MetricSource":{"S3SourceConfig":{"RoleArn":"","TemplatedPathList":"","HistoricalDataPathList":"","FileFormatDescriptor":""},"AppFlowConfig":"","CloudWatchConfig":"","RDSSourceConfig":"","RedshiftSourceConfig":"","AthenaSourceConfig":""},"DimensionFilterList":[{"Name":"","FilterList":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
const settings = {
async: true,
crossDomain: true,
url: '{{baseUrl}}/UpdateMetricSet',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "MetricSetArn": "",\n "MetricSetDescription": "",\n "MetricList": [\n {\n "MetricName": "",\n "AggregationFunction": "",\n "Namespace": ""\n }\n ],\n "Offset": 0,\n "TimestampColumn": {\n "ColumnName": "",\n "ColumnFormat": ""\n },\n "DimensionList": [],\n "MetricSetFrequency": "",\n "MetricSource": {\n "S3SourceConfig": {\n "RoleArn": "",\n "TemplatedPathList": "",\n "HistoricalDataPathList": "",\n "FileFormatDescriptor": ""\n },\n "AppFlowConfig": "",\n "CloudWatchConfig": "",\n "RDSSourceConfig": "",\n "RedshiftSourceConfig": "",\n "AthenaSourceConfig": ""\n },\n "DimensionFilterList": [\n {\n "Name": "",\n "FilterList": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/UpdateMetricSet")
.post(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'POST',
hostname: 'example.com',
port: null,
path: '/baseUrl/UpdateMetricSet',
headers: {
'content-type': 'application/json'
}
};
const req = http.request(options, function (res) {
const chunks = [];
res.on('data', function (chunk) {
chunks.push(chunk);
});
res.on('end', function () {
const body = Buffer.concat(chunks);
console.log(body.toString());
});
});
req.write(JSON.stringify({
MetricSetArn: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
DimensionFilterList: [{Name: '', FilterList: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateMetricSet',
headers: {'content-type': 'application/json'},
body: {
MetricSetArn: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
DimensionFilterList: [{Name: '', FilterList: ''}]
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/UpdateMetricSet');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
MetricSetArn: '',
MetricSetDescription: '',
MetricList: [
{
MetricName: '',
AggregationFunction: '',
Namespace: ''
}
],
Offset: 0,
TimestampColumn: {
ColumnName: '',
ColumnFormat: ''
},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
DimensionFilterList: [
{
Name: '',
FilterList: ''
}
]
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/UpdateMetricSet',
headers: {'content-type': 'application/json'},
data: {
MetricSetArn: '',
MetricSetDescription: '',
MetricList: [{MetricName: '', AggregationFunction: '', Namespace: ''}],
Offset: 0,
TimestampColumn: {ColumnName: '', ColumnFormat: ''},
DimensionList: [],
MetricSetFrequency: '',
MetricSource: {
S3SourceConfig: {
RoleArn: '',
TemplatedPathList: '',
HistoricalDataPathList: '',
FileFormatDescriptor: ''
},
AppFlowConfig: '',
CloudWatchConfig: '',
RDSSourceConfig: '',
RedshiftSourceConfig: '',
AthenaSourceConfig: ''
},
DimensionFilterList: [{Name: '', FilterList: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/UpdateMetricSet';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"MetricSetArn":"","MetricSetDescription":"","MetricList":[{"MetricName":"","AggregationFunction":"","Namespace":""}],"Offset":0,"TimestampColumn":{"ColumnName":"","ColumnFormat":""},"DimensionList":[],"MetricSetFrequency":"","MetricSource":{"S3SourceConfig":{"RoleArn":"","TemplatedPathList":"","HistoricalDataPathList":"","FileFormatDescriptor":""},"AppFlowConfig":"","CloudWatchConfig":"","RDSSourceConfig":"","RedshiftSourceConfig":"","AthenaSourceConfig":""},"DimensionFilterList":[{"Name":"","FilterList":""}]}'
};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}
#import
NSDictionary *headers = @{ @"content-type": @"application/json" };
NSDictionary *parameters = @{ @"MetricSetArn": @"",
@"MetricSetDescription": @"",
@"MetricList": @[ @{ @"MetricName": @"", @"AggregationFunction": @"", @"Namespace": @"" } ],
@"Offset": @0,
@"TimestampColumn": @{ @"ColumnName": @"", @"ColumnFormat": @"" },
@"DimensionList": @[ ],
@"MetricSetFrequency": @"",
@"MetricSource": @{ @"S3SourceConfig": @{ @"RoleArn": @"", @"TemplatedPathList": @"", @"HistoricalDataPathList": @"", @"FileFormatDescriptor": @"" }, @"AppFlowConfig": @"", @"CloudWatchConfig": @"", @"RDSSourceConfig": @"", @"RedshiftSourceConfig": @"", @"AthenaSourceConfig": @"" },
@"DimensionFilterList": @[ @{ @"Name": @"", @"FilterList": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/UpdateMetricSet"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"POST"];
[request setAllHTTPHeaderFields:headers];
[request setHTTPBody:postData];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *dataTask = [session dataTaskWithRequest:request
completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
NSLog(@"%@", error);
} else {
NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *) response;
NSLog(@"%@", httpResponse);
}
}];
[dataTask resume];
open Cohttp_lwt_unix
open Cohttp
open Lwt
let uri = Uri.of_string "{{baseUrl}}/UpdateMetricSet" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/UpdateMetricSet",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'MetricSetArn' => '',
'MetricSetDescription' => '',
'MetricList' => [
[
'MetricName' => '',
'AggregationFunction' => '',
'Namespace' => ''
]
],
'Offset' => 0,
'TimestampColumn' => [
'ColumnName' => '',
'ColumnFormat' => ''
],
'DimensionList' => [
],
'MetricSetFrequency' => '',
'MetricSource' => [
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => ''
],
'AppFlowConfig' => '',
'CloudWatchConfig' => '',
'RDSSourceConfig' => '',
'RedshiftSourceConfig' => '',
'AthenaSourceConfig' => ''
],
'DimensionFilterList' => [
[
'Name' => '',
'FilterList' => ''
]
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/UpdateMetricSet', [
'body' => '{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/UpdateMetricSet');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'MetricSetArn' => '',
'MetricSetDescription' => '',
'MetricList' => [
[
'MetricName' => '',
'AggregationFunction' => '',
'Namespace' => ''
]
],
'Offset' => 0,
'TimestampColumn' => [
'ColumnName' => '',
'ColumnFormat' => ''
],
'DimensionList' => [
],
'MetricSetFrequency' => '',
'MetricSource' => [
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => ''
],
'AppFlowConfig' => '',
'CloudWatchConfig' => '',
'RDSSourceConfig' => '',
'RedshiftSourceConfig' => '',
'AthenaSourceConfig' => ''
],
'DimensionFilterList' => [
[
'Name' => '',
'FilterList' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'MetricSetArn' => '',
'MetricSetDescription' => '',
'MetricList' => [
[
'MetricName' => '',
'AggregationFunction' => '',
'Namespace' => ''
]
],
'Offset' => 0,
'TimestampColumn' => [
'ColumnName' => '',
'ColumnFormat' => ''
],
'DimensionList' => [
],
'MetricSetFrequency' => '',
'MetricSource' => [
'S3SourceConfig' => [
'RoleArn' => '',
'TemplatedPathList' => '',
'HistoricalDataPathList' => '',
'FileFormatDescriptor' => ''
],
'AppFlowConfig' => '',
'CloudWatchConfig' => '',
'RDSSourceConfig' => '',
'RedshiftSourceConfig' => '',
'AthenaSourceConfig' => ''
],
'DimensionFilterList' => [
[
'Name' => '',
'FilterList' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/UpdateMetricSet');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/UpdateMetricSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/UpdateMetricSet' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/UpdateMetricSet", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/UpdateMetricSet"
payload = {
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/UpdateMetricSet"
payload <- "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/UpdateMetricSet")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/UpdateMetricSet') do |req|
req.body = "{\n \"MetricSetArn\": \"\",\n \"MetricSetDescription\": \"\",\n \"MetricList\": [\n {\n \"MetricName\": \"\",\n \"AggregationFunction\": \"\",\n \"Namespace\": \"\"\n }\n ],\n \"Offset\": 0,\n \"TimestampColumn\": {\n \"ColumnName\": \"\",\n \"ColumnFormat\": \"\"\n },\n \"DimensionList\": [],\n \"MetricSetFrequency\": \"\",\n \"MetricSource\": {\n \"S3SourceConfig\": {\n \"RoleArn\": \"\",\n \"TemplatedPathList\": \"\",\n \"HistoricalDataPathList\": \"\",\n \"FileFormatDescriptor\": \"\"\n },\n \"AppFlowConfig\": \"\",\n \"CloudWatchConfig\": \"\",\n \"RDSSourceConfig\": \"\",\n \"RedshiftSourceConfig\": \"\",\n \"AthenaSourceConfig\": \"\"\n },\n \"DimensionFilterList\": [\n {\n \"Name\": \"\",\n \"FilterList\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/UpdateMetricSet";
let payload = json!({
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": (
json!({
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
})
),
"Offset": 0,
"TimestampColumn": json!({
"ColumnName": "",
"ColumnFormat": ""
}),
"DimensionList": (),
"MetricSetFrequency": "",
"MetricSource": json!({
"S3SourceConfig": json!({
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
}),
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
}),
"DimensionFilterList": (
json!({
"Name": "",
"FilterList": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/UpdateMetricSet \
--header 'content-type: application/json' \
--data '{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}'
echo '{
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
{
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
}
],
"Offset": 0,
"TimestampColumn": {
"ColumnName": "",
"ColumnFormat": ""
},
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": {
"S3SourceConfig": {
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
},
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
},
"DimensionFilterList": [
{
"Name": "",
"FilterList": ""
}
]
}' | \
http POST {{baseUrl}}/UpdateMetricSet \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "MetricSetArn": "",\n "MetricSetDescription": "",\n "MetricList": [\n {\n "MetricName": "",\n "AggregationFunction": "",\n "Namespace": ""\n }\n ],\n "Offset": 0,\n "TimestampColumn": {\n "ColumnName": "",\n "ColumnFormat": ""\n },\n "DimensionList": [],\n "MetricSetFrequency": "",\n "MetricSource": {\n "S3SourceConfig": {\n "RoleArn": "",\n "TemplatedPathList": "",\n "HistoricalDataPathList": "",\n "FileFormatDescriptor": ""\n },\n "AppFlowConfig": "",\n "CloudWatchConfig": "",\n "RDSSourceConfig": "",\n "RedshiftSourceConfig": "",\n "AthenaSourceConfig": ""\n },\n "DimensionFilterList": [\n {\n "Name": "",\n "FilterList": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/UpdateMetricSet
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"MetricSetArn": "",
"MetricSetDescription": "",
"MetricList": [
[
"MetricName": "",
"AggregationFunction": "",
"Namespace": ""
]
],
"Offset": 0,
"TimestampColumn": [
"ColumnName": "",
"ColumnFormat": ""
],
"DimensionList": [],
"MetricSetFrequency": "",
"MetricSource": [
"S3SourceConfig": [
"RoleArn": "",
"TemplatedPathList": "",
"HistoricalDataPathList": "",
"FileFormatDescriptor": ""
],
"AppFlowConfig": "",
"CloudWatchConfig": "",
"RDSSourceConfig": "",
"RedshiftSourceConfig": "",
"AthenaSourceConfig": ""
],
"DimensionFilterList": [
[
"Name": "",
"FilterList": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/UpdateMetricSet")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()