AWS Application Cost Profiler
AWS Application Cost Profilerv2020-09-10
This reference provides descriptions of the AWS Application Cost Profiler API. The AWS Application Cost Profiler API provides programmatic access to view, create, update, and delete application cost report definitions, as well as to import your usage data into the Application Cost Profiler service. For more information about using this service, see the AWS Application Cost Profiler User Guide .
- Endpoints
- 6 (2 GET, 2 POST, 1 PUT, 1 DELETE)
- Base URL
http://application-cost-profiler.{region}.amazonaws.com- Authentication
- API key
- Spec format
- OpenAPI 3.0.0
- API version
- 2020-09-10
- Provider
- amazonaws.com
- License
- Apache 2.0 License
- Categories
- Cloud & Infrastructure
- Last updated
Use this API in Bruno:
- Download the Bruno collection above and unzip it.
- In Bruno, choose Open Collection and select the unzipped folder.
- Set the
baseUrlvariable (for examplehttp://application-cost-profiler.{region}.amazonaws.com) and your API key credentials, then send requests.
DELETE
DeleteReportDefinition
{{baseUrl}}/reportDefinition/:reportId
QUERY PARAMS
reportId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reportDefinition/:reportId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/reportDefinition/:reportId")
require "http/client"
url = "{{baseUrl}}/reportDefinition/:reportId"
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}}/reportDefinition/:reportId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reportDefinition/:reportId");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reportDefinition/:reportId"
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/reportDefinition/:reportId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/reportDefinition/:reportId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reportDefinition/:reportId"))
.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}}/reportDefinition/:reportId")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/reportDefinition/:reportId")
.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}}/reportDefinition/:reportId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/reportDefinition/:reportId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reportDefinition/:reportId';
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}}/reportDefinition/:reportId',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/reportDefinition/:reportId")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/reportDefinition/:reportId',
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}}/reportDefinition/:reportId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/reportDefinition/:reportId');
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}}/reportDefinition/:reportId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reportDefinition/:reportId';
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}}/reportDefinition/:reportId"]
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}}/reportDefinition/:reportId" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reportDefinition/:reportId",
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}}/reportDefinition/:reportId');
echo $response->getBody();
setUrl('{{baseUrl}}/reportDefinition/:reportId');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/reportDefinition/:reportId');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reportDefinition/:reportId' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reportDefinition/:reportId' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/reportDefinition/:reportId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reportDefinition/:reportId"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reportDefinition/:reportId"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reportDefinition/:reportId")
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/reportDefinition/:reportId') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reportDefinition/:reportId";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/reportDefinition/:reportId
http DELETE {{baseUrl}}/reportDefinition/:reportId
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/reportDefinition/:reportId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reportDefinition/:reportId")! 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()
GET
GetReportDefinition
{{baseUrl}}/reportDefinition/:reportId
QUERY PARAMS
reportId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reportDefinition/:reportId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/reportDefinition/:reportId")
require "http/client"
url = "{{baseUrl}}/reportDefinition/:reportId"
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}}/reportDefinition/:reportId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reportDefinition/:reportId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reportDefinition/:reportId"
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/reportDefinition/:reportId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/reportDefinition/:reportId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reportDefinition/:reportId"))
.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}}/reportDefinition/:reportId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/reportDefinition/:reportId")
.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}}/reportDefinition/:reportId');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/reportDefinition/:reportId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reportDefinition/:reportId';
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}}/reportDefinition/:reportId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/reportDefinition/:reportId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/reportDefinition/:reportId',
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}}/reportDefinition/:reportId'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/reportDefinition/:reportId');
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}}/reportDefinition/:reportId'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reportDefinition/:reportId';
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}}/reportDefinition/:reportId"]
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}}/reportDefinition/:reportId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reportDefinition/:reportId",
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}}/reportDefinition/:reportId');
echo $response->getBody();
setUrl('{{baseUrl}}/reportDefinition/:reportId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/reportDefinition/:reportId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reportDefinition/:reportId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reportDefinition/:reportId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/reportDefinition/:reportId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reportDefinition/:reportId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reportDefinition/:reportId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reportDefinition/:reportId")
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/reportDefinition/:reportId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reportDefinition/:reportId";
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}}/reportDefinition/:reportId
http GET {{baseUrl}}/reportDefinition/:reportId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/reportDefinition/:reportId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reportDefinition/:reportId")! 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
ImportApplicationUsage
{{baseUrl}}/importApplicationUsage
BODY json
{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/importApplicationUsage");
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 \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/importApplicationUsage" {:content-type :json
:form-params {:sourceS3Location {:bucket ""
:key ""
:region ""}}})
require "http/client"
url = "{{baseUrl}}/importApplicationUsage"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\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}}/importApplicationUsage"),
Content = new StringContent("{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\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}}/importApplicationUsage");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/importApplicationUsage"
payload := strings.NewReader("{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\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/importApplicationUsage HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 81
{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/importApplicationUsage")
.setHeader("content-type", "application/json")
.setBody("{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/importApplicationUsage"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\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 \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/importApplicationUsage")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/importApplicationUsage")
.header("content-type", "application/json")
.body("{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
sourceS3Location: {
bucket: '',
key: '',
region: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/importApplicationUsage');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/importApplicationUsage',
headers: {'content-type': 'application/json'},
data: {sourceS3Location: {bucket: '', key: '', region: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/importApplicationUsage';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceS3Location":{"bucket":"","key":"","region":""}}'
};
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}}/importApplicationUsage',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "sourceS3Location": {\n "bucket": "",\n "key": "",\n "region": ""\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 \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/importApplicationUsage")
.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/importApplicationUsage',
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({sourceS3Location: {bucket: '', key: '', region: ''}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/importApplicationUsage',
headers: {'content-type': 'application/json'},
body: {sourceS3Location: {bucket: '', key: '', region: ''}},
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}}/importApplicationUsage');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
sourceS3Location: {
bucket: '',
key: '',
region: ''
}
});
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}}/importApplicationUsage',
headers: {'content-type': 'application/json'},
data: {sourceS3Location: {bucket: '', key: '', region: ''}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/importApplicationUsage';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"sourceS3Location":{"bucket":"","key":"","region":""}}'
};
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 = @{ @"sourceS3Location": @{ @"bucket": @"", @"key": @"", @"region": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/importApplicationUsage"]
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}}/importApplicationUsage" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/importApplicationUsage",
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([
'sourceS3Location' => [
'bucket' => '',
'key' => '',
'region' => ''
]
]),
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}}/importApplicationUsage', [
'body' => '{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/importApplicationUsage');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'sourceS3Location' => [
'bucket' => '',
'key' => '',
'region' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'sourceS3Location' => [
'bucket' => '',
'key' => '',
'region' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/importApplicationUsage');
$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}}/importApplicationUsage' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/importApplicationUsage' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/importApplicationUsage", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/importApplicationUsage"
payload = { "sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
} }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/importApplicationUsage"
payload <- "{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\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}}/importApplicationUsage")
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 \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\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/importApplicationUsage') do |req|
req.body = "{\n \"sourceS3Location\": {\n \"bucket\": \"\",\n \"key\": \"\",\n \"region\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/importApplicationUsage";
let payload = json!({"sourceS3Location": json!({
"bucket": "",
"key": "",
"region": ""
})});
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}}/importApplicationUsage \
--header 'content-type: application/json' \
--data '{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}'
echo '{
"sourceS3Location": {
"bucket": "",
"key": "",
"region": ""
}
}' | \
http POST {{baseUrl}}/importApplicationUsage \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "sourceS3Location": {\n "bucket": "",\n "key": "",\n "region": ""\n }\n}' \
--output-document \
- {{baseUrl}}/importApplicationUsage
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["sourceS3Location": [
"bucket": "",
"key": "",
"region": ""
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/importApplicationUsage")! 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
ListReportDefinitions
{{baseUrl}}/reportDefinition
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reportDefinition");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/reportDefinition")
require "http/client"
url = "{{baseUrl}}/reportDefinition"
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}}/reportDefinition"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/reportDefinition");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reportDefinition"
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/reportDefinition HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/reportDefinition")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reportDefinition"))
.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}}/reportDefinition")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/reportDefinition")
.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}}/reportDefinition');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/reportDefinition'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reportDefinition';
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}}/reportDefinition',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/reportDefinition")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/reportDefinition',
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}}/reportDefinition'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/reportDefinition');
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}}/reportDefinition'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reportDefinition';
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}}/reportDefinition"]
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}}/reportDefinition" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reportDefinition",
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}}/reportDefinition');
echo $response->getBody();
setUrl('{{baseUrl}}/reportDefinition');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/reportDefinition');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/reportDefinition' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reportDefinition' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/reportDefinition")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reportDefinition"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reportDefinition"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reportDefinition")
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/reportDefinition') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reportDefinition";
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}}/reportDefinition
http GET {{baseUrl}}/reportDefinition
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/reportDefinition
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reportDefinition")! 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
PutReportDefinition
{{baseUrl}}/reportDefinition
BODY json
{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reportDefinition");
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 \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/reportDefinition" {:content-type :json
:form-params {:reportId ""
:reportDescription ""
:reportFrequency ""
:format ""
:destinationS3Location {:bucket ""
:prefix ""}}})
require "http/client"
url = "{{baseUrl}}/reportDefinition"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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}}/reportDefinition"),
Content = new StringContent("{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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}}/reportDefinition");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reportDefinition"
payload := strings.NewReader("{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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/reportDefinition HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 157
{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/reportDefinition")
.setHeader("content-type", "application/json")
.setBody("{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reportDefinition"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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 \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/reportDefinition")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/reportDefinition")
.header("content-type", "application/json")
.body("{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
reportId: '',
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {
bucket: '',
prefix: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/reportDefinition');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/reportDefinition',
headers: {'content-type': 'application/json'},
data: {
reportId: '',
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reportDefinition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"reportId":"","reportDescription":"","reportFrequency":"","format":"","destinationS3Location":{"bucket":"","prefix":""}}'
};
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}}/reportDefinition',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "reportId": "",\n "reportDescription": "",\n "reportFrequency": "",\n "format": "",\n "destinationS3Location": {\n "bucket": "",\n "prefix": ""\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 \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/reportDefinition")
.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/reportDefinition',
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({
reportId: '',
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/reportDefinition',
headers: {'content-type': 'application/json'},
body: {
reportId: '',
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
},
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}}/reportDefinition');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
reportId: '',
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {
bucket: '',
prefix: ''
}
});
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}}/reportDefinition',
headers: {'content-type': 'application/json'},
data: {
reportId: '',
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reportDefinition';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"reportId":"","reportDescription":"","reportFrequency":"","format":"","destinationS3Location":{"bucket":"","prefix":""}}'
};
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 = @{ @"reportId": @"",
@"reportDescription": @"",
@"reportFrequency": @"",
@"format": @"",
@"destinationS3Location": @{ @"bucket": @"", @"prefix": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reportDefinition"]
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}}/reportDefinition" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reportDefinition",
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([
'reportId' => '',
'reportDescription' => '',
'reportFrequency' => '',
'format' => '',
'destinationS3Location' => [
'bucket' => '',
'prefix' => ''
]
]),
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}}/reportDefinition', [
'body' => '{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reportDefinition');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'reportId' => '',
'reportDescription' => '',
'reportFrequency' => '',
'format' => '',
'destinationS3Location' => [
'bucket' => '',
'prefix' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'reportId' => '',
'reportDescription' => '',
'reportFrequency' => '',
'format' => '',
'destinationS3Location' => [
'bucket' => '',
'prefix' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/reportDefinition');
$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}}/reportDefinition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reportDefinition' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/reportDefinition", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reportDefinition"
payload = {
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reportDefinition"
payload <- "{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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}}/reportDefinition")
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 \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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/reportDefinition') do |req|
req.body = "{\n \"reportId\": \"\",\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reportDefinition";
let payload = json!({
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": json!({
"bucket": "",
"prefix": ""
})
});
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}}/reportDefinition \
--header 'content-type: application/json' \
--data '{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}'
echo '{
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}' | \
http POST {{baseUrl}}/reportDefinition \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "reportId": "",\n "reportDescription": "",\n "reportFrequency": "",\n "format": "",\n "destinationS3Location": {\n "bucket": "",\n "prefix": ""\n }\n}' \
--output-document \
- {{baseUrl}}/reportDefinition
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"reportId": "",
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": [
"bucket": "",
"prefix": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reportDefinition")! 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()
PUT
UpdateReportDefinition
{{baseUrl}}/reportDefinition/:reportId
QUERY PARAMS
reportId
BODY json
{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/reportDefinition/:reportId");
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 \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/reportDefinition/:reportId" {:content-type :json
:form-params {:reportDescription ""
:reportFrequency ""
:format ""
:destinationS3Location {:bucket ""
:prefix ""}}})
require "http/client"
url = "{{baseUrl}}/reportDefinition/:reportId"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}"
response = HTTP::Client.put url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Put,
RequestUri = new Uri("{{baseUrl}}/reportDefinition/:reportId"),
Content = new StringContent("{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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}}/reportDefinition/:reportId");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/reportDefinition/:reportId"
payload := strings.NewReader("{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
req, _ := http.NewRequest("PUT", 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))
}
PUT /baseUrl/reportDefinition/:reportId HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 139
{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/reportDefinition/:reportId")
.setHeader("content-type", "application/json")
.setBody("{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/reportDefinition/:reportId"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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 \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/reportDefinition/:reportId")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/reportDefinition/:reportId")
.header("content-type", "application/json")
.body("{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {
bucket: '',
prefix: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/reportDefinition/:reportId');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/reportDefinition/:reportId',
headers: {'content-type': 'application/json'},
data: {
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/reportDefinition/:reportId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"reportDescription":"","reportFrequency":"","format":"","destinationS3Location":{"bucket":"","prefix":""}}'
};
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}}/reportDefinition/:reportId',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "reportDescription": "",\n "reportFrequency": "",\n "format": "",\n "destinationS3Location": {\n "bucket": "",\n "prefix": ""\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 \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/reportDefinition/:reportId")
.put(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PUT',
hostname: 'example.com',
port: null,
path: '/baseUrl/reportDefinition/:reportId',
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({
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/reportDefinition/:reportId',
headers: {'content-type': 'application/json'},
body: {
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PUT', '{{baseUrl}}/reportDefinition/:reportId');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {
bucket: '',
prefix: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PUT',
url: '{{baseUrl}}/reportDefinition/:reportId',
headers: {'content-type': 'application/json'},
data: {
reportDescription: '',
reportFrequency: '',
format: '',
destinationS3Location: {bucket: '', prefix: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/reportDefinition/:reportId';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"reportDescription":"","reportFrequency":"","format":"","destinationS3Location":{"bucket":"","prefix":""}}'
};
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 = @{ @"reportDescription": @"",
@"reportFrequency": @"",
@"format": @"",
@"destinationS3Location": @{ @"bucket": @"", @"prefix": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/reportDefinition/:reportId"]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PUT"];
[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}}/reportDefinition/:reportId" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/reportDefinition/:reportId",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'reportDescription' => '',
'reportFrequency' => '',
'format' => '',
'destinationS3Location' => [
'bucket' => '',
'prefix' => ''
]
]),
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('PUT', '{{baseUrl}}/reportDefinition/:reportId', [
'body' => '{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/reportDefinition/:reportId');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'reportDescription' => '',
'reportFrequency' => '',
'format' => '',
'destinationS3Location' => [
'bucket' => '',
'prefix' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'reportDescription' => '',
'reportFrequency' => '',
'format' => '',
'destinationS3Location' => [
'bucket' => '',
'prefix' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/reportDefinition/:reportId');
$request->setRequestMethod('PUT');
$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}}/reportDefinition/:reportId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/reportDefinition/:reportId' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/reportDefinition/:reportId", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/reportDefinition/:reportId"
payload = {
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/reportDefinition/:reportId"
payload <- "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/reportDefinition/:reportId")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\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.put('/baseUrl/reportDefinition/:reportId') do |req|
req.body = "{\n \"reportDescription\": \"\",\n \"reportFrequency\": \"\",\n \"format\": \"\",\n \"destinationS3Location\": {\n \"bucket\": \"\",\n \"prefix\": \"\"\n }\n}"
end
puts response.status
puts response.body
use std::str::FromStr;
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/reportDefinition/:reportId";
let payload = json!({
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": json!({
"bucket": "",
"prefix": ""
})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/reportDefinition/:reportId \
--header 'content-type: application/json' \
--data '{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}'
echo '{
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": {
"bucket": "",
"prefix": ""
}
}' | \
http PUT {{baseUrl}}/reportDefinition/:reportId \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "reportDescription": "",\n "reportFrequency": "",\n "format": "",\n "destinationS3Location": {\n "bucket": "",\n "prefix": ""\n }\n}' \
--output-document \
- {{baseUrl}}/reportDefinition/:reportId
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"reportDescription": "",
"reportFrequency": "",
"format": "",
"destinationS3Location": [
"bucket": "",
"prefix": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/reportDefinition/:reportId")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()