TrafficManagerManagementClient
PUT
Endpoints_CreateOrUpdate
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName
QUERY PARAMS
api-version
resourceGroupName
profileName
endpointType
endpointName
subscriptionId
BODY json
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName" {:query-params {:api-version ""}
:content-type :json
:form-params {:properties {:endpointLocation ""
:endpointMonitorStatus ""
:endpointStatus ""
:geoMapping []
:minChildEndpoints 0
:priority 0
:target ""
:targetResourceId ""
:weight 0}}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="),
Content = new StringContent("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
payload := strings.NewReader("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 243
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.header("content-type", "application/json")
.body("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
.asString();
const data = JSON.stringify({
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
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({
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
qs: {'api-version': ''},
headers: {'content-type': 'application/json'},
body: {
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 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('PUT', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
req.query({
'api-version': ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 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: 'PUT',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":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 = @{ @"properties": @{ @"endpointLocation": @"", @"endpointMonitorStatus": @"", @"endpointStatus": @"", @"geoMapping": @[ ], @"minChildEndpoints": @0, @"priority": @0, @"target": @"", @"targetResourceId": @"", @"weight": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=",
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([
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 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('PUT', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=', [
'body' => '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'api-version' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
querystring = {"api-version":""}
payload = { "properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
} }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
queryString <- list(api-version = "")
payload <- "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName') do |req|
req.params['api-version'] = ''
req.body = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName";
let querystring = [
("api-version", ""),
];
let payload = json!({"properties": json!({
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": (),
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
})});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' \
--header 'content-type: application/json' \
--data '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}'
echo '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}' | \
http PUT '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\n }\n}' \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["properties": [
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")! 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()
DELETE
Endpoints_Delete
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName
QUERY PARAMS
api-version
resourceGroupName
profileName
endpointType
endpointName
subscriptionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="))
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
req.query({
'api-version': ''
});
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=",
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
querystring = {"api-version":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
queryString <- list(api-version = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName";
let querystring = [
("api-version", ""),
];
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
http DELETE '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")! 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
Endpoints_Get
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName
QUERY PARAMS
api-version
resourceGroupName
profileName
endpointType
endpointName
subscriptionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="))
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
req.query({
'api-version': ''
});
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=",
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
querystring = {"api-version":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
queryString <- list(api-version = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName";
let querystring = [
("api-version", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
http GET '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")! 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()
PATCH
Endpoints_Update
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName
QUERY PARAMS
api-version
resourceGroupName
profileName
endpointType
endpointName
subscriptionId
BODY json
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName" {:query-params {:api-version ""}
:content-type :json
:form-params {:properties {:endpointLocation ""
:endpointMonitorStatus ""
:endpointStatus ""
:geoMapping []
:minChildEndpoints 0
:priority 0
:target ""
:targetResourceId ""
:weight 0}}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="),
Content = new StringContent("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="
payload := strings.NewReader("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 243
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.header("content-type", "application/json")
.body("{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
.asString();
const data = JSON.stringify({
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\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 \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=',
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({
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
qs: {'api-version': ''},
headers: {'content-type': 'application/json'},
body: {
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 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('PATCH', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
req.query({
'api-version': ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 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: 'PATCH',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":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 = @{ @"properties": @{ @"endpointLocation": @"", @"endpointMonitorStatus": @"", @"endpointStatus": @"", @"geoMapping": @[ ], @"minChildEndpoints": @0, @"priority": @0, @"target": @"", @"targetResourceId": @"", @"weight": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 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('PATCH', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=', [
'body' => '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setQueryData([
'api-version' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
querystring = {"api-version":""}
payload = { "properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
} }
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName"
queryString <- list(api-version = "")
payload <- "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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.patch('/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName') do |req|
req.params['api-version'] = ''
req.body = "{\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName";
let querystring = [
("api-version", ""),
];
let payload = json!({"properties": json!({
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": (),
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
})});
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("PATCH").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' \
--header 'content-type: application/json' \
--data '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}'
echo '{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}' | \
http PATCH '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=' \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\n }\n}' \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["properties": [
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName/:endpointType/:endpointName?api-version=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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
GeographicHierarchies_GetDefault
{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default
QUERY PARAMS
api-version
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version="
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version="
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/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version="))
.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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")
.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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=';
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=',
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default');
req.query({
'api-version': ''
});
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=';
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version="]
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=",
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}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default"
querystring = {"api-version":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default"
queryString <- list(api-version = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")
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/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default";
let querystring = [
("api-version", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version='
http GET '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/providers/Microsoft.Network/trafficManagerGeographicHierarchies/default?api-version=")! 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
Profiles_CheckTrafficManagerRelativeDnsNameAvailability
{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability
QUERY PARAMS
api-version
BODY json
{
"name": "",
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=");
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 \"name\": \"\",\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability" {:query-params {:api-version ""}
:content-type :json
:form-params {:name ""
:type ""}})
require "http/client"
url = "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"name\": \"\",\n \"type\": \"\"\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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version="),
Content = new StringContent("{\n \"name\": \"\",\n \"type\": \"\"\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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"name\": \"\",\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version="
payload := strings.NewReader("{\n \"name\": \"\",\n \"type\": \"\"\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/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 30
{
"name": "",
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=")
.setHeader("content-type", "application/json")
.setBody("{\n \"name\": \"\",\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version="))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"name\": \"\",\n \"type\": \"\"\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 \"name\": \"\",\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=")
.header("content-type", "application/json")
.body("{\n \"name\": \"\",\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
name: '',
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {name: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","type":""}'
};
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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "name": "",\n "type": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"name\": \"\",\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=")
.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/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=',
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({name: '', type: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability',
qs: {'api-version': ''},
headers: {'content-type': 'application/json'},
body: {name: '', type: ''},
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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability');
req.query({
'api-version': ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
name: '',
type: ''
});
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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {name: '', type: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"name":"","type":""}'
};
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 = @{ @"name": @"",
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version="]
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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"name\": \"\",\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=",
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([
'name' => '',
'type' => ''
]),
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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=', [
'body' => '{
"name": "",
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability');
$request->setMethod(HTTP_METH_POST);
$request->setQueryData([
'api-version' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'name' => '',
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'name' => '',
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$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}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"name": "",
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"name\": \"\",\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability"
querystring = {"api-version":""}
payload = {
"name": "",
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability"
queryString <- list(api-version = "")
payload <- "{\n \"name\": \"\",\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=")
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 \"name\": \"\",\n \"type\": \"\"\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/providers/Microsoft.Network/checkTrafficManagerNameAvailability') do |req|
req.params['api-version'] = ''
req.body = "{\n \"name\": \"\",\n \"type\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability";
let querystring = [
("api-version", ""),
];
let payload = json!({
"name": "",
"type": ""
});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=' \
--header 'content-type: application/json' \
--data '{
"name": "",
"type": ""
}'
echo '{
"name": "",
"type": ""
}' | \
http POST '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "name": "",\n "type": ""\n}' \
--output-document \
- '{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"name": "",
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/providers/Microsoft.Network/checkTrafficManagerNameAvailability?api-version=")! 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
Profiles_CreateOrUpdate
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName
QUERY PARAMS
api-version
resourceGroupName
profileName
subscriptionId
BODY json
{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName" {:query-params {:api-version ""}
:content-type :json
:form-params {:properties {:dnsConfig {:fqdn ""
:relativeName ""
:ttl 0}
:endpoints [{:properties {:endpointLocation ""
:endpointMonitorStatus ""
:endpointStatus ""
:geoMapping []
:minChildEndpoints 0
:priority 0
:target ""
:targetResourceId ""
:weight 0}}]
:monitorConfig {:intervalInSeconds 0
:path ""
:port 0
:profileMonitorStatus ""
:protocol ""
:timeoutInSeconds 0
:toleratedNumberOfFailures 0}
:profileStatus ""
:trafficRoutingMethod ""}}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="),
Content = new StringContent("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
payload := strings.NewReader("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 731
{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.header("content-type", "application/json")
.body("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
properties: {
dnsConfig: {
fqdn: '',
relativeName: '',
ttl: 0
},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"properties":{"dnsConfig":{"fqdn":"","relativeName":"","ttl":0},"endpoints":[{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":0}}],"monitorConfig":{"intervalInSeconds":0,"path":"","port":0,"profileMonitorStatus":"","protocol":"","timeoutInSeconds":0,"toleratedNumberOfFailures":0},"profileStatus":"","trafficRoutingMethod":""}}'
};
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": {\n "dnsConfig": {\n "fqdn": "",\n "relativeName": "",\n "ttl": 0\n },\n "endpoints": [\n {\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\n }\n }\n ],\n "monitorConfig": {\n "intervalInSeconds": 0,\n "path": "",\n "port": 0,\n "profileMonitorStatus": "",\n "protocol": "",\n "timeoutInSeconds": 0,\n "toleratedNumberOfFailures": 0\n },\n "profileStatus": "",\n "trafficRoutingMethod": ""\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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
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({
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
qs: {'api-version': ''},
headers: {'content-type': 'application/json'},
body: {
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
},
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
req.query({
'api-version': ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: {
dnsConfig: {
fqdn: '',
relativeName: '',
ttl: 0
},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
});
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"properties":{"dnsConfig":{"fqdn":"","relativeName":"","ttl":0},"endpoints":[{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":0}}],"monitorConfig":{"intervalInSeconds":0,"path":"","port":0,"profileMonitorStatus":"","protocol":"","timeoutInSeconds":0,"toleratedNumberOfFailures":0},"profileStatus":"","trafficRoutingMethod":""}}'
};
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 = @{ @"properties": @{ @"dnsConfig": @{ @"fqdn": @"", @"relativeName": @"", @"ttl": @0 }, @"endpoints": @[ @{ @"properties": @{ @"endpointLocation": @"", @"endpointMonitorStatus": @"", @"endpointStatus": @"", @"geoMapping": @[ ], @"minChildEndpoints": @0, @"priority": @0, @"target": @"", @"targetResourceId": @"", @"weight": @0 } } ], @"monitorConfig": @{ @"intervalInSeconds": @0, @"path": @"", @"port": @0, @"profileMonitorStatus": @"", @"protocol": @"", @"timeoutInSeconds": @0, @"toleratedNumberOfFailures": @0 }, @"profileStatus": @"", @"trafficRoutingMethod": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=",
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([
'properties' => [
'dnsConfig' => [
'fqdn' => '',
'relativeName' => '',
'ttl' => 0
],
'endpoints' => [
[
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]
],
'monitorConfig' => [
'intervalInSeconds' => 0,
'path' => '',
'port' => 0,
'profileMonitorStatus' => '',
'protocol' => '',
'timeoutInSeconds' => 0,
'toleratedNumberOfFailures' => 0
],
'profileStatus' => '',
'trafficRoutingMethod' => ''
]
]),
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=', [
'body' => '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setMethod(HTTP_METH_PUT);
$request->setQueryData([
'api-version' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
'dnsConfig' => [
'fqdn' => '',
'relativeName' => '',
'ttl' => 0
],
'endpoints' => [
[
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]
],
'monitorConfig' => [
'intervalInSeconds' => 0,
'path' => '',
'port' => 0,
'profileMonitorStatus' => '',
'protocol' => '',
'timeoutInSeconds' => 0,
'toleratedNumberOfFailures' => 0
],
'profileStatus' => '',
'trafficRoutingMethod' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
'dnsConfig' => [
'fqdn' => '',
'relativeName' => '',
'ttl' => 0
],
'endpoints' => [
[
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]
],
'monitorConfig' => [
'intervalInSeconds' => 0,
'path' => '',
'port' => 0,
'profileMonitorStatus' => '',
'protocol' => '',
'timeoutInSeconds' => 0,
'toleratedNumberOfFailures' => 0
],
'profileStatus' => '',
'trafficRoutingMethod' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
querystring = {"api-version":""}
payload = { "properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [{ "properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
} }],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
} }
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
queryString <- list(api-version = "")
payload <- "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName') do |req|
req.params['api-version'] = ''
req.body = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName";
let querystring = [
("api-version", ""),
];
let payload = json!({"properties": json!({
"dnsConfig": json!({
"fqdn": "",
"relativeName": "",
"ttl": 0
}),
"endpoints": (json!({"properties": json!({
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": (),
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
})})),
"monitorConfig": json!({
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
}),
"profileStatus": "",
"trafficRoutingMethod": ""
})});
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)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' \
--header 'content-type: application/json' \
--data '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}'
echo '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}' | \
http PUT '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "properties": {\n "dnsConfig": {\n "fqdn": "",\n "relativeName": "",\n "ttl": 0\n },\n "endpoints": [\n {\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\n }\n }\n ],\n "monitorConfig": {\n "intervalInSeconds": 0,\n "path": "",\n "port": 0,\n "profileMonitorStatus": "",\n "protocol": "",\n "timeoutInSeconds": 0,\n "toleratedNumberOfFailures": 0\n },\n "profileStatus": "",\n "trafficRoutingMethod": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["properties": [
"dnsConfig": [
"fqdn": "",
"relativeName": "",
"ttl": 0
],
"endpoints": [["properties": [
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
]]],
"monitorConfig": [
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
],
"profileStatus": "",
"trafficRoutingMethod": ""
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")! 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()
DELETE
Profiles_Delete
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName
QUERY PARAMS
api-version
resourceGroupName
profileName
subscriptionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="))
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
req.query({
'api-version': ''
});
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=",
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setMethod(HTTP_METH_DELETE);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setRequestMethod('DELETE');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
querystring = {"api-version":""}
response = requests.delete(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
queryString <- list(api-version = "")
response <- VERB("DELETE", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName";
let querystring = [
("api-version", ""),
];
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
http DELETE '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
wget --quiet \
--method DELETE \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")! 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
Profiles_Get
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName
QUERY PARAMS
api-version
resourceGroupName
profileName
subscriptionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="))
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
req.query({
'api-version': ''
});
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=",
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
querystring = {"api-version":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
queryString <- list(api-version = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName";
let querystring = [
("api-version", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
http GET '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")! 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()
GET
Profiles_ListByResourceGroup
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles
QUERY PARAMS
api-version
resourceGroupName
subscriptionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version="
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version="
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version="))
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=',
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles');
req.query({
'api-version': ''
});
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=';
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version="]
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=",
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles"
querystring = {"api-version":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles"
queryString <- list(api-version = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
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/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles";
let querystring = [
("api-version", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version='
http GET '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")! 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()
GET
Profiles_ListBySubscription
{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles
QUERY PARAMS
api-version
subscriptionId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles" {:query-params {:api-version ""}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version="
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version="),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version="
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/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version= HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version="))
.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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=';
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=',
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles',
qs: {'api-version': ''}
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles');
req.query({
'api-version': ''
});
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles',
params: {'api-version': ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=';
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version="]
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=",
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}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=');
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles');
$request->setMethod(HTTP_METH_GET);
$request->setQueryData([
'api-version' => ''
]);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles');
$request->setRequestMethod('GET');
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles"
querystring = {"api-version":""}
response = requests.get(url, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles"
queryString <- list(api-version = "")
response <- VERB("GET", url, query = queryString, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")
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/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles') do |req|
req.params['api-version'] = ''
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles";
let querystring = [
("api-version", ""),
];
let client = reqwest::Client::new();
let response = client.get(url)
.query(&querystring)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version='
http GET '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version='
wget --quiet \
--method GET \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version='
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/providers/Microsoft.Network/trafficmanagerprofiles?api-version=")! 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()
PATCH
Profiles_Update
{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName
QUERY PARAMS
api-version
resourceGroupName
profileName
subscriptionId
BODY json
{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName" {:query-params {:api-version ""}
:content-type :json
:form-params {:properties {:dnsConfig {:fqdn ""
:relativeName ""
:ttl 0}
:endpoints [{:properties {:endpointLocation ""
:endpointMonitorStatus ""
:endpointStatus ""
:geoMapping []
:minChildEndpoints 0
:priority 0
:target ""
:targetResourceId ""
:weight 0}}]
:monitorConfig {:intervalInSeconds 0
:path ""
:port 0
:profileMonitorStatus ""
:protocol ""
:timeoutInSeconds 0
:toleratedNumberOfFailures 0}
:profileStatus ""
:trafficRoutingMethod ""}}})
require "http/client"
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}"
response = HTTP::Client.patch url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Patch,
RequestUri = new Uri("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="),
Content = new StringContent("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="
payload := strings.NewReader("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
req, _ := http.NewRequest("PATCH", 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))
}
PATCH /baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version= HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 731
{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.setHeader("content-type", "application/json")
.setBody("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.header("content-type", "application/json")
.body("{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
properties: {
dnsConfig: {
fqdn: '',
relativeName: '',
ttl: 0
},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"properties":{"dnsConfig":{"fqdn":"","relativeName":"","ttl":0},"endpoints":[{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":0}}],"monitorConfig":{"intervalInSeconds":0,"path":"","port":0,"profileMonitorStatus":"","protocol":"","timeoutInSeconds":0,"toleratedNumberOfFailures":0},"profileStatus":"","trafficRoutingMethod":""}}'
};
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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "properties": {\n "dnsConfig": {\n "fqdn": "",\n "relativeName": "",\n "ttl": 0\n },\n "endpoints": [\n {\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\n }\n }\n ],\n "monitorConfig": {\n "intervalInSeconds": 0,\n "path": "",\n "port": 0,\n "profileMonitorStatus": "",\n "protocol": "",\n "timeoutInSeconds": 0,\n "toleratedNumberOfFailures": 0\n },\n "profileStatus": "",\n "trafficRoutingMethod": ""\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 \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
.patch(body)
.addHeader("content-type", "application/json")
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'PATCH',
hostname: 'example.com',
port: null,
path: '/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=',
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({
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
qs: {'api-version': ''},
headers: {'content-type': 'application/json'},
body: {
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('PATCH', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
req.query({
'api-version': ''
});
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
properties: {
dnsConfig: {
fqdn: '',
relativeName: '',
ttl: 0
},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'PATCH',
url: '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName',
params: {'api-version': ''},
headers: {'content-type': 'application/json'},
data: {
properties: {
dnsConfig: {fqdn: '', relativeName: '', ttl: 0},
endpoints: [
{
properties: {
endpointLocation: '',
endpointMonitorStatus: '',
endpointStatus: '',
geoMapping: [],
minChildEndpoints: 0,
priority: 0,
target: '',
targetResourceId: '',
weight: 0
}
}
],
monitorConfig: {
intervalInSeconds: 0,
path: '',
port: 0,
profileMonitorStatus: '',
protocol: '',
timeoutInSeconds: 0,
toleratedNumberOfFailures: 0
},
profileStatus: '',
trafficRoutingMethod: ''
}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"properties":{"dnsConfig":{"fqdn":"","relativeName":"","ttl":0},"endpoints":[{"properties":{"endpointLocation":"","endpointMonitorStatus":"","endpointStatus":"","geoMapping":[],"minChildEndpoints":0,"priority":0,"target":"","targetResourceId":"","weight":0}}],"monitorConfig":{"intervalInSeconds":0,"path":"","port":0,"profileMonitorStatus":"","protocol":"","timeoutInSeconds":0,"toleratedNumberOfFailures":0},"profileStatus":"","trafficRoutingMethod":""}}'
};
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 = @{ @"properties": @{ @"dnsConfig": @{ @"fqdn": @"", @"relativeName": @"", @"ttl": @0 }, @"endpoints": @[ @{ @"properties": @{ @"endpointLocation": @"", @"endpointMonitorStatus": @"", @"endpointStatus": @"", @"geoMapping": @[ ], @"minChildEndpoints": @0, @"priority": @0, @"target": @"", @"targetResourceId": @"", @"weight": @0 } } ], @"monitorConfig": @{ @"intervalInSeconds": @0, @"path": @"", @"port": @0, @"profileMonitorStatus": @"", @"protocol": @"", @"timeoutInSeconds": @0, @"toleratedNumberOfFailures": @0 }, @"profileStatus": @"", @"trafficRoutingMethod": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version="]
cachePolicy:NSURLRequestUseProtocolCachePolicy
timeoutInterval:10.0];
[request setHTTPMethod:@"PATCH"];
[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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'properties' => [
'dnsConfig' => [
'fqdn' => '',
'relativeName' => '',
'ttl' => 0
],
'endpoints' => [
[
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]
],
'monitorConfig' => [
'intervalInSeconds' => 0,
'path' => '',
'port' => 0,
'profileMonitorStatus' => '',
'protocol' => '',
'timeoutInSeconds' => 0,
'toleratedNumberOfFailures' => 0
],
'profileStatus' => '',
'trafficRoutingMethod' => ''
]
]),
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('PATCH', '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=', [
'body' => '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setQueryData([
'api-version' => ''
]);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'properties' => [
'dnsConfig' => [
'fqdn' => '',
'relativeName' => '',
'ttl' => 0
],
'endpoints' => [
[
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]
],
'monitorConfig' => [
'intervalInSeconds' => 0,
'path' => '',
'port' => 0,
'profileMonitorStatus' => '',
'protocol' => '',
'timeoutInSeconds' => 0,
'toleratedNumberOfFailures' => 0
],
'profileStatus' => '',
'trafficRoutingMethod' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'properties' => [
'dnsConfig' => [
'fqdn' => '',
'relativeName' => '',
'ttl' => 0
],
'endpoints' => [
[
'properties' => [
'endpointLocation' => '',
'endpointMonitorStatus' => '',
'endpointStatus' => '',
'geoMapping' => [
],
'minChildEndpoints' => 0,
'priority' => 0,
'target' => '',
'targetResourceId' => '',
'weight' => 0
]
]
],
'monitorConfig' => [
'intervalInSeconds' => 0,
'path' => '',
'port' => 0,
'profileMonitorStatus' => '',
'protocol' => '',
'timeoutInSeconds' => 0,
'toleratedNumberOfFailures' => 0
],
'profileStatus' => '',
'trafficRoutingMethod' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setQuery(new http\QueryString([
'api-version' => ''
]));
$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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
querystring = {"api-version":""}
payload = { "properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [{ "properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
} }],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
} }
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers, params=querystring)
print(response.json())
library(httr)
url <- "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName"
queryString <- list(api-version = "")
payload <- "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\n }\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, query = queryString, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["content-type"] = 'application/json'
request.body = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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.patch('/baseUrl/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName') do |req|
req.params['api-version'] = ''
req.body = "{\n \"properties\": {\n \"dnsConfig\": {\n \"fqdn\": \"\",\n \"relativeName\": \"\",\n \"ttl\": 0\n },\n \"endpoints\": [\n {\n \"properties\": {\n \"endpointLocation\": \"\",\n \"endpointMonitorStatus\": \"\",\n \"endpointStatus\": \"\",\n \"geoMapping\": [],\n \"minChildEndpoints\": 0,\n \"priority\": 0,\n \"target\": \"\",\n \"targetResourceId\": \"\",\n \"weight\": 0\n }\n }\n ],\n \"monitorConfig\": {\n \"intervalInSeconds\": 0,\n \"path\": \"\",\n \"port\": 0,\n \"profileMonitorStatus\": \"\",\n \"protocol\": \"\",\n \"timeoutInSeconds\": 0,\n \"toleratedNumberOfFailures\": 0\n },\n \"profileStatus\": \"\",\n \"trafficRoutingMethod\": \"\"\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}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName";
let querystring = [
("api-version", ""),
];
let payload = json!({"properties": json!({
"dnsConfig": json!({
"fqdn": "",
"relativeName": "",
"ttl": 0
}),
"endpoints": (json!({"properties": json!({
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": (),
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
})})),
"monitorConfig": json!({
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
}),
"profileStatus": "",
"trafficRoutingMethod": ""
})});
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("PATCH").unwrap(), url)
.query(&querystring)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' \
--header 'content-type: application/json' \
--data '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}'
echo '{
"properties": {
"dnsConfig": {
"fqdn": "",
"relativeName": "",
"ttl": 0
},
"endpoints": [
{
"properties": {
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
}
}
],
"monitorConfig": {
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
},
"profileStatus": "",
"trafficRoutingMethod": ""
}
}' | \
http PATCH '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=' \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "properties": {\n "dnsConfig": {\n "fqdn": "",\n "relativeName": "",\n "ttl": 0\n },\n "endpoints": [\n {\n "properties": {\n "endpointLocation": "",\n "endpointMonitorStatus": "",\n "endpointStatus": "",\n "geoMapping": [],\n "minChildEndpoints": 0,\n "priority": 0,\n "target": "",\n "targetResourceId": "",\n "weight": 0\n }\n }\n ],\n "monitorConfig": {\n "intervalInSeconds": 0,\n "path": "",\n "port": 0,\n "profileMonitorStatus": "",\n "protocol": "",\n "timeoutInSeconds": 0,\n "toleratedNumberOfFailures": 0\n },\n "profileStatus": "",\n "trafficRoutingMethod": ""\n }\n}' \
--output-document \
- '{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version='
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["properties": [
"dnsConfig": [
"fqdn": "",
"relativeName": "",
"ttl": 0
],
"endpoints": [["properties": [
"endpointLocation": "",
"endpointMonitorStatus": "",
"endpointStatus": "",
"geoMapping": [],
"minChildEndpoints": 0,
"priority": 0,
"target": "",
"targetResourceId": "",
"weight": 0
]]],
"monitorConfig": [
"intervalInSeconds": 0,
"path": "",
"port": 0,
"profileMonitorStatus": "",
"protocol": "",
"timeoutInSeconds": 0,
"toleratedNumberOfFailures": 0
],
"profileStatus": "",
"trafficRoutingMethod": ""
]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/subscriptions/:subscriptionId/resourceGroups/:resourceGroupName/providers/Microsoft.Network/trafficmanagerprofiles/:profileName?api-version=")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "PATCH"
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()