Cloud DNS API
POST
dns.changes.create
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes
QUERY PARAMS
project
managedZone
BODY json
{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes");
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 \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes" {:content-type :json
:form-params {:additions [{:kind ""
:name ""
:routingPolicy {:geo {:enableFencing false
:items [{:healthCheckedTargets {:externalEndpoints []
:internalLoadBalancers [{:ipAddress ""
:ipProtocol ""
:kind ""
:loadBalancerType ""
:networkUrl ""
:port ""
:project ""
:region ""}]}
:kind ""
:location ""
:rrdatas []
:signatureRrdatas []}]
:kind ""}
:geoPolicy {}
:healthCheck ""
:kind ""
:primaryBackup {:backupGeoTargets {}
:kind ""
:primaryTargets {}
:trickleTraffic ""}
:wrr {:items [{:healthCheckedTargets {}
:kind ""
:rrdatas []
:signatureRrdatas []
:weight ""}]
:kind ""}
:wrrPolicy {}}
:rrdatas []
:signatureRrdatas []
:ttl 0
:type ""}]
:deletions [{}]
:id ""
:isServing false
:kind ""
:startTime ""
:status ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"),
Content = new StringContent("{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
payload := strings.NewReader("{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1583
{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.setHeader("content-type", "application/json")
.setBody("{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\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 \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.header("content-type", "application/json")
.body("{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}")
.asString();
const data = JSON.stringify({
additions: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
],
deletions: [
{}
],
id: '',
isServing: false,
kind: '',
startTime: '',
status: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
headers: {'content-type': 'application/json'},
data: {
additions: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
],
deletions: [{}],
id: '',
isServing: false,
kind: '',
startTime: '',
status: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"additions":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}],"deletions":[{}],"id":"","isServing":false,"kind":"","startTime":"","status":""}'
};
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "additions": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ],\n "deletions": [\n {}\n ],\n "id": "",\n "isServing": false,\n "kind": "",\n "startTime": "",\n "status": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
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({
additions: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
],
deletions: [{}],
id: '',
isServing: false,
kind: '',
startTime: '',
status: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
headers: {'content-type': 'application/json'},
body: {
additions: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
],
deletions: [{}],
id: '',
isServing: false,
kind: '',
startTime: '',
status: ''
},
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
additions: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
],
deletions: [
{}
],
id: '',
isServing: false,
kind: '',
startTime: '',
status: ''
});
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
headers: {'content-type': 'application/json'},
data: {
additions: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
],
deletions: [{}],
id: '',
isServing: false,
kind: '',
startTime: '',
status: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"additions":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}],"deletions":[{}],"id":"","isServing":false,"kind":"","startTime":"","status":""}'
};
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 = @{ @"additions": @[ @{ @"kind": @"", @"name": @"", @"routingPolicy": @{ @"geo": @{ @"enableFencing": @NO, @"items": @[ @{ @"healthCheckedTargets": @{ @"externalEndpoints": @[ ], @"internalLoadBalancers": @[ @{ @"ipAddress": @"", @"ipProtocol": @"", @"kind": @"", @"loadBalancerType": @"", @"networkUrl": @"", @"port": @"", @"project": @"", @"region": @"" } ] }, @"kind": @"", @"location": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ] } ], @"kind": @"" }, @"geoPolicy": @{ }, @"healthCheck": @"", @"kind": @"", @"primaryBackup": @{ @"backupGeoTargets": @{ }, @"kind": @"", @"primaryTargets": @{ }, @"trickleTraffic": @"" }, @"wrr": @{ @"items": @[ @{ @"healthCheckedTargets": @{ }, @"kind": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"weight": @"" } ], @"kind": @"" }, @"wrrPolicy": @{ } }, @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"ttl": @0, @"type": @"" } ],
@"deletions": @[ @{ } ],
@"id": @"",
@"isServing": @NO,
@"kind": @"",
@"startTime": @"",
@"status": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes",
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([
'additions' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
],
'deletions' => [
[
]
],
'id' => '',
'isServing' => null,
'kind' => '',
'startTime' => '',
'status' => ''
]),
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes', [
'body' => '{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'additions' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
],
'deletions' => [
[
]
],
'id' => '',
'isServing' => null,
'kind' => '',
'startTime' => '',
'status' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'additions' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
],
'deletions' => [
[
]
],
'id' => '',
'isServing' => null,
'kind' => '',
'startTime' => '',
'status' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/changes", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
payload = {
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": False,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [{}],
"id": "",
"isServing": False,
"kind": "",
"startTime": "",
"status": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
payload <- "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
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 \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes') do |req|
req.body = "{\n \"additions\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ],\n \"deletions\": [\n {}\n ],\n \"id\": \"\",\n \"isServing\": false,\n \"kind\": \"\",\n \"startTime\": \"\",\n \"status\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes";
let payload = json!({
"additions": (
json!({
"kind": "",
"name": "",
"routingPolicy": json!({
"geo": json!({
"enableFencing": false,
"items": (
json!({
"healthCheckedTargets": json!({
"externalEndpoints": (),
"internalLoadBalancers": (
json!({
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
})
)
}),
"kind": "",
"location": "",
"rrdatas": (),
"signatureRrdatas": ()
})
),
"kind": ""
}),
"geoPolicy": json!({}),
"healthCheck": "",
"kind": "",
"primaryBackup": json!({
"backupGeoTargets": json!({}),
"kind": "",
"primaryTargets": json!({}),
"trickleTraffic": ""
}),
"wrr": json!({
"items": (
json!({
"healthCheckedTargets": json!({}),
"kind": "",
"rrdatas": (),
"signatureRrdatas": (),
"weight": ""
})
),
"kind": ""
}),
"wrrPolicy": json!({})
}),
"rrdatas": (),
"signatureRrdatas": (),
"ttl": 0,
"type": ""
})
),
"deletions": (json!({})),
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes \
--header 'content-type: application/json' \
--data '{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}'
echo '{
"additions": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
],
"deletions": [
{}
],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
}' | \
http POST {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "additions": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ],\n "deletions": [\n {}\n ],\n "id": "",\n "isServing": false,\n "kind": "",\n "startTime": "",\n "status": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"additions": [
[
"kind": "",
"name": "",
"routingPolicy": [
"geo": [
"enableFencing": false,
"items": [
[
"healthCheckedTargets": [
"externalEndpoints": [],
"internalLoadBalancers": [
[
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
]
]
],
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
]
],
"kind": ""
],
"geoPolicy": [],
"healthCheck": "",
"kind": "",
"primaryBackup": [
"backupGeoTargets": [],
"kind": "",
"primaryTargets": [],
"trickleTraffic": ""
],
"wrr": [
"items": [
[
"healthCheckedTargets": [],
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
]
],
"kind": ""
],
"wrrPolicy": []
],
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
]
],
"deletions": [[]],
"id": "",
"isServing": false,
"kind": "",
"startTime": "",
"status": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
dns.changes.get
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId
QUERY PARAMS
project
managedZone
changeId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes/:changeId")! 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
dns.changes.list
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes
QUERY PARAMS
project
managedZone
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/changes',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/changes') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/changes")! 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
dns.dnsKeys.get
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId
QUERY PARAMS
project
managedZone
dnsKeyId
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys/:dnsKeyId")! 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
dns.dnsKeys.list
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys
QUERY PARAMS
project
managedZone
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/dnsKeys")! 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
dns.managedZoneOperations.get
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation
QUERY PARAMS
project
managedZone
operation
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations/:operation")! 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
dns.managedZoneOperations.list
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations
QUERY PARAMS
project
managedZone
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/operations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/operations',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/operations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/operations")! 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
dns.managedZones.create
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones
QUERY PARAMS
project
BODY json
{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones");
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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones" {:content-type :json
:form-params {:cloudLoggingConfig {:enableLogging false
:kind ""}
:creationTime ""
:description ""
:dnsName ""
:dnssecConfig {:defaultKeySpecs [{:algorithm ""
:keyLength 0
:keyType ""
:kind ""}]
:kind ""
:nonExistence ""
:state ""}
:forwardingConfig {:kind ""
:targetNameServers [{:forwardingPath ""
:ipv4Address ""
:ipv6Address ""
:kind ""}]}
:id ""
:kind ""
:labels {}
:name ""
:nameServerSet ""
:nameServers []
:peeringConfig {:kind ""
:targetNetwork {:deactivateTime ""
:kind ""
:networkUrl ""}}
:privateVisibilityConfig {:gkeClusters [{:gkeClusterName ""
:kind ""}]
:kind ""
:networks [{:kind ""
:networkUrl ""}]}
:reverseLookupConfig {:kind ""}
:serviceDirectoryConfig {:kind ""
:namespace {:deletionTime ""
:kind ""
:namespaceUrl ""}}
:visibility ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones"),
Content = new StringContent("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
payload := strings.NewReader("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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/dns/v1beta2/projects/:project/managedZones HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1235
{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.setHeader("content-type", "application/json")
.setBody("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.header("content-type", "application/json")
.body("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
.asString();
const data = JSON.stringify({
cloudLoggingConfig: {
enableLogging: false,
kind: ''
},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [
{
algorithm: '',
keyLength: 0,
keyType: '',
kind: ''
}
],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {
kind: '',
targetNetwork: {
deactivateTime: '',
kind: '',
networkUrl: ''
}
},
privateVisibilityConfig: {
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
kind: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
},
reverseLookupConfig: {
kind: ''
},
serviceDirectoryConfig: {
kind: '',
namespace: {
deletionTime: '',
kind: '',
namespaceUrl: ''
}
},
visibility: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones',
headers: {'content-type': 'application/json'},
data: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cloudLoggingConfig":{"enableLogging":false,"kind":""},"creationTime":"","description":"","dnsName":"","dnssecConfig":{"defaultKeySpecs":[{"algorithm":"","keyLength":0,"keyType":"","kind":""}],"kind":"","nonExistence":"","state":""},"forwardingConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"id":"","kind":"","labels":{},"name":"","nameServerSet":"","nameServers":[],"peeringConfig":{"kind":"","targetNetwork":{"deactivateTime":"","kind":"","networkUrl":""}},"privateVisibilityConfig":{"gkeClusters":[{"gkeClusterName":"","kind":""}],"kind":"","networks":[{"kind":"","networkUrl":""}]},"reverseLookupConfig":{"kind":""},"serviceDirectoryConfig":{"kind":"","namespace":{"deletionTime":"","kind":"","namespaceUrl":""}},"visibility":""}'
};
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}}/dns/v1beta2/projects/:project/managedZones',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cloudLoggingConfig": {\n "enableLogging": false,\n "kind": ""\n },\n "creationTime": "",\n "description": "",\n "dnsName": "",\n "dnssecConfig": {\n "defaultKeySpecs": [\n {\n "algorithm": "",\n "keyLength": 0,\n "keyType": "",\n "kind": ""\n }\n ],\n "kind": "",\n "nonExistence": "",\n "state": ""\n },\n "forwardingConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "id": "",\n "kind": "",\n "labels": {},\n "name": "",\n "nameServerSet": "",\n "nameServers": [],\n "peeringConfig": {\n "kind": "",\n "targetNetwork": {\n "deactivateTime": "",\n "kind": "",\n "networkUrl": ""\n }\n },\n "privateVisibilityConfig": {\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "kind": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n },\n "reverseLookupConfig": {\n "kind": ""\n },\n "serviceDirectoryConfig": {\n "kind": "",\n "namespace": {\n "deletionTime": "",\n "kind": "",\n "namespaceUrl": ""\n }\n },\n "visibility": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.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/dns/v1beta2/projects/:project/managedZones',
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({
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones',
headers: {'content-type': 'application/json'},
body: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
},
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}}/dns/v1beta2/projects/:project/managedZones');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cloudLoggingConfig: {
enableLogging: false,
kind: ''
},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [
{
algorithm: '',
keyLength: 0,
keyType: '',
kind: ''
}
],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {
kind: '',
targetNetwork: {
deactivateTime: '',
kind: '',
networkUrl: ''
}
},
privateVisibilityConfig: {
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
kind: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
},
reverseLookupConfig: {
kind: ''
},
serviceDirectoryConfig: {
kind: '',
namespace: {
deletionTime: '',
kind: '',
namespaceUrl: ''
}
},
visibility: ''
});
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}}/dns/v1beta2/projects/:project/managedZones',
headers: {'content-type': 'application/json'},
data: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"cloudLoggingConfig":{"enableLogging":false,"kind":""},"creationTime":"","description":"","dnsName":"","dnssecConfig":{"defaultKeySpecs":[{"algorithm":"","keyLength":0,"keyType":"","kind":""}],"kind":"","nonExistence":"","state":""},"forwardingConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"id":"","kind":"","labels":{},"name":"","nameServerSet":"","nameServers":[],"peeringConfig":{"kind":"","targetNetwork":{"deactivateTime":"","kind":"","networkUrl":""}},"privateVisibilityConfig":{"gkeClusters":[{"gkeClusterName":"","kind":""}],"kind":"","networks":[{"kind":"","networkUrl":""}]},"reverseLookupConfig":{"kind":""},"serviceDirectoryConfig":{"kind":"","namespace":{"deletionTime":"","kind":"","namespaceUrl":""}},"visibility":""}'
};
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 = @{ @"cloudLoggingConfig": @{ @"enableLogging": @NO, @"kind": @"" },
@"creationTime": @"",
@"description": @"",
@"dnsName": @"",
@"dnssecConfig": @{ @"defaultKeySpecs": @[ @{ @"algorithm": @"", @"keyLength": @0, @"keyType": @"", @"kind": @"" } ], @"kind": @"", @"nonExistence": @"", @"state": @"" },
@"forwardingConfig": @{ @"kind": @"", @"targetNameServers": @[ @{ @"forwardingPath": @"", @"ipv4Address": @"", @"ipv6Address": @"", @"kind": @"" } ] },
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"name": @"",
@"nameServerSet": @"",
@"nameServers": @[ ],
@"peeringConfig": @{ @"kind": @"", @"targetNetwork": @{ @"deactivateTime": @"", @"kind": @"", @"networkUrl": @"" } },
@"privateVisibilityConfig": @{ @"gkeClusters": @[ @{ @"gkeClusterName": @"", @"kind": @"" } ], @"kind": @"", @"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ] },
@"reverseLookupConfig": @{ @"kind": @"" },
@"serviceDirectoryConfig": @{ @"kind": @"", @"namespace": @{ @"deletionTime": @"", @"kind": @"", @"namespaceUrl": @"" } },
@"visibility": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"]
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}}/dns/v1beta2/projects/:project/managedZones" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones",
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([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]),
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}}/dns/v1beta2/projects/:project/managedZones', [
'body' => '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/projects/:project/managedZones", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
payload = {
"cloudLoggingConfig": {
"enableLogging": False,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": { "kind": "" },
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
payload <- "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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/dns/v1beta2/projects/:project/managedZones') do |req|
req.body = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones";
let payload = json!({
"cloudLoggingConfig": json!({
"enableLogging": false,
"kind": ""
}),
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": json!({
"defaultKeySpecs": (
json!({
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
})
),
"kind": "",
"nonExistence": "",
"state": ""
}),
"forwardingConfig": json!({
"kind": "",
"targetNameServers": (
json!({
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
})
)
}),
"id": "",
"kind": "",
"labels": json!({}),
"name": "",
"nameServerSet": "",
"nameServers": (),
"peeringConfig": json!({
"kind": "",
"targetNetwork": json!({
"deactivateTime": "",
"kind": "",
"networkUrl": ""
})
}),
"privateVisibilityConfig": json!({
"gkeClusters": (
json!({
"gkeClusterName": "",
"kind": ""
})
),
"kind": "",
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
)
}),
"reverseLookupConfig": json!({"kind": ""}),
"serviceDirectoryConfig": json!({
"kind": "",
"namespace": json!({
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
})
}),
"visibility": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones \
--header 'content-type: application/json' \
--data '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
echo '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}' | \
http POST {{baseUrl}}/dns/v1beta2/projects/:project/managedZones \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "cloudLoggingConfig": {\n "enableLogging": false,\n "kind": ""\n },\n "creationTime": "",\n "description": "",\n "dnsName": "",\n "dnssecConfig": {\n "defaultKeySpecs": [\n {\n "algorithm": "",\n "keyLength": 0,\n "keyType": "",\n "kind": ""\n }\n ],\n "kind": "",\n "nonExistence": "",\n "state": ""\n },\n "forwardingConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "id": "",\n "kind": "",\n "labels": {},\n "name": "",\n "nameServerSet": "",\n "nameServers": [],\n "peeringConfig": {\n "kind": "",\n "targetNetwork": {\n "deactivateTime": "",\n "kind": "",\n "networkUrl": ""\n }\n },\n "privateVisibilityConfig": {\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "kind": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n },\n "reverseLookupConfig": {\n "kind": ""\n },\n "serviceDirectoryConfig": {\n "kind": "",\n "namespace": {\n "deletionTime": "",\n "kind": "",\n "namespaceUrl": ""\n }\n },\n "visibility": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cloudLoggingConfig": [
"enableLogging": false,
"kind": ""
],
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": [
"defaultKeySpecs": [
[
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
]
],
"kind": "",
"nonExistence": "",
"state": ""
],
"forwardingConfig": [
"kind": "",
"targetNameServers": [
[
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
]
]
],
"id": "",
"kind": "",
"labels": [],
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": [
"kind": "",
"targetNetwork": [
"deactivateTime": "",
"kind": "",
"networkUrl": ""
]
],
"privateVisibilityConfig": [
"gkeClusters": [
[
"gkeClusterName": "",
"kind": ""
]
],
"kind": "",
"networks": [
[
"kind": "",
"networkUrl": ""
]
]
],
"reverseLookupConfig": ["kind": ""],
"serviceDirectoryConfig": [
"kind": "",
"namespace": [
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
]
],
"visibility": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
dns.managedZones.delete
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
QUERY PARAMS
project
managedZone
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
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/dns/v1beta2/projects/:project/managedZones/:managedZone HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
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/dns/v1beta2/projects/:project/managedZones/:managedZone') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
http DELETE {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")! 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
dns.managedZones.get
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
QUERY PARAMS
project
managedZone
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
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/dns/v1beta2/projects/:project/managedZones/:managedZone HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
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/dns/v1beta2/projects/:project/managedZones/:managedZone') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")! 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
dns.managedZones.getIamPolicy
{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy
QUERY PARAMS
resource
BODY json
{
"options": {
"requestedPolicyVersion": 0
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy");
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 \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy" {:content-type :json
:form-params {:options {:requestedPolicyVersion 0}}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"),
Content = new StringContent("{\n \"options\": {\n \"requestedPolicyVersion\": 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}}/dns/v1beta2/:+resource:getIamPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"
payload := strings.NewReader("{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/dns/v1beta2/:+resource:getIamPolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 54
{
"options": {
"requestedPolicyVersion": 0
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"options\": {\n \"requestedPolicyVersion\": 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 \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy")
.header("content-type", "application/json")
.body("{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
.asString();
const data = JSON.stringify({
options: {
requestedPolicyVersion: 0
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy',
headers: {'content-type': 'application/json'},
data: {options: {requestedPolicyVersion: 0}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"options":{"requestedPolicyVersion":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}}/dns/v1beta2/:+resource:getIamPolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "options": {\n "requestedPolicyVersion": 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 \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy")
.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/dns/v1beta2/:+resource:getIamPolicy',
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({options: {requestedPolicyVersion: 0}}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy',
headers: {'content-type': 'application/json'},
body: {options: {requestedPolicyVersion: 0}},
json: true
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('POST', '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
options: {
requestedPolicyVersion: 0
}
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy',
headers: {'content-type': 'application/json'},
data: {options: {requestedPolicyVersion: 0}}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"options":{"requestedPolicyVersion":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 = @{ @"options": @{ @"requestedPolicyVersion": @0 } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"]
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}}/dns/v1beta2/:+resource:getIamPolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy",
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([
'options' => [
'requestedPolicyVersion' => 0
]
]),
CURLOPT_HTTPHEADER => [
"content-type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
request('POST', '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy', [
'body' => '{
"options": {
"requestedPolicyVersion": 0
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'options' => [
'requestedPolicyVersion' => 0
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'options' => [
'requestedPolicyVersion' => 0
]
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"options": {
"requestedPolicyVersion": 0
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"options": {
"requestedPolicyVersion": 0
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/:+resource:getIamPolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"
payload = { "options": { "requestedPolicyVersion": 0 } }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy"
payload <- "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy")
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 \"options\": {\n \"requestedPolicyVersion\": 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.post('/baseUrl/dns/v1beta2/:+resource:getIamPolicy') do |req|
req.body = "{\n \"options\": {\n \"requestedPolicyVersion\": 0\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy";
let payload = json!({"options": json!({"requestedPolicyVersion": 0})});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy' \
--header 'content-type: application/json' \
--data '{
"options": {
"requestedPolicyVersion": 0
}
}'
echo '{
"options": {
"requestedPolicyVersion": 0
}
}' | \
http POST '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "options": {\n "requestedPolicyVersion": 0\n }\n}' \
--output-document \
- '{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["options": ["requestedPolicyVersion": 0]] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/:+resource:getIamPolicy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
GET
dns.managedZones.list
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones
QUERY PARAMS
project
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
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}}/dns/v1beta2/projects/:project/managedZones"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
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/dns/v1beta2/projects/:project/managedZones HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"))
.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}}/dns/v1beta2/projects/:project/managedZones")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.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}}/dns/v1beta2/projects/:project/managedZones');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones';
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}}/dns/v1beta2/projects/:project/managedZones',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones',
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}}/dns/v1beta2/projects/:project/managedZones'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones');
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}}/dns/v1beta2/projects/:project/managedZones'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones';
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}}/dns/v1beta2/projects/:project/managedZones"]
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}}/dns/v1beta2/projects/:project/managedZones" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones",
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}}/dns/v1beta2/projects/:project/managedZones');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")
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/dns/v1beta2/projects/:project/managedZones') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones")! 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
dns.managedZones.patch
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
QUERY PARAMS
project
managedZone
BODY json
{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone" {:content-type :json
:form-params {:cloudLoggingConfig {:enableLogging false
:kind ""}
:creationTime ""
:description ""
:dnsName ""
:dnssecConfig {:defaultKeySpecs [{:algorithm ""
:keyLength 0
:keyType ""
:kind ""}]
:kind ""
:nonExistence ""
:state ""}
:forwardingConfig {:kind ""
:targetNameServers [{:forwardingPath ""
:ipv4Address ""
:ipv6Address ""
:kind ""}]}
:id ""
:kind ""
:labels {}
:name ""
:nameServerSet ""
:nameServers []
:peeringConfig {:kind ""
:targetNetwork {:deactivateTime ""
:kind ""
:networkUrl ""}}
:privateVisibilityConfig {:gkeClusters [{:gkeClusterName ""
:kind ""}]
:kind ""
:networks [{:kind ""
:networkUrl ""}]}
:reverseLookupConfig {:kind ""}
:serviceDirectoryConfig {:kind ""
:namespace {:deletionTime ""
:kind ""
:namespaceUrl ""}}
:visibility ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone"),
Content = new StringContent("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
payload := strings.NewReader("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1235
{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.setHeader("content-type", "application/json")
.setBody("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.header("content-type", "application/json")
.body("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
.asString();
const data = JSON.stringify({
cloudLoggingConfig: {
enableLogging: false,
kind: ''
},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [
{
algorithm: '',
keyLength: 0,
keyType: '',
kind: ''
}
],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {
kind: '',
targetNetwork: {
deactivateTime: '',
kind: '',
networkUrl: ''
}
},
privateVisibilityConfig: {
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
kind: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
},
reverseLookupConfig: {
kind: ''
},
serviceDirectoryConfig: {
kind: '',
namespace: {
deletionTime: '',
kind: '',
namespaceUrl: ''
}
},
visibility: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
headers: {'content-type': 'application/json'},
data: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"cloudLoggingConfig":{"enableLogging":false,"kind":""},"creationTime":"","description":"","dnsName":"","dnssecConfig":{"defaultKeySpecs":[{"algorithm":"","keyLength":0,"keyType":"","kind":""}],"kind":"","nonExistence":"","state":""},"forwardingConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"id":"","kind":"","labels":{},"name":"","nameServerSet":"","nameServers":[],"peeringConfig":{"kind":"","targetNetwork":{"deactivateTime":"","kind":"","networkUrl":""}},"privateVisibilityConfig":{"gkeClusters":[{"gkeClusterName":"","kind":""}],"kind":"","networks":[{"kind":"","networkUrl":""}]},"reverseLookupConfig":{"kind":""},"serviceDirectoryConfig":{"kind":"","namespace":{"deletionTime":"","kind":"","namespaceUrl":""}},"visibility":""}'
};
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cloudLoggingConfig": {\n "enableLogging": false,\n "kind": ""\n },\n "creationTime": "",\n "description": "",\n "dnsName": "",\n "dnssecConfig": {\n "defaultKeySpecs": [\n {\n "algorithm": "",\n "keyLength": 0,\n "keyType": "",\n "kind": ""\n }\n ],\n "kind": "",\n "nonExistence": "",\n "state": ""\n },\n "forwardingConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "id": "",\n "kind": "",\n "labels": {},\n "name": "",\n "nameServerSet": "",\n "nameServers": [],\n "peeringConfig": {\n "kind": "",\n "targetNetwork": {\n "deactivateTime": "",\n "kind": "",\n "networkUrl": ""\n }\n },\n "privateVisibilityConfig": {\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "kind": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n },\n "reverseLookupConfig": {\n "kind": ""\n },\n "serviceDirectoryConfig": {\n "kind": "",\n "namespace": {\n "deletionTime": "",\n "kind": "",\n "namespaceUrl": ""\n }\n },\n "visibility": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.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/dns/v1beta2/projects/:project/managedZones/:managedZone',
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({
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
headers: {'content-type': 'application/json'},
body: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
},
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cloudLoggingConfig: {
enableLogging: false,
kind: ''
},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [
{
algorithm: '',
keyLength: 0,
keyType: '',
kind: ''
}
],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {
kind: '',
targetNetwork: {
deactivateTime: '',
kind: '',
networkUrl: ''
}
},
privateVisibilityConfig: {
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
kind: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
},
reverseLookupConfig: {
kind: ''
},
serviceDirectoryConfig: {
kind: '',
namespace: {
deletionTime: '',
kind: '',
namespaceUrl: ''
}
},
visibility: ''
});
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
headers: {'content-type': 'application/json'},
data: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"cloudLoggingConfig":{"enableLogging":false,"kind":""},"creationTime":"","description":"","dnsName":"","dnssecConfig":{"defaultKeySpecs":[{"algorithm":"","keyLength":0,"keyType":"","kind":""}],"kind":"","nonExistence":"","state":""},"forwardingConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"id":"","kind":"","labels":{},"name":"","nameServerSet":"","nameServers":[],"peeringConfig":{"kind":"","targetNetwork":{"deactivateTime":"","kind":"","networkUrl":""}},"privateVisibilityConfig":{"gkeClusters":[{"gkeClusterName":"","kind":""}],"kind":"","networks":[{"kind":"","networkUrl":""}]},"reverseLookupConfig":{"kind":""},"serviceDirectoryConfig":{"kind":"","namespace":{"deletionTime":"","kind":"","namespaceUrl":""}},"visibility":""}'
};
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 = @{ @"cloudLoggingConfig": @{ @"enableLogging": @NO, @"kind": @"" },
@"creationTime": @"",
@"description": @"",
@"dnsName": @"",
@"dnssecConfig": @{ @"defaultKeySpecs": @[ @{ @"algorithm": @"", @"keyLength": @0, @"keyType": @"", @"kind": @"" } ], @"kind": @"", @"nonExistence": @"", @"state": @"" },
@"forwardingConfig": @{ @"kind": @"", @"targetNameServers": @[ @{ @"forwardingPath": @"", @"ipv4Address": @"", @"ipv6Address": @"", @"kind": @"" } ] },
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"name": @"",
@"nameServerSet": @"",
@"nameServers": @[ ],
@"peeringConfig": @{ @"kind": @"", @"targetNetwork": @{ @"deactivateTime": @"", @"kind": @"", @"networkUrl": @"" } },
@"privateVisibilityConfig": @{ @"gkeClusters": @[ @{ @"gkeClusterName": @"", @"kind": @"" } ], @"kind": @"", @"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ] },
@"reverseLookupConfig": @{ @"kind": @"" },
@"serviceDirectoryConfig": @{ @"kind": @"", @"namespace": @{ @"deletionTime": @"", @"kind": @"", @"namespaceUrl": @"" } },
@"visibility": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone",
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([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]),
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone', [
'body' => '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
payload = {
"cloudLoggingConfig": {
"enableLogging": False,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": { "kind": "" },
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
payload <- "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone') do |req|
req.body = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone";
let payload = json!({
"cloudLoggingConfig": json!({
"enableLogging": false,
"kind": ""
}),
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": json!({
"defaultKeySpecs": (
json!({
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
})
),
"kind": "",
"nonExistence": "",
"state": ""
}),
"forwardingConfig": json!({
"kind": "",
"targetNameServers": (
json!({
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
})
)
}),
"id": "",
"kind": "",
"labels": json!({}),
"name": "",
"nameServerSet": "",
"nameServers": (),
"peeringConfig": json!({
"kind": "",
"targetNetwork": json!({
"deactivateTime": "",
"kind": "",
"networkUrl": ""
})
}),
"privateVisibilityConfig": json!({
"gkeClusters": (
json!({
"gkeClusterName": "",
"kind": ""
})
),
"kind": "",
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
)
}),
"reverseLookupConfig": json!({"kind": ""}),
"serviceDirectoryConfig": json!({
"kind": "",
"namespace": json!({
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
})
}),
"visibility": ""
});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone \
--header 'content-type: application/json' \
--data '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
echo '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}' | \
http PATCH {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "cloudLoggingConfig": {\n "enableLogging": false,\n "kind": ""\n },\n "creationTime": "",\n "description": "",\n "dnsName": "",\n "dnssecConfig": {\n "defaultKeySpecs": [\n {\n "algorithm": "",\n "keyLength": 0,\n "keyType": "",\n "kind": ""\n }\n ],\n "kind": "",\n "nonExistence": "",\n "state": ""\n },\n "forwardingConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "id": "",\n "kind": "",\n "labels": {},\n "name": "",\n "nameServerSet": "",\n "nameServers": [],\n "peeringConfig": {\n "kind": "",\n "targetNetwork": {\n "deactivateTime": "",\n "kind": "",\n "networkUrl": ""\n }\n },\n "privateVisibilityConfig": {\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "kind": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n },\n "reverseLookupConfig": {\n "kind": ""\n },\n "serviceDirectoryConfig": {\n "kind": "",\n "namespace": {\n "deletionTime": "",\n "kind": "",\n "namespaceUrl": ""\n }\n },\n "visibility": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cloudLoggingConfig": [
"enableLogging": false,
"kind": ""
],
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": [
"defaultKeySpecs": [
[
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
]
],
"kind": "",
"nonExistence": "",
"state": ""
],
"forwardingConfig": [
"kind": "",
"targetNameServers": [
[
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
]
]
],
"id": "",
"kind": "",
"labels": [],
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": [
"kind": "",
"targetNetwork": [
"deactivateTime": "",
"kind": "",
"networkUrl": ""
]
],
"privateVisibilityConfig": [
"gkeClusters": [
[
"gkeClusterName": "",
"kind": ""
]
],
"kind": "",
"networks": [
[
"kind": "",
"networkUrl": ""
]
]
],
"reverseLookupConfig": ["kind": ""],
"serviceDirectoryConfig": [
"kind": "",
"namespace": [
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
]
],
"visibility": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")! 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()
POST
dns.managedZones.setIamPolicy
{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy
QUERY PARAMS
resource
BODY json
{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy");
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 \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy" {:content-type :json
:form-params {:policy {:auditConfigs [{:auditLogConfigs [{:exemptedMembers []
:logType ""}]
:service ""}]
:bindings [{:condition {:description ""
:expression ""
:location ""
:title ""}
:members []
:role ""}]
:etag ""
:version 0}
:updateMask ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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}}/dns/v1beta2/:+resource:setIamPolicy"),
Content = new StringContent("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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}}/dns/v1beta2/:+resource:setIamPolicy");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy"
payload := strings.NewReader("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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/dns/v1beta2/:+resource:setIamPolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 488
{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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 \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy")
.header("content-type", "application/json")
.body("{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}")
.asString();
const data = JSON.stringify({
policy: {
auditConfigs: [
{
auditLogConfigs: [
{
exemptedMembers: [],
logType: ''
}
],
service: ''
}
],
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy',
headers: {'content-type': 'application/json'},
data: {
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policy":{"auditConfigs":[{"auditLogConfigs":[{"exemptedMembers":[],"logType":""}],"service":""}],"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","version":0},"updateMask":""}'
};
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}}/dns/v1beta2/:+resource:setIamPolicy',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "policy": {\n "auditConfigs": [\n {\n "auditLogConfigs": [\n {\n "exemptedMembers": [],\n "logType": ""\n }\n ],\n "service": ""\n }\n ],\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "version": 0\n },\n "updateMask": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy")
.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/dns/v1beta2/:+resource:setIamPolicy',
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({
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy',
headers: {'content-type': 'application/json'},
body: {
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
},
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}}/dns/v1beta2/:+resource:setIamPolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
policy: {
auditConfigs: [
{
auditLogConfigs: [
{
exemptedMembers: [],
logType: ''
}
],
service: ''
}
],
bindings: [
{
condition: {
description: '',
expression: '',
location: '',
title: ''
},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
});
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}}/dns/v1beta2/:+resource:setIamPolicy',
headers: {'content-type': 'application/json'},
data: {
policy: {
auditConfigs: [{auditLogConfigs: [{exemptedMembers: [], logType: ''}], service: ''}],
bindings: [
{
condition: {description: '', expression: '', location: '', title: ''},
members: [],
role: ''
}
],
etag: '',
version: 0
},
updateMask: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"policy":{"auditConfigs":[{"auditLogConfigs":[{"exemptedMembers":[],"logType":""}],"service":""}],"bindings":[{"condition":{"description":"","expression":"","location":"","title":""},"members":[],"role":""}],"etag":"","version":0},"updateMask":""}'
};
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 = @{ @"policy": @{ @"auditConfigs": @[ @{ @"auditLogConfigs": @[ @{ @"exemptedMembers": @[ ], @"logType": @"" } ], @"service": @"" } ], @"bindings": @[ @{ @"condition": @{ @"description": @"", @"expression": @"", @"location": @"", @"title": @"" }, @"members": @[ ], @"role": @"" } ], @"etag": @"", @"version": @0 },
@"updateMask": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy"]
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}}/dns/v1beta2/:+resource:setIamPolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy",
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([
'policy' => [
'auditConfigs' => [
[
'auditLogConfigs' => [
[
'exemptedMembers' => [
],
'logType' => ''
]
],
'service' => ''
]
],
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'version' => 0
],
'updateMask' => ''
]),
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}}/dns/v1beta2/:+resource:setIamPolicy', [
'body' => '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'policy' => [
'auditConfigs' => [
[
'auditLogConfigs' => [
[
'exemptedMembers' => [
],
'logType' => ''
]
],
'service' => ''
]
],
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'version' => 0
],
'updateMask' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'policy' => [
'auditConfigs' => [
[
'auditLogConfigs' => [
[
'exemptedMembers' => [
],
'logType' => ''
]
],
'service' => ''
]
],
'bindings' => [
[
'condition' => [
'description' => '',
'expression' => '',
'location' => '',
'title' => ''
],
'members' => [
],
'role' => ''
]
],
'etag' => '',
'version' => 0
],
'updateMask' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/:+resource:setIamPolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy"
payload = {
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy"
payload <- "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy")
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 \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\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/dns/v1beta2/:+resource:setIamPolicy') do |req|
req.body = "{\n \"policy\": {\n \"auditConfigs\": [\n {\n \"auditLogConfigs\": [\n {\n \"exemptedMembers\": [],\n \"logType\": \"\"\n }\n ],\n \"service\": \"\"\n }\n ],\n \"bindings\": [\n {\n \"condition\": {\n \"description\": \"\",\n \"expression\": \"\",\n \"location\": \"\",\n \"title\": \"\"\n },\n \"members\": [],\n \"role\": \"\"\n }\n ],\n \"etag\": \"\",\n \"version\": 0\n },\n \"updateMask\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy";
let payload = json!({
"policy": json!({
"auditConfigs": (
json!({
"auditLogConfigs": (
json!({
"exemptedMembers": (),
"logType": ""
})
),
"service": ""
})
),
"bindings": (
json!({
"condition": json!({
"description": "",
"expression": "",
"location": "",
"title": ""
}),
"members": (),
"role": ""
})
),
"etag": "",
"version": 0
}),
"updateMask": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy' \
--header 'content-type: application/json' \
--data '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}'
echo '{
"policy": {
"auditConfigs": [
{
"auditLogConfigs": [
{
"exemptedMembers": [],
"logType": ""
}
],
"service": ""
}
],
"bindings": [
{
"condition": {
"description": "",
"expression": "",
"location": "",
"title": ""
},
"members": [],
"role": ""
}
],
"etag": "",
"version": 0
},
"updateMask": ""
}' | \
http POST '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "policy": {\n "auditConfigs": [\n {\n "auditLogConfigs": [\n {\n "exemptedMembers": [],\n "logType": ""\n }\n ],\n "service": ""\n }\n ],\n "bindings": [\n {\n "condition": {\n "description": "",\n "expression": "",\n "location": "",\n "title": ""\n },\n "members": [],\n "role": ""\n }\n ],\n "etag": "",\n "version": 0\n },\n "updateMask": ""\n}' \
--output-document \
- '{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"policy": [
"auditConfigs": [
[
"auditLogConfigs": [
[
"exemptedMembers": [],
"logType": ""
]
],
"service": ""
]
],
"bindings": [
[
"condition": [
"description": "",
"expression": "",
"location": "",
"title": ""
],
"members": [],
"role": ""
]
],
"etag": "",
"version": 0
],
"updateMask": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/:+resource:setIamPolicy")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
POST
dns.managedZones.testIamPermissions
{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions
QUERY PARAMS
resource
BODY json
{
"permissions": []
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions");
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 \"permissions\": []\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions" {:content-type :json
:form-params {:permissions []}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"permissions\": []\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}}/dns/v1beta2/:+resource:testIamPermissions"),
Content = new StringContent("{\n \"permissions\": []\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}}/dns/v1beta2/:+resource:testIamPermissions");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"permissions\": []\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions"
payload := strings.NewReader("{\n \"permissions\": []\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/dns/v1beta2/:+resource:testIamPermissions HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"permissions": []
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions")
.setHeader("content-type", "application/json")
.setBody("{\n \"permissions\": []\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"permissions\": []\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 \"permissions\": []\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions")
.header("content-type", "application/json")
.body("{\n \"permissions\": []\n}")
.asString();
const data = JSON.stringify({
permissions: []
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions',
headers: {'content-type': 'application/json'},
data: {permissions: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"permissions":[]}'
};
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}}/dns/v1beta2/:+resource:testIamPermissions',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "permissions": []\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"permissions\": []\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions")
.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/dns/v1beta2/:+resource:testIamPermissions',
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({permissions: []}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions',
headers: {'content-type': 'application/json'},
body: {permissions: []},
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}}/dns/v1beta2/:+resource:testIamPermissions');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
permissions: []
});
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}}/dns/v1beta2/:+resource:testIamPermissions',
headers: {'content-type': 'application/json'},
data: {permissions: []}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"permissions":[]}'
};
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 = @{ @"permissions": @[ ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions"]
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}}/dns/v1beta2/:+resource:testIamPermissions" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"permissions\": []\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions",
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([
'permissions' => [
]
]),
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}}/dns/v1beta2/:+resource:testIamPermissions', [
'body' => '{
"permissions": []
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'permissions' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'permissions' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"permissions": []
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"permissions": []
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"permissions\": []\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/:+resource:testIamPermissions", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions"
payload = { "permissions": [] }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions"
payload <- "{\n \"permissions\": []\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions")
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 \"permissions\": []\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/dns/v1beta2/:+resource:testIamPermissions') do |req|
req.body = "{\n \"permissions\": []\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions";
let payload = json!({"permissions": ()});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions' \
--header 'content-type: application/json' \
--data '{
"permissions": []
}'
echo '{
"permissions": []
}' | \
http POST '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions' \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "permissions": []\n}' \
--output-document \
- '{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions'
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["permissions": []] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/:+resource:testIamPermissions")! 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
dns.managedZones.update
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
QUERY PARAMS
project
managedZone
BODY json
{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone" {:content-type :json
:form-params {:cloudLoggingConfig {:enableLogging false
:kind ""}
:creationTime ""
:description ""
:dnsName ""
:dnssecConfig {:defaultKeySpecs [{:algorithm ""
:keyLength 0
:keyType ""
:kind ""}]
:kind ""
:nonExistence ""
:state ""}
:forwardingConfig {:kind ""
:targetNameServers [{:forwardingPath ""
:ipv4Address ""
:ipv6Address ""
:kind ""}]}
:id ""
:kind ""
:labels {}
:name ""
:nameServerSet ""
:nameServers []
:peeringConfig {:kind ""
:targetNetwork {:deactivateTime ""
:kind ""
:networkUrl ""}}
:privateVisibilityConfig {:gkeClusters [{:gkeClusterName ""
:kind ""}]
:kind ""
:networks [{:kind ""
:networkUrl ""}]}
:reverseLookupConfig {:kind ""}
:serviceDirectoryConfig {:kind ""
:namespace {:deletionTime ""
:kind ""
:namespaceUrl ""}}
:visibility ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone"),
Content = new StringContent("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
payload := strings.NewReader("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1235
{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.setHeader("content-type", "application/json")
.setBody("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.header("content-type", "application/json")
.body("{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
.asString();
const data = JSON.stringify({
cloudLoggingConfig: {
enableLogging: false,
kind: ''
},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [
{
algorithm: '',
keyLength: 0,
keyType: '',
kind: ''
}
],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {
kind: '',
targetNetwork: {
deactivateTime: '',
kind: '',
networkUrl: ''
}
},
privateVisibilityConfig: {
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
kind: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
},
reverseLookupConfig: {
kind: ''
},
serviceDirectoryConfig: {
kind: '',
namespace: {
deletionTime: '',
kind: '',
namespaceUrl: ''
}
},
visibility: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
headers: {'content-type': 'application/json'},
data: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"cloudLoggingConfig":{"enableLogging":false,"kind":""},"creationTime":"","description":"","dnsName":"","dnssecConfig":{"defaultKeySpecs":[{"algorithm":"","keyLength":0,"keyType":"","kind":""}],"kind":"","nonExistence":"","state":""},"forwardingConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"id":"","kind":"","labels":{},"name":"","nameServerSet":"","nameServers":[],"peeringConfig":{"kind":"","targetNetwork":{"deactivateTime":"","kind":"","networkUrl":""}},"privateVisibilityConfig":{"gkeClusters":[{"gkeClusterName":"","kind":""}],"kind":"","networks":[{"kind":"","networkUrl":""}]},"reverseLookupConfig":{"kind":""},"serviceDirectoryConfig":{"kind":"","namespace":{"deletionTime":"","kind":"","namespaceUrl":""}},"visibility":""}'
};
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "cloudLoggingConfig": {\n "enableLogging": false,\n "kind": ""\n },\n "creationTime": "",\n "description": "",\n "dnsName": "",\n "dnssecConfig": {\n "defaultKeySpecs": [\n {\n "algorithm": "",\n "keyLength": 0,\n "keyType": "",\n "kind": ""\n }\n ],\n "kind": "",\n "nonExistence": "",\n "state": ""\n },\n "forwardingConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "id": "",\n "kind": "",\n "labels": {},\n "name": "",\n "nameServerSet": "",\n "nameServers": [],\n "peeringConfig": {\n "kind": "",\n "targetNetwork": {\n "deactivateTime": "",\n "kind": "",\n "networkUrl": ""\n }\n },\n "privateVisibilityConfig": {\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "kind": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n },\n "reverseLookupConfig": {\n "kind": ""\n },\n "serviceDirectoryConfig": {\n "kind": "",\n "namespace": {\n "deletionTime": "",\n "kind": "",\n "namespaceUrl": ""\n }\n },\n "visibility": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
.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/dns/v1beta2/projects/:project/managedZones/:managedZone',
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({
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
headers: {'content-type': 'application/json'},
body: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
},
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
cloudLoggingConfig: {
enableLogging: false,
kind: ''
},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [
{
algorithm: '',
keyLength: 0,
keyType: '',
kind: ''
}
],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {
kind: '',
targetNetwork: {
deactivateTime: '',
kind: '',
networkUrl: ''
}
},
privateVisibilityConfig: {
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
kind: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
},
reverseLookupConfig: {
kind: ''
},
serviceDirectoryConfig: {
kind: '',
namespace: {
deletionTime: '',
kind: '',
namespaceUrl: ''
}
},
visibility: ''
});
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone',
headers: {'content-type': 'application/json'},
data: {
cloudLoggingConfig: {enableLogging: false, kind: ''},
creationTime: '',
description: '',
dnsName: '',
dnssecConfig: {
defaultKeySpecs: [{algorithm: '', keyLength: 0, keyType: '', kind: ''}],
kind: '',
nonExistence: '',
state: ''
},
forwardingConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
id: '',
kind: '',
labels: {},
name: '',
nameServerSet: '',
nameServers: [],
peeringConfig: {kind: '', targetNetwork: {deactivateTime: '', kind: '', networkUrl: ''}},
privateVisibilityConfig: {
gkeClusters: [{gkeClusterName: '', kind: ''}],
kind: '',
networks: [{kind: '', networkUrl: ''}]
},
reverseLookupConfig: {kind: ''},
serviceDirectoryConfig: {kind: '', namespace: {deletionTime: '', kind: '', namespaceUrl: ''}},
visibility: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"cloudLoggingConfig":{"enableLogging":false,"kind":""},"creationTime":"","description":"","dnsName":"","dnssecConfig":{"defaultKeySpecs":[{"algorithm":"","keyLength":0,"keyType":"","kind":""}],"kind":"","nonExistence":"","state":""},"forwardingConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"id":"","kind":"","labels":{},"name":"","nameServerSet":"","nameServers":[],"peeringConfig":{"kind":"","targetNetwork":{"deactivateTime":"","kind":"","networkUrl":""}},"privateVisibilityConfig":{"gkeClusters":[{"gkeClusterName":"","kind":""}],"kind":"","networks":[{"kind":"","networkUrl":""}]},"reverseLookupConfig":{"kind":""},"serviceDirectoryConfig":{"kind":"","namespace":{"deletionTime":"","kind":"","namespaceUrl":""}},"visibility":""}'
};
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 = @{ @"cloudLoggingConfig": @{ @"enableLogging": @NO, @"kind": @"" },
@"creationTime": @"",
@"description": @"",
@"dnsName": @"",
@"dnssecConfig": @{ @"defaultKeySpecs": @[ @{ @"algorithm": @"", @"keyLength": @0, @"keyType": @"", @"kind": @"" } ], @"kind": @"", @"nonExistence": @"", @"state": @"" },
@"forwardingConfig": @{ @"kind": @"", @"targetNameServers": @[ @{ @"forwardingPath": @"", @"ipv4Address": @"", @"ipv6Address": @"", @"kind": @"" } ] },
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"name": @"",
@"nameServerSet": @"",
@"nameServers": @[ ],
@"peeringConfig": @{ @"kind": @"", @"targetNetwork": @{ @"deactivateTime": @"", @"kind": @"", @"networkUrl": @"" } },
@"privateVisibilityConfig": @{ @"gkeClusters": @[ @{ @"gkeClusterName": @"", @"kind": @"" } ], @"kind": @"", @"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ] },
@"reverseLookupConfig": @{ @"kind": @"" },
@"serviceDirectoryConfig": @{ @"kind": @"", @"namespace": @{ @"deletionTime": @"", @"kind": @"", @"namespaceUrl": @"" } },
@"visibility": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone",
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([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]),
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone', [
'body' => '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'cloudLoggingConfig' => [
'enableLogging' => null,
'kind' => ''
],
'creationTime' => '',
'description' => '',
'dnsName' => '',
'dnssecConfig' => [
'defaultKeySpecs' => [
[
'algorithm' => '',
'keyLength' => 0,
'keyType' => '',
'kind' => ''
]
],
'kind' => '',
'nonExistence' => '',
'state' => ''
],
'forwardingConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'name' => '',
'nameServerSet' => '',
'nameServers' => [
],
'peeringConfig' => [
'kind' => '',
'targetNetwork' => [
'deactivateTime' => '',
'kind' => '',
'networkUrl' => ''
]
],
'privateVisibilityConfig' => [
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'kind' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
],
'reverseLookupConfig' => [
'kind' => ''
],
'serviceDirectoryConfig' => [
'kind' => '',
'namespace' => [
'deletionTime' => '',
'kind' => '',
'namespaceUrl' => ''
]
],
'visibility' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
payload = {
"cloudLoggingConfig": {
"enableLogging": False,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": { "kind": "" },
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone"
payload <- "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")
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 \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone') do |req|
req.body = "{\n \"cloudLoggingConfig\": {\n \"enableLogging\": false,\n \"kind\": \"\"\n },\n \"creationTime\": \"\",\n \"description\": \"\",\n \"dnsName\": \"\",\n \"dnssecConfig\": {\n \"defaultKeySpecs\": [\n {\n \"algorithm\": \"\",\n \"keyLength\": 0,\n \"keyType\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"nonExistence\": \"\",\n \"state\": \"\"\n },\n \"forwardingConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"name\": \"\",\n \"nameServerSet\": \"\",\n \"nameServers\": [],\n \"peeringConfig\": {\n \"kind\": \"\",\n \"targetNetwork\": {\n \"deactivateTime\": \"\",\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n },\n \"privateVisibilityConfig\": {\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"kind\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n },\n \"reverseLookupConfig\": {\n \"kind\": \"\"\n },\n \"serviceDirectoryConfig\": {\n \"kind\": \"\",\n \"namespace\": {\n \"deletionTime\": \"\",\n \"kind\": \"\",\n \"namespaceUrl\": \"\"\n }\n },\n \"visibility\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone";
let payload = json!({
"cloudLoggingConfig": json!({
"enableLogging": false,
"kind": ""
}),
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": json!({
"defaultKeySpecs": (
json!({
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
})
),
"kind": "",
"nonExistence": "",
"state": ""
}),
"forwardingConfig": json!({
"kind": "",
"targetNameServers": (
json!({
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
})
)
}),
"id": "",
"kind": "",
"labels": json!({}),
"name": "",
"nameServerSet": "",
"nameServers": (),
"peeringConfig": json!({
"kind": "",
"targetNetwork": json!({
"deactivateTime": "",
"kind": "",
"networkUrl": ""
})
}),
"privateVisibilityConfig": json!({
"gkeClusters": (
json!({
"gkeClusterName": "",
"kind": ""
})
),
"kind": "",
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
)
}),
"reverseLookupConfig": json!({"kind": ""}),
"serviceDirectoryConfig": json!({
"kind": "",
"namespace": json!({
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
})
}),
"visibility": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone \
--header 'content-type: application/json' \
--data '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}'
echo '{
"cloudLoggingConfig": {
"enableLogging": false,
"kind": ""
},
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": {
"defaultKeySpecs": [
{
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
}
],
"kind": "",
"nonExistence": "",
"state": ""
},
"forwardingConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"id": "",
"kind": "",
"labels": {},
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": {
"kind": "",
"targetNetwork": {
"deactivateTime": "",
"kind": "",
"networkUrl": ""
}
},
"privateVisibilityConfig": {
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"kind": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
},
"reverseLookupConfig": {
"kind": ""
},
"serviceDirectoryConfig": {
"kind": "",
"namespace": {
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
}
},
"visibility": ""
}' | \
http PUT {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "cloudLoggingConfig": {\n "enableLogging": false,\n "kind": ""\n },\n "creationTime": "",\n "description": "",\n "dnsName": "",\n "dnssecConfig": {\n "defaultKeySpecs": [\n {\n "algorithm": "",\n "keyLength": 0,\n "keyType": "",\n "kind": ""\n }\n ],\n "kind": "",\n "nonExistence": "",\n "state": ""\n },\n "forwardingConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "id": "",\n "kind": "",\n "labels": {},\n "name": "",\n "nameServerSet": "",\n "nameServers": [],\n "peeringConfig": {\n "kind": "",\n "targetNetwork": {\n "deactivateTime": "",\n "kind": "",\n "networkUrl": ""\n }\n },\n "privateVisibilityConfig": {\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "kind": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n },\n "reverseLookupConfig": {\n "kind": ""\n },\n "serviceDirectoryConfig": {\n "kind": "",\n "namespace": {\n "deletionTime": "",\n "kind": "",\n "namespaceUrl": ""\n }\n },\n "visibility": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"cloudLoggingConfig": [
"enableLogging": false,
"kind": ""
],
"creationTime": "",
"description": "",
"dnsName": "",
"dnssecConfig": [
"defaultKeySpecs": [
[
"algorithm": "",
"keyLength": 0,
"keyType": "",
"kind": ""
]
],
"kind": "",
"nonExistence": "",
"state": ""
],
"forwardingConfig": [
"kind": "",
"targetNameServers": [
[
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
]
]
],
"id": "",
"kind": "",
"labels": [],
"name": "",
"nameServerSet": "",
"nameServers": [],
"peeringConfig": [
"kind": "",
"targetNetwork": [
"deactivateTime": "",
"kind": "",
"networkUrl": ""
]
],
"privateVisibilityConfig": [
"gkeClusters": [
[
"gkeClusterName": "",
"kind": ""
]
],
"kind": "",
"networks": [
[
"kind": "",
"networkUrl": ""
]
]
],
"reverseLookupConfig": ["kind": ""],
"serviceDirectoryConfig": [
"kind": "",
"namespace": [
"deletionTime": "",
"kind": "",
"namespaceUrl": ""
]
],
"visibility": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone")! 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()
POST
dns.policies.create
{{baseUrl}}/dns/v1beta2/projects/:project/policies
QUERY PARAMS
project
BODY json
{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/policies");
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 \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/projects/:project/policies" {:content-type :json
:form-params {:alternativeNameServerConfig {:kind ""
:targetNameServers [{:forwardingPath ""
:ipv4Address ""
:ipv6Address ""
:kind ""}]}
:description ""
:dns64Config {:kind ""
:scope {:allQueries false
:kind ""}}
:enableInboundForwarding false
:enableLogging false
:id ""
:kind ""
:name ""
:networks [{:kind ""
:networkUrl ""}]}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/dns/v1beta2/projects/:project/policies"),
Content = new StringContent("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/policies");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
payload := strings.NewReader("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/dns/v1beta2/projects/:project/policies HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 512
{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.setHeader("content-type", "application/json")
.setBody("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/policies"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.header("content-type", "application/json")
.body("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
description: '',
dns64Config: {
kind: '',
scope: {
allQueries: false,
kind: ''
}
},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/projects/:project/policies');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies',
headers: {'content-type': 'application/json'},
data: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alternativeNameServerConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"description":"","dns64Config":{"kind":"","scope":{"allQueries":false,"kind":""}},"enableInboundForwarding":false,"enableLogging":false,"id":"","kind":"","name":"","networks":[{"kind":"","networkUrl":""}]}'
};
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}}/dns/v1beta2/projects/:project/policies',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alternativeNameServerConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "description": "",\n "dns64Config": {\n "kind": "",\n "scope": {\n "allQueries": false,\n "kind": ""\n }\n },\n "enableInboundForwarding": false,\n "enableLogging": false,\n "id": "",\n "kind": "",\n "name": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.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/dns/v1beta2/projects/:project/policies',
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({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies',
headers: {'content-type': 'application/json'},
body: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
},
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}}/dns/v1beta2/projects/:project/policies');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
description: '',
dns64Config: {
kind: '',
scope: {
allQueries: false,
kind: ''
}
},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
});
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}}/dns/v1beta2/projects/:project/policies',
headers: {'content-type': 'application/json'},
data: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"alternativeNameServerConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"description":"","dns64Config":{"kind":"","scope":{"allQueries":false,"kind":""}},"enableInboundForwarding":false,"enableLogging":false,"id":"","kind":"","name":"","networks":[{"kind":"","networkUrl":""}]}'
};
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 = @{ @"alternativeNameServerConfig": @{ @"kind": @"", @"targetNameServers": @[ @{ @"forwardingPath": @"", @"ipv4Address": @"", @"ipv6Address": @"", @"kind": @"" } ] },
@"description": @"",
@"dns64Config": @{ @"kind": @"", @"scope": @{ @"allQueries": @NO, @"kind": @"" } },
@"enableInboundForwarding": @NO,
@"enableLogging": @NO,
@"id": @"",
@"kind": @"",
@"name": @"",
@"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/policies"]
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}}/dns/v1beta2/projects/:project/policies" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/policies",
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([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]),
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}}/dns/v1beta2/projects/:project/policies', [
'body' => '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/projects/:project/policies", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
payload = {
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": False,
"kind": ""
}
},
"enableInboundForwarding": False,
"enableLogging": False,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
payload <- "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
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 \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/dns/v1beta2/projects/:project/policies') do |req|
req.body = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies";
let payload = json!({
"alternativeNameServerConfig": json!({
"kind": "",
"targetNameServers": (
json!({
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
})
)
}),
"description": "",
"dns64Config": json!({
"kind": "",
"scope": json!({
"allQueries": false,
"kind": ""
})
}),
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/dns/v1beta2/projects/:project/policies \
--header 'content-type: application/json' \
--data '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
echo '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}' | \
http POST {{baseUrl}}/dns/v1beta2/projects/:project/policies \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "alternativeNameServerConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "description": "",\n "dns64Config": {\n "kind": "",\n "scope": {\n "allQueries": false,\n "kind": ""\n }\n },\n "enableInboundForwarding": false,\n "enableLogging": false,\n "id": "",\n "kind": "",\n "name": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/policies
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alternativeNameServerConfig": [
"kind": "",
"targetNameServers": [
[
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
]
]
],
"description": "",
"dns64Config": [
"kind": "",
"scope": [
"allQueries": false,
"kind": ""
]
],
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
[
"kind": "",
"networkUrl": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/policies")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
dns.policies.delete
{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
QUERY PARAMS
project
policy
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
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}}/dns/v1beta2/projects/:project/policies/:policy"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
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/dns/v1beta2/projects/:project/policies/:policy HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"))
.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}}/dns/v1beta2/projects/:project/policies/:policy")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.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}}/dns/v1beta2/projects/:project/policies/:policy');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
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}}/dns/v1beta2/projects/:project/policies/:policy',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/policies/:policy',
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}}/dns/v1beta2/projects/:project/policies/:policy'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
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}}/dns/v1beta2/projects/:project/policies/:policy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
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}}/dns/v1beta2/projects/:project/policies/:policy"]
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}}/dns/v1beta2/projects/:project/policies/:policy" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy",
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}}/dns/v1beta2/projects/:project/policies/:policy');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/dns/v1beta2/projects/:project/policies/:policy")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
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/dns/v1beta2/projects/:project/policies/:policy') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
http DELETE {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")! 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
dns.policies.get
{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
QUERY PARAMS
project
policy
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
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}}/dns/v1beta2/projects/:project/policies/:policy"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
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/dns/v1beta2/projects/:project/policies/:policy HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"))
.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}}/dns/v1beta2/projects/:project/policies/:policy")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.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}}/dns/v1beta2/projects/:project/policies/:policy');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
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}}/dns/v1beta2/projects/:project/policies/:policy',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/policies/:policy',
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}}/dns/v1beta2/projects/:project/policies/:policy'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
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}}/dns/v1beta2/projects/:project/policies/:policy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
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}}/dns/v1beta2/projects/:project/policies/:policy"]
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}}/dns/v1beta2/projects/:project/policies/:policy" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy",
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}}/dns/v1beta2/projects/:project/policies/:policy');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/policies/:policy")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
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/dns/v1beta2/projects/:project/policies/:policy') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
http GET {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")! 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
dns.policies.list
{{baseUrl}}/dns/v1beta2/projects/:project/policies
QUERY PARAMS
project
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/policies");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/policies")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
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}}/dns/v1beta2/projects/:project/policies"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/policies");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
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/dns/v1beta2/projects/:project/policies HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/policies"))
.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}}/dns/v1beta2/projects/:project/policies")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.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}}/dns/v1beta2/projects/:project/policies');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies';
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}}/dns/v1beta2/projects/:project/policies',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/policies',
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}}/dns/v1beta2/projects/:project/policies'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/policies');
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}}/dns/v1beta2/projects/:project/policies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies';
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}}/dns/v1beta2/projects/:project/policies"]
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}}/dns/v1beta2/projects/:project/policies" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/policies",
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}}/dns/v1beta2/projects/:project/policies');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/policies")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/policies"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/policies")
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/dns/v1beta2/projects/:project/policies') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/policies
http GET {{baseUrl}}/dns/v1beta2/projects/:project/policies
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/policies
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/policies")! 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
dns.policies.patch
{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
QUERY PARAMS
project
policy
BODY json
{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
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 \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy" {:content-type :json
:form-params {:alternativeNameServerConfig {:kind ""
:targetNameServers [{:forwardingPath ""
:ipv4Address ""
:ipv6Address ""
:kind ""}]}
:description ""
:dns64Config {:kind ""
:scope {:allQueries false
:kind ""}}
:enableInboundForwarding false
:enableLogging false
:id ""
:kind ""
:name ""
:networks [{:kind ""
:networkUrl ""}]}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\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}}/dns/v1beta2/projects/:project/policies/:policy"),
Content = new StringContent("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
payload := strings.NewReader("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\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/dns/v1beta2/projects/:project/policies/:policy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 512
{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.setHeader("content-type", "application/json")
.setBody("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.header("content-type", "application/json")
.body("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
description: '',
dns64Config: {
kind: '',
scope: {
allQueries: false,
kind: ''
}
},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy',
headers: {'content-type': 'application/json'},
data: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"alternativeNameServerConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"description":"","dns64Config":{"kind":"","scope":{"allQueries":false,"kind":""}},"enableInboundForwarding":false,"enableLogging":false,"id":"","kind":"","name":"","networks":[{"kind":"","networkUrl":""}]}'
};
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}}/dns/v1beta2/projects/:project/policies/:policy',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alternativeNameServerConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "description": "",\n "dns64Config": {\n "kind": "",\n "scope": {\n "allQueries": false,\n "kind": ""\n }\n },\n "enableInboundForwarding": false,\n "enableLogging": false,\n "id": "",\n "kind": "",\n "name": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.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/dns/v1beta2/projects/:project/policies/:policy',
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({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy',
headers: {'content-type': 'application/json'},
body: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
},
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}}/dns/v1beta2/projects/:project/policies/:policy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
description: '',
dns64Config: {
kind: '',
scope: {
allQueries: false,
kind: ''
}
},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
});
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}}/dns/v1beta2/projects/:project/policies/:policy',
headers: {'content-type': 'application/json'},
data: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"alternativeNameServerConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"description":"","dns64Config":{"kind":"","scope":{"allQueries":false,"kind":""}},"enableInboundForwarding":false,"enableLogging":false,"id":"","kind":"","name":"","networks":[{"kind":"","networkUrl":""}]}'
};
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 = @{ @"alternativeNameServerConfig": @{ @"kind": @"", @"targetNameServers": @[ @{ @"forwardingPath": @"", @"ipv4Address": @"", @"ipv6Address": @"", @"kind": @"" } ] },
@"description": @"",
@"dns64Config": @{ @"kind": @"", @"scope": @{ @"allQueries": @NO, @"kind": @"" } },
@"enableInboundForwarding": @NO,
@"enableLogging": @NO,
@"id": @"",
@"kind": @"",
@"name": @"",
@"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"]
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}}/dns/v1beta2/projects/:project/policies/:policy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy",
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([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]),
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}}/dns/v1beta2/projects/:project/policies/:policy', [
'body' => '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/dns/v1beta2/projects/:project/policies/:policy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
payload = {
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": False,
"kind": ""
}
},
"enableInboundForwarding": False,
"enableLogging": False,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
payload <- "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
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 \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.patch('/baseUrl/dns/v1beta2/projects/:project/policies/:policy') do |req|
req.body = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\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}}/dns/v1beta2/projects/:project/policies/:policy";
let payload = json!({
"alternativeNameServerConfig": json!({
"kind": "",
"targetNameServers": (
json!({
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
})
)
}),
"description": "",
"dns64Config": json!({
"kind": "",
"scope": json!({
"allQueries": false,
"kind": ""
})
}),
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
)
});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy \
--header 'content-type: application/json' \
--data '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
echo '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}' | \
http PATCH {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "alternativeNameServerConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "description": "",\n "dns64Config": {\n "kind": "",\n "scope": {\n "allQueries": false,\n "kind": ""\n }\n },\n "enableInboundForwarding": false,\n "enableLogging": false,\n "id": "",\n "kind": "",\n "name": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alternativeNameServerConfig": [
"kind": "",
"targetNameServers": [
[
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
]
]
],
"description": "",
"dns64Config": [
"kind": "",
"scope": [
"allQueries": false,
"kind": ""
]
],
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
[
"kind": "",
"networkUrl": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")! 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()
PUT
dns.policies.update
{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
QUERY PARAMS
project
policy
BODY json
{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
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 \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy" {:content-type :json
:form-params {:alternativeNameServerConfig {:kind ""
:targetNameServers [{:forwardingPath ""
:ipv4Address ""
:ipv6Address ""
:kind ""}]}
:description ""
:dns64Config {:kind ""
:scope {:allQueries false
:kind ""}}
:enableInboundForwarding false
:enableLogging false
:id ""
:kind ""
:name ""
:networks [{:kind ""
:networkUrl ""}]}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\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}}/dns/v1beta2/projects/:project/policies/:policy"),
Content = new StringContent("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
payload := strings.NewReader("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\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/dns/v1beta2/projects/:project/policies/:policy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 512
{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.setHeader("content-type", "application/json")
.setBody("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.header("content-type", "application/json")
.body("{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
.asString();
const data = JSON.stringify({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
description: '',
dns64Config: {
kind: '',
scope: {
allQueries: false,
kind: ''
}
},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy',
headers: {'content-type': 'application/json'},
data: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"alternativeNameServerConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"description":"","dns64Config":{"kind":"","scope":{"allQueries":false,"kind":""}},"enableInboundForwarding":false,"enableLogging":false,"id":"","kind":"","name":"","networks":[{"kind":"","networkUrl":""}]}'
};
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}}/dns/v1beta2/projects/:project/policies/:policy',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "alternativeNameServerConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "description": "",\n "dns64Config": {\n "kind": "",\n "scope": {\n "allQueries": false,\n "kind": ""\n }\n },\n "enableInboundForwarding": false,\n "enableLogging": false,\n "id": "",\n "kind": "",\n "name": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
.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/dns/v1beta2/projects/:project/policies/:policy',
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({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy',
headers: {'content-type': 'application/json'},
body: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
},
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}}/dns/v1beta2/projects/:project/policies/:policy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
alternativeNameServerConfig: {
kind: '',
targetNameServers: [
{
forwardingPath: '',
ipv4Address: '',
ipv6Address: '',
kind: ''
}
]
},
description: '',
dns64Config: {
kind: '',
scope: {
allQueries: false,
kind: ''
}
},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [
{
kind: '',
networkUrl: ''
}
]
});
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}}/dns/v1beta2/projects/:project/policies/:policy',
headers: {'content-type': 'application/json'},
data: {
alternativeNameServerConfig: {
kind: '',
targetNameServers: [{forwardingPath: '', ipv4Address: '', ipv6Address: '', kind: ''}]
},
description: '',
dns64Config: {kind: '', scope: {allQueries: false, kind: ''}},
enableInboundForwarding: false,
enableLogging: false,
id: '',
kind: '',
name: '',
networks: [{kind: '', networkUrl: ''}]
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"alternativeNameServerConfig":{"kind":"","targetNameServers":[{"forwardingPath":"","ipv4Address":"","ipv6Address":"","kind":""}]},"description":"","dns64Config":{"kind":"","scope":{"allQueries":false,"kind":""}},"enableInboundForwarding":false,"enableLogging":false,"id":"","kind":"","name":"","networks":[{"kind":"","networkUrl":""}]}'
};
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 = @{ @"alternativeNameServerConfig": @{ @"kind": @"", @"targetNameServers": @[ @{ @"forwardingPath": @"", @"ipv4Address": @"", @"ipv6Address": @"", @"kind": @"" } ] },
@"description": @"",
@"dns64Config": @{ @"kind": @"", @"scope": @{ @"allQueries": @NO, @"kind": @"" } },
@"enableInboundForwarding": @NO,
@"enableLogging": @NO,
@"id": @"",
@"kind": @"",
@"name": @"",
@"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ] };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"]
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}}/dns/v1beta2/projects/:project/policies/:policy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy",
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([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]),
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}}/dns/v1beta2/projects/:project/policies/:policy', [
'body' => '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'alternativeNameServerConfig' => [
'kind' => '',
'targetNameServers' => [
[
'forwardingPath' => '',
'ipv4Address' => '',
'ipv6Address' => '',
'kind' => ''
]
]
],
'description' => '',
'dns64Config' => [
'kind' => '',
'scope' => [
'allQueries' => null,
'kind' => ''
]
],
'enableInboundForwarding' => null,
'enableLogging' => null,
'id' => '',
'kind' => '',
'name' => '',
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
]
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/dns/v1beta2/projects/:project/policies/:policy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
payload = {
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": False,
"kind": ""
}
},
"enableInboundForwarding": False,
"enableLogging": False,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy"
payload <- "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")
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 \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.put('/baseUrl/dns/v1beta2/projects/:project/policies/:policy') do |req|
req.body = "{\n \"alternativeNameServerConfig\": {\n \"kind\": \"\",\n \"targetNameServers\": [\n {\n \"forwardingPath\": \"\",\n \"ipv4Address\": \"\",\n \"ipv6Address\": \"\",\n \"kind\": \"\"\n }\n ]\n },\n \"description\": \"\",\n \"dns64Config\": {\n \"kind\": \"\",\n \"scope\": {\n \"allQueries\": false,\n \"kind\": \"\"\n }\n },\n \"enableInboundForwarding\": false,\n \"enableLogging\": false,\n \"id\": \"\",\n \"kind\": \"\",\n \"name\": \"\",\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\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}}/dns/v1beta2/projects/:project/policies/:policy";
let payload = json!({
"alternativeNameServerConfig": json!({
"kind": "",
"targetNameServers": (
json!({
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
})
)
}),
"description": "",
"dns64Config": json!({
"kind": "",
"scope": json!({
"allQueries": false,
"kind": ""
})
}),
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
)
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy \
--header 'content-type: application/json' \
--data '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}'
echo '{
"alternativeNameServerConfig": {
"kind": "",
"targetNameServers": [
{
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
}
]
},
"description": "",
"dns64Config": {
"kind": "",
"scope": {
"allQueries": false,
"kind": ""
}
},
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
{
"kind": "",
"networkUrl": ""
}
]
}' | \
http PUT {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "alternativeNameServerConfig": {\n "kind": "",\n "targetNameServers": [\n {\n "forwardingPath": "",\n "ipv4Address": "",\n "ipv6Address": "",\n "kind": ""\n }\n ]\n },\n "description": "",\n "dns64Config": {\n "kind": "",\n "scope": {\n "allQueries": false,\n "kind": ""\n }\n },\n "enableInboundForwarding": false,\n "enableLogging": false,\n "id": "",\n "kind": "",\n "name": "",\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ]\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"alternativeNameServerConfig": [
"kind": "",
"targetNameServers": [
[
"forwardingPath": "",
"ipv4Address": "",
"ipv6Address": "",
"kind": ""
]
]
],
"description": "",
"dns64Config": [
"kind": "",
"scope": [
"allQueries": false,
"kind": ""
]
],
"enableInboundForwarding": false,
"enableLogging": false,
"id": "",
"kind": "",
"name": "",
"networks": [
[
"kind": "",
"networkUrl": ""
]
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/policies/:policy")! 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()
GET
dns.projects.get
{{baseUrl}}/dns/v1beta2/projects/:project
QUERY PARAMS
project
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project"
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}}/dns/v1beta2/projects/:project"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project"
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/dns/v1beta2/projects/:project HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project"))
.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}}/dns/v1beta2/projects/:project")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project")
.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}}/dns/v1beta2/projects/:project');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project';
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}}/dns/v1beta2/projects/:project',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project',
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}}/dns/v1beta2/projects/:project'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project');
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}}/dns/v1beta2/projects/:project'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project';
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}}/dns/v1beta2/projects/:project"]
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}}/dns/v1beta2/projects/:project" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project",
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}}/dns/v1beta2/projects/:project');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project")
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/dns/v1beta2/projects/:project') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project
http GET {{baseUrl}}/dns/v1beta2/projects/:project
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project")! 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
dns.resourceRecordSets.create
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets
QUERY PARAMS
project
managedZone
BODY json
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets");
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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets" {:content-type :json
:form-params {:kind ""
:name ""
:routingPolicy {:geo {:enableFencing false
:items [{:healthCheckedTargets {:externalEndpoints []
:internalLoadBalancers [{:ipAddress ""
:ipProtocol ""
:kind ""
:loadBalancerType ""
:networkUrl ""
:port ""
:project ""
:region ""}]}
:kind ""
:location ""
:rrdatas []
:signatureRrdatas []}]
:kind ""}
:geoPolicy {}
:healthCheck ""
:kind ""
:primaryBackup {:backupGeoTargets {}
:kind ""
:primaryTargets {}
:trickleTraffic ""}
:wrr {:items [{:healthCheckedTargets {}
:kind ""
:rrdatas []
:signatureRrdatas []
:weight ""}]
:kind ""}
:wrrPolicy {}}
:rrdatas []
:signatureRrdatas []
:ttl 0
:type ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"),
Content = new StringContent("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
payload := strings.NewReader("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1210
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.setHeader("content-type", "application/json")
.setBody("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.header("content-type", "application/json")
.body("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
headers: {'content-type': 'application/json'},
data: {
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
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({
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
headers: {'content-type': 'application/json'},
body: {
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
headers: {'content-type': 'application/json'},
data: {
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"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 = @{ @"kind": @"",
@"name": @"",
@"routingPolicy": @{ @"geo": @{ @"enableFencing": @NO, @"items": @[ @{ @"healthCheckedTargets": @{ @"externalEndpoints": @[ ], @"internalLoadBalancers": @[ @{ @"ipAddress": @"", @"ipProtocol": @"", @"kind": @"", @"loadBalancerType": @"", @"networkUrl": @"", @"port": @"", @"project": @"", @"region": @"" } ] }, @"kind": @"", @"location": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ] } ], @"kind": @"" }, @"geoPolicy": @{ }, @"healthCheck": @"", @"kind": @"", @"primaryBackup": @{ @"backupGeoTargets": @{ }, @"kind": @"", @"primaryTargets": @{ }, @"trickleTraffic": @"" }, @"wrr": @{ @"items": @[ @{ @"healthCheckedTargets": @{ }, @"kind": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"weight": @"" } ], @"kind": @"" }, @"wrrPolicy": @{ } },
@"rrdatas": @[ ],
@"signatureRrdatas": @[ ],
@"ttl": @0,
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets",
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([
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets', [
'body' => '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
payload = {
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": False,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
payload <- "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets') do |req|
req.body = "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets";
let payload = json!({
"kind": "",
"name": "",
"routingPolicy": json!({
"geo": json!({
"enableFencing": false,
"items": (
json!({
"healthCheckedTargets": json!({
"externalEndpoints": (),
"internalLoadBalancers": (
json!({
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
})
)
}),
"kind": "",
"location": "",
"rrdatas": (),
"signatureRrdatas": ()
})
),
"kind": ""
}),
"geoPolicy": json!({}),
"healthCheck": "",
"kind": "",
"primaryBackup": json!({
"backupGeoTargets": json!({}),
"kind": "",
"primaryTargets": json!({}),
"trickleTraffic": ""
}),
"wrr": json!({
"items": (
json!({
"healthCheckedTargets": json!({}),
"kind": "",
"rrdatas": (),
"signatureRrdatas": (),
"weight": ""
})
),
"kind": ""
}),
"wrrPolicy": json!({})
}),
"rrdatas": (),
"signatureRrdatas": (),
"ttl": 0,
"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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets \
--header 'content-type: application/json' \
--data '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}'
echo '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}' | \
http POST {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"kind": "",
"name": "",
"routingPolicy": [
"geo": [
"enableFencing": false,
"items": [
[
"healthCheckedTargets": [
"externalEndpoints": [],
"internalLoadBalancers": [
[
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
]
]
],
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
]
],
"kind": ""
],
"geoPolicy": [],
"healthCheck": "",
"kind": "",
"primaryBackup": [
"backupGeoTargets": [],
"kind": "",
"primaryTargets": [],
"trickleTraffic": ""
],
"wrr": [
"items": [
[
"healthCheckedTargets": [],
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
]
],
"kind": ""
],
"wrrPolicy": []
],
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
dns.resourceRecordSets.delete
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
QUERY PARAMS
project
managedZone
name
type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/: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: 'DELETE',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/: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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
http DELETE {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")! 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
dns.resourceRecordSets.get
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
QUERY PARAMS
project
managedZone
name
type
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/: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: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/: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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")! 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
dns.resourceRecordSets.list
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets
QUERY PARAMS
project
managedZone
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"))
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets',
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets';
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets",
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")
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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets
http GET {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets")! 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
dns.resourceRecordSets.patch
{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
QUERY PARAMS
project
managedZone
name
type
BODY json
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type");
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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type" {:content-type :json
:form-params {:kind ""
:name ""
:routingPolicy {:geo {:enableFencing false
:items [{:healthCheckedTargets {:externalEndpoints []
:internalLoadBalancers [{:ipAddress ""
:ipProtocol ""
:kind ""
:loadBalancerType ""
:networkUrl ""
:port ""
:project ""
:region ""}]}
:kind ""
:location ""
:rrdatas []
:signatureRrdatas []}]
:kind ""}
:geoPolicy {}
:healthCheck ""
:kind ""
:primaryBackup {:backupGeoTargets {}
:kind ""
:primaryTargets {}
:trickleTraffic ""}
:wrr {:items [{:healthCheckedTargets {}
:kind ""
:rrdatas []
:signatureRrdatas []
:weight ""}]
:kind ""}
:wrrPolicy {}}
:rrdatas []
:signatureRrdatas []
:ttl 0
:type ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"),
Content = new StringContent("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
payload := strings.NewReader("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1210
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.setHeader("content-type", "application/json")
.setBody("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.header("content-type", "application/json")
.body("{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}")
.asString();
const data = JSON.stringify({
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
headers: {'content-type': 'application/json'},
data: {
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
.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/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
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({
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
headers: {'content-type': 'application/json'},
body: {
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
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('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
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: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type',
headers: {'content-type': 'application/json'},
data: {
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"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 = @{ @"kind": @"",
@"name": @"",
@"routingPolicy": @{ @"geo": @{ @"enableFencing": @NO, @"items": @[ @{ @"healthCheckedTargets": @{ @"externalEndpoints": @[ ], @"internalLoadBalancers": @[ @{ @"ipAddress": @"", @"ipProtocol": @"", @"kind": @"", @"loadBalancerType": @"", @"networkUrl": @"", @"port": @"", @"project": @"", @"region": @"" } ] }, @"kind": @"", @"location": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ] } ], @"kind": @"" }, @"geoPolicy": @{ }, @"healthCheck": @"", @"kind": @"", @"primaryBackup": @{ @"backupGeoTargets": @{ }, @"kind": @"", @"primaryTargets": @{ }, @"trickleTraffic": @"" }, @"wrr": @{ @"items": @[ @{ @"healthCheckedTargets": @{ }, @"kind": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"weight": @"" } ], @"kind": @"" }, @"wrrPolicy": @{ } },
@"rrdatas": @[ ],
@"signatureRrdatas": @[ ],
@"ttl": @0,
@"type": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"]
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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type",
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([
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'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('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type', [
'body' => '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
payload = {
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": False,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type"
payload <- "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")
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 \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\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.patch('/baseUrl/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type') do |req|
req.body = "{\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\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}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type";
let payload = json!({
"kind": "",
"name": "",
"routingPolicy": json!({
"geo": json!({
"enableFencing": false,
"items": (
json!({
"healthCheckedTargets": json!({
"externalEndpoints": (),
"internalLoadBalancers": (
json!({
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
})
)
}),
"kind": "",
"location": "",
"rrdatas": (),
"signatureRrdatas": ()
})
),
"kind": ""
}),
"geoPolicy": json!({}),
"healthCheck": "",
"kind": "",
"primaryBackup": json!({
"backupGeoTargets": json!({}),
"kind": "",
"primaryTargets": json!({}),
"trickleTraffic": ""
}),
"wrr": json!({
"items": (
json!({
"healthCheckedTargets": json!({}),
"kind": "",
"rrdatas": (),
"signatureRrdatas": (),
"weight": ""
})
),
"kind": ""
}),
"wrrPolicy": json!({})
}),
"rrdatas": (),
"signatureRrdatas": (),
"ttl": 0,
"type": ""
});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type \
--header 'content-type: application/json' \
--data '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}'
echo '{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}' | \
http PATCH {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"kind": "",
"name": "",
"routingPolicy": [
"geo": [
"enableFencing": false,
"items": [
[
"healthCheckedTargets": [
"externalEndpoints": [],
"internalLoadBalancers": [
[
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
]
]
],
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
]
],
"kind": ""
],
"geoPolicy": [],
"healthCheck": "",
"kind": "",
"primaryBackup": [
"backupGeoTargets": [],
"kind": "",
"primaryTargets": [],
"trickleTraffic": ""
],
"wrr": [
"items": [
[
"healthCheckedTargets": [],
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
]
],
"kind": ""
],
"wrrPolicy": []
],
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/managedZones/:managedZone/rrsets/:name/:type")! 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()
POST
dns.responsePolicies.create
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies
QUERY PARAMS
project
BODY json
{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies");
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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies" {:content-type :json
:form-params {:description ""
:gkeClusters [{:gkeClusterName ""
:kind ""}]
:id ""
:kind ""
:labels {}
:networks [{:kind ""
:networkUrl ""}]
:responsePolicyName ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies"),
Content = new StringContent("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
payload := strings.NewReader("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 248
{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.setHeader("content-type", "application/json")
.setBody("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.header("content-type", "application/json")
.body("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
.asString();
const data = JSON.stringify({
description: '',
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
id: '',
kind: '',
labels: {},
networks: [
{
kind: '',
networkUrl: ''
}
],
responsePolicyName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies',
headers: {'content-type': 'application/json'},
data: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"description":"","gkeClusters":[{"gkeClusterName":"","kind":""}],"id":"","kind":"","labels":{},"networks":[{"kind":"","networkUrl":""}],"responsePolicyName":""}'
};
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}}/dns/v1beta2/projects/:project/responsePolicies',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "description": "",\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "id": "",\n "kind": "",\n "labels": {},\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ],\n "responsePolicyName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.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/dns/v1beta2/projects/:project/responsePolicies',
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({
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies',
headers: {'content-type': 'application/json'},
body: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
},
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}}/dns/v1beta2/projects/:project/responsePolicies');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
description: '',
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
id: '',
kind: '',
labels: {},
networks: [
{
kind: '',
networkUrl: ''
}
],
responsePolicyName: ''
});
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}}/dns/v1beta2/projects/:project/responsePolicies',
headers: {'content-type': 'application/json'},
data: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"description":"","gkeClusters":[{"gkeClusterName":"","kind":""}],"id":"","kind":"","labels":{},"networks":[{"kind":"","networkUrl":""}],"responsePolicyName":""}'
};
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 = @{ @"description": @"",
@"gkeClusters": @[ @{ @"gkeClusterName": @"", @"kind": @"" } ],
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ],
@"responsePolicyName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"]
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}}/dns/v1beta2/projects/:project/responsePolicies" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies",
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([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]),
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}}/dns/v1beta2/projects/:project/responsePolicies', [
'body' => '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
payload = {
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
payload <- "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies') do |req|
req.body = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies";
let payload = json!({
"description": "",
"gkeClusters": (
json!({
"gkeClusterName": "",
"kind": ""
})
),
"id": "",
"kind": "",
"labels": json!({}),
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
),
"responsePolicyName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies \
--header 'content-type: application/json' \
--data '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
echo '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}' | \
http POST {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "description": "",\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "id": "",\n "kind": "",\n "labels": {},\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ],\n "responsePolicyName": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"description": "",
"gkeClusters": [
[
"gkeClusterName": "",
"kind": ""
]
],
"id": "",
"kind": "",
"labels": [],
"networks": [
[
"kind": "",
"networkUrl": ""
]
],
"responsePolicyName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
dns.responsePolicies.delete
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
QUERY PARAMS
project
responsePolicy
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"))
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy",
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
http DELETE {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")! 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
dns.responsePolicies.get
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
QUERY PARAMS
project
responsePolicy
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"))
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy",
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
http GET {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")! 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
dns.responsePolicies.list
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies
QUERY PARAMS
project
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
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}}/dns/v1beta2/projects/:project/responsePolicies"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
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/dns/v1beta2/projects/:project/responsePolicies HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"))
.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}}/dns/v1beta2/projects/:project/responsePolicies")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.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}}/dns/v1beta2/projects/:project/responsePolicies');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies';
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}}/dns/v1beta2/projects/:project/responsePolicies',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/responsePolicies',
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}}/dns/v1beta2/projects/:project/responsePolicies'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies');
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}}/dns/v1beta2/projects/:project/responsePolicies'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies';
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}}/dns/v1beta2/projects/:project/responsePolicies"]
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}}/dns/v1beta2/projects/:project/responsePolicies" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies",
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}}/dns/v1beta2/projects/:project/responsePolicies');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")
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/dns/v1beta2/projects/:project/responsePolicies') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies
http GET {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies")! 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
dns.responsePolicies.patch
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
QUERY PARAMS
project
responsePolicy
BODY json
{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy" {:content-type :json
:form-params {:description ""
:gkeClusters [{:gkeClusterName ""
:kind ""}]
:id ""
:kind ""
:labels {}
:networks [{:kind ""
:networkUrl ""}]
:responsePolicyName ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"),
Content = new StringContent("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
payload := strings.NewReader("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 248
{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.header("content-type", "application/json")
.body("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
.asString();
const data = JSON.stringify({
description: '',
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
id: '',
kind: '',
labels: {},
networks: [
{
kind: '',
networkUrl: ''
}
],
responsePolicyName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
headers: {'content-type': 'application/json'},
data: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"description":"","gkeClusters":[{"gkeClusterName":"","kind":""}],"id":"","kind":"","labels":{},"networks":[{"kind":"","networkUrl":""}],"responsePolicyName":""}'
};
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "description": "",\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "id": "",\n "kind": "",\n "labels": {},\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ],\n "responsePolicyName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
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({
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
headers: {'content-type': 'application/json'},
body: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
},
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
description: '',
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
id: '',
kind: '',
labels: {},
networks: [
{
kind: '',
networkUrl: ''
}
],
responsePolicyName: ''
});
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
headers: {'content-type': 'application/json'},
data: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"description":"","gkeClusters":[{"gkeClusterName":"","kind":""}],"id":"","kind":"","labels":{},"networks":[{"kind":"","networkUrl":""}],"responsePolicyName":""}'
};
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 = @{ @"description": @"",
@"gkeClusters": @[ @{ @"gkeClusterName": @"", @"kind": @"" } ],
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ],
@"responsePolicyName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy",
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([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]),
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy', [
'body' => '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
payload = {
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
payload <- "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy') do |req|
req.body = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy";
let payload = json!({
"description": "",
"gkeClusters": (
json!({
"gkeClusterName": "",
"kind": ""
})
),
"id": "",
"kind": "",
"labels": json!({}),
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
),
"responsePolicyName": ""
});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy \
--header 'content-type: application/json' \
--data '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
echo '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}' | \
http PATCH {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "description": "",\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "id": "",\n "kind": "",\n "labels": {},\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ],\n "responsePolicyName": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"description": "",
"gkeClusters": [
[
"gkeClusterName": "",
"kind": ""
]
],
"id": "",
"kind": "",
"labels": [],
"networks": [
[
"kind": "",
"networkUrl": ""
]
],
"responsePolicyName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")! 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()
PUT
dns.responsePolicies.update
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
QUERY PARAMS
project
responsePolicy
BODY json
{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy" {:content-type :json
:form-params {:description ""
:gkeClusters [{:gkeClusterName ""
:kind ""}]
:id ""
:kind ""
:labels {}
:networks [{:kind ""
:networkUrl ""}]
:responsePolicyName ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"),
Content = new StringContent("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
payload := strings.NewReader("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 248
{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.setHeader("content-type", "application/json")
.setBody("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.header("content-type", "application/json")
.body("{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
.asString();
const data = JSON.stringify({
description: '',
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
id: '',
kind: '',
labels: {},
networks: [
{
kind: '',
networkUrl: ''
}
],
responsePolicyName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
headers: {'content-type': 'application/json'},
data: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"description":"","gkeClusters":[{"gkeClusterName":"","kind":""}],"id":"","kind":"","labels":{},"networks":[{"kind":"","networkUrl":""}],"responsePolicyName":""}'
};
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "description": "",\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "id": "",\n "kind": "",\n "labels": {},\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ],\n "responsePolicyName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
.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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
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({
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
headers: {'content-type': 'application/json'},
body: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
},
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
description: '',
gkeClusters: [
{
gkeClusterName: '',
kind: ''
}
],
id: '',
kind: '',
labels: {},
networks: [
{
kind: '',
networkUrl: ''
}
],
responsePolicyName: ''
});
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy',
headers: {'content-type': 'application/json'},
data: {
description: '',
gkeClusters: [{gkeClusterName: '', kind: ''}],
id: '',
kind: '',
labels: {},
networks: [{kind: '', networkUrl: ''}],
responsePolicyName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"description":"","gkeClusters":[{"gkeClusterName":"","kind":""}],"id":"","kind":"","labels":{},"networks":[{"kind":"","networkUrl":""}],"responsePolicyName":""}'
};
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 = @{ @"description": @"",
@"gkeClusters": @[ @{ @"gkeClusterName": @"", @"kind": @"" } ],
@"id": @"",
@"kind": @"",
@"labels": @{ },
@"networks": @[ @{ @"kind": @"", @"networkUrl": @"" } ],
@"responsePolicyName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy",
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([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]),
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy', [
'body' => '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'description' => '',
'gkeClusters' => [
[
'gkeClusterName' => '',
'kind' => ''
]
],
'id' => '',
'kind' => '',
'labels' => [
],
'networks' => [
[
'kind' => '',
'networkUrl' => ''
]
],
'responsePolicyName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
payload = {
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy"
payload <- "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")
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 \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy') do |req|
req.body = "{\n \"description\": \"\",\n \"gkeClusters\": [\n {\n \"gkeClusterName\": \"\",\n \"kind\": \"\"\n }\n ],\n \"id\": \"\",\n \"kind\": \"\",\n \"labels\": {},\n \"networks\": [\n {\n \"kind\": \"\",\n \"networkUrl\": \"\"\n }\n ],\n \"responsePolicyName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy";
let payload = json!({
"description": "",
"gkeClusters": (
json!({
"gkeClusterName": "",
"kind": ""
})
),
"id": "",
"kind": "",
"labels": json!({}),
"networks": (
json!({
"kind": "",
"networkUrl": ""
})
),
"responsePolicyName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy \
--header 'content-type: application/json' \
--data '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}'
echo '{
"description": "",
"gkeClusters": [
{
"gkeClusterName": "",
"kind": ""
}
],
"id": "",
"kind": "",
"labels": {},
"networks": [
{
"kind": "",
"networkUrl": ""
}
],
"responsePolicyName": ""
}' | \
http PUT {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "description": "",\n "gkeClusters": [\n {\n "gkeClusterName": "",\n "kind": ""\n }\n ],\n "id": "",\n "kind": "",\n "labels": {},\n "networks": [\n {\n "kind": "",\n "networkUrl": ""\n }\n ],\n "responsePolicyName": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"description": "",
"gkeClusters": [
[
"gkeClusterName": "",
"kind": ""
]
],
"id": "",
"kind": "",
"labels": [],
"networks": [
[
"kind": "",
"networkUrl": ""
]
],
"responsePolicyName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy")! 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()
POST
dns.responsePolicyRules.create
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules
QUERY PARAMS
project
responsePolicy
BODY json
{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules");
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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules" {:content-type :json
:form-params {:behavior ""
:dnsName ""
:kind ""
:localData {:localDatas [{:kind ""
:name ""
:routingPolicy {:geo {:enableFencing false
:items [{:healthCheckedTargets {:externalEndpoints []
:internalLoadBalancers [{:ipAddress ""
:ipProtocol ""
:kind ""
:loadBalancerType ""
:networkUrl ""
:port ""
:project ""
:region ""}]}
:kind ""
:location ""
:rrdatas []
:signatureRrdatas []}]
:kind ""}
:geoPolicy {}
:healthCheck ""
:kind ""
:primaryBackup {:backupGeoTargets {}
:kind ""
:primaryTargets {}
:trickleTraffic ""}
:wrr {:items [{:healthCheckedTargets {}
:kind ""
:rrdatas []
:signatureRrdatas []
:weight ""}]
:kind ""}
:wrrPolicy {}}
:rrdatas []
:signatureRrdatas []
:ttl 0
:type ""}]}
:ruleName ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"),
Content = new StringContent("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
payload := strings.NewReader("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1682
{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.setHeader("content-type", "application/json")
.setBody("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.header("content-type", "application/json")
.body("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
.asString();
const data = JSON.stringify({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
headers: {'content-type': 'application/json'},
data: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"behavior":"","dnsName":"","kind":"","localData":{"localDatas":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}]},"ruleName":""}'
};
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "behavior": "",\n "dnsName": "",\n "kind": "",\n "localData": {\n "localDatas": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ]\n },\n "ruleName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
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({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
headers: {'content-type': 'application/json'},
body: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
},
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
});
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
headers: {'content-type': 'application/json'},
data: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"behavior":"","dnsName":"","kind":"","localData":{"localDatas":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}]},"ruleName":""}'
};
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 = @{ @"behavior": @"",
@"dnsName": @"",
@"kind": @"",
@"localData": @{ @"localDatas": @[ @{ @"kind": @"", @"name": @"", @"routingPolicy": @{ @"geo": @{ @"enableFencing": @NO, @"items": @[ @{ @"healthCheckedTargets": @{ @"externalEndpoints": @[ ], @"internalLoadBalancers": @[ @{ @"ipAddress": @"", @"ipProtocol": @"", @"kind": @"", @"loadBalancerType": @"", @"networkUrl": @"", @"port": @"", @"project": @"", @"region": @"" } ] }, @"kind": @"", @"location": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ] } ], @"kind": @"" }, @"geoPolicy": @{ }, @"healthCheck": @"", @"kind": @"", @"primaryBackup": @{ @"backupGeoTargets": @{ }, @"kind": @"", @"primaryTargets": @{ }, @"trickleTraffic": @"" }, @"wrr": @{ @"items": @[ @{ @"healthCheckedTargets": @{ }, @"kind": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"weight": @"" } ], @"kind": @"" }, @"wrrPolicy": @{ } }, @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"ttl": @0, @"type": @"" } ] },
@"ruleName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules",
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([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]),
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules', [
'body' => '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
$request->setRequestMethod('POST');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
payload = {
"behavior": "",
"dnsName": "",
"kind": "",
"localData": { "localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": False,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
] },
"ruleName": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
payload <- "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules') do |req|
req.body = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules";
let payload = json!({
"behavior": "",
"dnsName": "",
"kind": "",
"localData": json!({"localDatas": (
json!({
"kind": "",
"name": "",
"routingPolicy": json!({
"geo": json!({
"enableFencing": false,
"items": (
json!({
"healthCheckedTargets": json!({
"externalEndpoints": (),
"internalLoadBalancers": (
json!({
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
})
)
}),
"kind": "",
"location": "",
"rrdatas": (),
"signatureRrdatas": ()
})
),
"kind": ""
}),
"geoPolicy": json!({}),
"healthCheck": "",
"kind": "",
"primaryBackup": json!({
"backupGeoTargets": json!({}),
"kind": "",
"primaryTargets": json!({}),
"trickleTraffic": ""
}),
"wrr": json!({
"items": (
json!({
"healthCheckedTargets": json!({}),
"kind": "",
"rrdatas": (),
"signatureRrdatas": (),
"weight": ""
})
),
"kind": ""
}),
"wrrPolicy": json!({})
}),
"rrdatas": (),
"signatureRrdatas": (),
"ttl": 0,
"type": ""
})
)}),
"ruleName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules \
--header 'content-type: application/json' \
--data '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
echo '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}' | \
http POST {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "behavior": "",\n "dnsName": "",\n "kind": "",\n "localData": {\n "localDatas": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ]\n },\n "ruleName": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"behavior": "",
"dnsName": "",
"kind": "",
"localData": ["localDatas": [
[
"kind": "",
"name": "",
"routingPolicy": [
"geo": [
"enableFencing": false,
"items": [
[
"healthCheckedTargets": [
"externalEndpoints": [],
"internalLoadBalancers": [
[
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
]
]
],
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
]
],
"kind": ""
],
"geoPolicy": [],
"healthCheck": "",
"kind": "",
"primaryBackup": [
"backupGeoTargets": [],
"kind": "",
"primaryTargets": [],
"trickleTraffic": ""
],
"wrr": [
"items": [
[
"healthCheckedTargets": [],
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
]
],
"kind": ""
],
"wrrPolicy": []
],
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
]
]],
"ruleName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")! as URL,
cachePolicy: .useProtocolCachePolicy,
timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data
let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
if (error != nil) {
print(error as Any)
} else {
let httpResponse = response as? HTTPURLResponse
print(httpResponse)
}
})
dataTask.resume()
DELETE
dns.responsePolicyRules.delete
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
QUERY PARAMS
project
responsePolicy
responsePolicyRule
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"))
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'DELETE',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule",
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule";
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("DELETE").unwrap(), url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request DELETE \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
http DELETE {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")! 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
dns.responsePolicyRules.get
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
QUERY PARAMS
project
responsePolicy
responsePolicyRule
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"))
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule",
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
http GET {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")! 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
dns.responsePolicyRules.list
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules
QUERY PARAMS
project
responsePolicy
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"))
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules',
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules';
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules",
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")
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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules";
let client = reqwest::Client::new();
let response = client.get(url)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request GET \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules
http GET {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules")! 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
dns.responsePolicyRules.patch
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
QUERY PARAMS
project
responsePolicy
responsePolicyRule
BODY json
{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule" {:content-type :json
:form-params {:behavior ""
:dnsName ""
:kind ""
:localData {:localDatas [{:kind ""
:name ""
:routingPolicy {:geo {:enableFencing false
:items [{:healthCheckedTargets {:externalEndpoints []
:internalLoadBalancers [{:ipAddress ""
:ipProtocol ""
:kind ""
:loadBalancerType ""
:networkUrl ""
:port ""
:project ""
:region ""}]}
:kind ""
:location ""
:rrdatas []
:signatureRrdatas []}]
:kind ""}
:geoPolicy {}
:healthCheck ""
:kind ""
:primaryBackup {:backupGeoTargets {}
:kind ""
:primaryTargets {}
:trickleTraffic ""}
:wrr {:items [{:healthCheckedTargets {}
:kind ""
:rrdatas []
:signatureRrdatas []
:weight ""}]
:kind ""}
:wrrPolicy {}}
:rrdatas []
:signatureRrdatas []
:ttl 0
:type ""}]}
:ruleName ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"),
Content = new StringContent("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
payload := strings.NewReader("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1682
{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.setHeader("content-type", "application/json")
.setBody("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.header("content-type", "application/json")
.body("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
.asString();
const data = JSON.stringify({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
headers: {'content-type': 'application/json'},
data: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"behavior":"","dnsName":"","kind":"","localData":{"localDatas":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}]},"ruleName":""}'
};
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "behavior": "",\n "dnsName": "",\n "kind": "",\n "localData": {\n "localDatas": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ]\n },\n "ruleName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
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({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
headers: {'content-type': 'application/json'},
body: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
},
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
});
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
headers: {'content-type': 'application/json'},
data: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"behavior":"","dnsName":"","kind":"","localData":{"localDatas":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}]},"ruleName":""}'
};
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 = @{ @"behavior": @"",
@"dnsName": @"",
@"kind": @"",
@"localData": @{ @"localDatas": @[ @{ @"kind": @"", @"name": @"", @"routingPolicy": @{ @"geo": @{ @"enableFencing": @NO, @"items": @[ @{ @"healthCheckedTargets": @{ @"externalEndpoints": @[ ], @"internalLoadBalancers": @[ @{ @"ipAddress": @"", @"ipProtocol": @"", @"kind": @"", @"loadBalancerType": @"", @"networkUrl": @"", @"port": @"", @"project": @"", @"region": @"" } ] }, @"kind": @"", @"location": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ] } ], @"kind": @"" }, @"geoPolicy": @{ }, @"healthCheck": @"", @"kind": @"", @"primaryBackup": @{ @"backupGeoTargets": @{ }, @"kind": @"", @"primaryTargets": @{ }, @"trickleTraffic": @"" }, @"wrr": @{ @"items": @[ @{ @"healthCheckedTargets": @{ }, @"kind": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"weight": @"" } ], @"kind": @"" }, @"wrrPolicy": @{ } }, @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"ttl": @0, @"type": @"" } ] },
@"ruleName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule",
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([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]),
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule', [
'body' => '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setRequestMethod('PATCH');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
payload = {
"behavior": "",
"dnsName": "",
"kind": "",
"localData": { "localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": False,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
] },
"ruleName": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
payload <- "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
encode <- "json"
response <- VERB("PATCH", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule') do |req|
req.body = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule";
let payload = json!({
"behavior": "",
"dnsName": "",
"kind": "",
"localData": json!({"localDatas": (
json!({
"kind": "",
"name": "",
"routingPolicy": json!({
"geo": json!({
"enableFencing": false,
"items": (
json!({
"healthCheckedTargets": json!({
"externalEndpoints": (),
"internalLoadBalancers": (
json!({
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
})
)
}),
"kind": "",
"location": "",
"rrdatas": (),
"signatureRrdatas": ()
})
),
"kind": ""
}),
"geoPolicy": json!({}),
"healthCheck": "",
"kind": "",
"primaryBackup": json!({
"backupGeoTargets": json!({}),
"kind": "",
"primaryTargets": json!({}),
"trickleTraffic": ""
}),
"wrr": json!({
"items": (
json!({
"healthCheckedTargets": json!({}),
"kind": "",
"rrdatas": (),
"signatureRrdatas": (),
"weight": ""
})
),
"kind": ""
}),
"wrrPolicy": json!({})
}),
"rrdatas": (),
"signatureRrdatas": (),
"ttl": 0,
"type": ""
})
)}),
"ruleName": ""
});
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)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PATCH \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule \
--header 'content-type: application/json' \
--data '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
echo '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}' | \
http PATCH {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "behavior": "",\n "dnsName": "",\n "kind": "",\n "localData": {\n "localDatas": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ]\n },\n "ruleName": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"behavior": "",
"dnsName": "",
"kind": "",
"localData": ["localDatas": [
[
"kind": "",
"name": "",
"routingPolicy": [
"geo": [
"enableFencing": false,
"items": [
[
"healthCheckedTargets": [
"externalEndpoints": [],
"internalLoadBalancers": [
[
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
]
]
],
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
]
],
"kind": ""
],
"geoPolicy": [],
"healthCheck": "",
"kind": "",
"primaryBackup": [
"backupGeoTargets": [],
"kind": "",
"primaryTargets": [],
"trickleTraffic": ""
],
"wrr": [
"items": [
[
"healthCheckedTargets": [],
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
]
],
"kind": ""
],
"wrrPolicy": []
],
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
]
]],
"ruleName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")! 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()
PUT
dns.responsePolicyRules.update
{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
QUERY PARAMS
project
responsePolicy
responsePolicyRule
BODY json
{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PUT");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/put "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule" {:content-type :json
:form-params {:behavior ""
:dnsName ""
:kind ""
:localData {:localDatas [{:kind ""
:name ""
:routingPolicy {:geo {:enableFencing false
:items [{:healthCheckedTargets {:externalEndpoints []
:internalLoadBalancers [{:ipAddress ""
:ipProtocol ""
:kind ""
:loadBalancerType ""
:networkUrl ""
:port ""
:project ""
:region ""}]}
:kind ""
:location ""
:rrdatas []
:signatureRrdatas []}]
:kind ""}
:geoPolicy {}
:healthCheck ""
:kind ""
:primaryBackup {:backupGeoTargets {}
:kind ""
:primaryTargets {}
:trickleTraffic ""}
:wrr {:items [{:healthCheckedTargets {}
:kind ""
:rrdatas []
:signatureRrdatas []
:weight ""}]
:kind ""}
:wrrPolicy {}}
:rrdatas []
:signatureRrdatas []
:ttl 0
:type ""}]}
:ruleName ""}})
require "http/client"
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"),
Content = new StringContent("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule");
var request = new RestRequest("", Method.Put);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
payload := strings.NewReader("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1682
{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PUT", "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.setHeader("content-type", "application/json")
.setBody("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"))
.header("content-type", "application/json")
.method("PUT", HttpRequest.BodyPublishers.ofString("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.put(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.put("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.header("content-type", "application/json")
.body("{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
.asString();
const data = JSON.stringify({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PUT', '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
headers: {'content-type': 'application/json'},
data: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"behavior":"","dnsName":"","kind":"","localData":{"localDatas":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}]},"ruleName":""}'
};
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
method: 'PUT',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "behavior": "",\n "dnsName": "",\n "kind": "",\n "localData": {\n "localDatas": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ]\n },\n "ruleName": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
.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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
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({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}));
req.end();
const request = require('request');
const options = {
method: 'PUT',
url: '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
headers: {'content-type': 'application/json'},
body: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
},
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {
backupGeoTargets: {},
kind: '',
primaryTargets: {},
trickleTraffic: ''
},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
});
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule',
headers: {'content-type': 'application/json'},
data: {
behavior: '',
dnsName: '',
kind: '',
localData: {
localDatas: [
{
kind: '',
name: '',
routingPolicy: {
geo: {
enableFencing: false,
items: [
{
healthCheckedTargets: {
externalEndpoints: [],
internalLoadBalancers: [
{
ipAddress: '',
ipProtocol: '',
kind: '',
loadBalancerType: '',
networkUrl: '',
port: '',
project: '',
region: ''
}
]
},
kind: '',
location: '',
rrdatas: [],
signatureRrdatas: []
}
],
kind: ''
},
geoPolicy: {},
healthCheck: '',
kind: '',
primaryBackup: {backupGeoTargets: {}, kind: '', primaryTargets: {}, trickleTraffic: ''},
wrr: {
items: [
{
healthCheckedTargets: {},
kind: '',
rrdatas: [],
signatureRrdatas: [],
weight: ''
}
],
kind: ''
},
wrrPolicy: {}
},
rrdatas: [],
signatureRrdatas: [],
ttl: 0,
type: ''
}
]
},
ruleName: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule';
const options = {
method: 'PUT',
headers: {'content-type': 'application/json'},
body: '{"behavior":"","dnsName":"","kind":"","localData":{"localDatas":[{"kind":"","name":"","routingPolicy":{"geo":{"enableFencing":false,"items":[{"healthCheckedTargets":{"externalEndpoints":[],"internalLoadBalancers":[{"ipAddress":"","ipProtocol":"","kind":"","loadBalancerType":"","networkUrl":"","port":"","project":"","region":""}]},"kind":"","location":"","rrdatas":[],"signatureRrdatas":[]}],"kind":""},"geoPolicy":{},"healthCheck":"","kind":"","primaryBackup":{"backupGeoTargets":{},"kind":"","primaryTargets":{},"trickleTraffic":""},"wrr":{"items":[{"healthCheckedTargets":{},"kind":"","rrdatas":[],"signatureRrdatas":[],"weight":""}],"kind":""},"wrrPolicy":{}},"rrdatas":[],"signatureRrdatas":[],"ttl":0,"type":""}]},"ruleName":""}'
};
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 = @{ @"behavior": @"",
@"dnsName": @"",
@"kind": @"",
@"localData": @{ @"localDatas": @[ @{ @"kind": @"", @"name": @"", @"routingPolicy": @{ @"geo": @{ @"enableFencing": @NO, @"items": @[ @{ @"healthCheckedTargets": @{ @"externalEndpoints": @[ ], @"internalLoadBalancers": @[ @{ @"ipAddress": @"", @"ipProtocol": @"", @"kind": @"", @"loadBalancerType": @"", @"networkUrl": @"", @"port": @"", @"project": @"", @"region": @"" } ] }, @"kind": @"", @"location": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ] } ], @"kind": @"" }, @"geoPolicy": @{ }, @"healthCheck": @"", @"kind": @"", @"primaryBackup": @{ @"backupGeoTargets": @{ }, @"kind": @"", @"primaryTargets": @{ }, @"trickleTraffic": @"" }, @"wrr": @{ @"items": @[ @{ @"healthCheckedTargets": @{ }, @"kind": @"", @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"weight": @"" } ], @"kind": @"" }, @"wrrPolicy": @{ } }, @"rrdatas": @[ ], @"signatureRrdatas": @[ ], @"ttl": @0, @"type": @"" } ] },
@"ruleName": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"]
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}" in
Client.call ~headers ~body `PUT uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule",
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([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]),
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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule', [
'body' => '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setMethod(HTTP_METH_PUT);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'behavior' => '',
'dnsName' => '',
'kind' => '',
'localData' => [
'localDatas' => [
[
'kind' => '',
'name' => '',
'routingPolicy' => [
'geo' => [
'enableFencing' => null,
'items' => [
[
'healthCheckedTargets' => [
'externalEndpoints' => [
],
'internalLoadBalancers' => [
[
'ipAddress' => '',
'ipProtocol' => '',
'kind' => '',
'loadBalancerType' => '',
'networkUrl' => '',
'port' => '',
'project' => '',
'region' => ''
]
]
],
'kind' => '',
'location' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
]
]
],
'kind' => ''
],
'geoPolicy' => [
],
'healthCheck' => '',
'kind' => '',
'primaryBackup' => [
'backupGeoTargets' => [
],
'kind' => '',
'primaryTargets' => [
],
'trickleTraffic' => ''
],
'wrr' => [
'items' => [
[
'healthCheckedTargets' => [
],
'kind' => '',
'rrdatas' => [
],
'signatureRrdatas' => [
],
'weight' => ''
]
],
'kind' => ''
],
'wrrPolicy' => [
]
],
'rrdatas' => [
],
'signatureRrdatas' => [
],
'ttl' => 0,
'type' => ''
]
]
],
'ruleName' => ''
]));
$request->setRequestUrl('{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule');
$request->setRequestMethod('PUT');
$request->setBody($body);
$request->setHeaders([
'content-type' => 'application/json'
]);
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-WebRequest -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule' -Method PUT -Headers $headers -ContentType 'application/json' -Body '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PUT", "/baseUrl/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
payload = {
"behavior": "",
"dnsName": "",
"kind": "",
"localData": { "localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": False,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
] },
"ruleName": ""
}
headers = {"content-type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule"
payload <- "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\n}"
encode <- "json"
response <- VERB("PUT", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")
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 \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule') do |req|
req.body = "{\n \"behavior\": \"\",\n \"dnsName\": \"\",\n \"kind\": \"\",\n \"localData\": {\n \"localDatas\": [\n {\n \"kind\": \"\",\n \"name\": \"\",\n \"routingPolicy\": {\n \"geo\": {\n \"enableFencing\": false,\n \"items\": [\n {\n \"healthCheckedTargets\": {\n \"externalEndpoints\": [],\n \"internalLoadBalancers\": [\n {\n \"ipAddress\": \"\",\n \"ipProtocol\": \"\",\n \"kind\": \"\",\n \"loadBalancerType\": \"\",\n \"networkUrl\": \"\",\n \"port\": \"\",\n \"project\": \"\",\n \"region\": \"\"\n }\n ]\n },\n \"kind\": \"\",\n \"location\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": []\n }\n ],\n \"kind\": \"\"\n },\n \"geoPolicy\": {},\n \"healthCheck\": \"\",\n \"kind\": \"\",\n \"primaryBackup\": {\n \"backupGeoTargets\": {},\n \"kind\": \"\",\n \"primaryTargets\": {},\n \"trickleTraffic\": \"\"\n },\n \"wrr\": {\n \"items\": [\n {\n \"healthCheckedTargets\": {},\n \"kind\": \"\",\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"weight\": \"\"\n }\n ],\n \"kind\": \"\"\n },\n \"wrrPolicy\": {}\n },\n \"rrdatas\": [],\n \"signatureRrdatas\": [],\n \"ttl\": 0,\n \"type\": \"\"\n }\n ]\n },\n \"ruleName\": \"\"\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}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule";
let payload = json!({
"behavior": "",
"dnsName": "",
"kind": "",
"localData": json!({"localDatas": (
json!({
"kind": "",
"name": "",
"routingPolicy": json!({
"geo": json!({
"enableFencing": false,
"items": (
json!({
"healthCheckedTargets": json!({
"externalEndpoints": (),
"internalLoadBalancers": (
json!({
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
})
)
}),
"kind": "",
"location": "",
"rrdatas": (),
"signatureRrdatas": ()
})
),
"kind": ""
}),
"geoPolicy": json!({}),
"healthCheck": "",
"kind": "",
"primaryBackup": json!({
"backupGeoTargets": json!({}),
"kind": "",
"primaryTargets": json!({}),
"trickleTraffic": ""
}),
"wrr": json!({
"items": (
json!({
"healthCheckedTargets": json!({}),
"kind": "",
"rrdatas": (),
"signatureRrdatas": (),
"weight": ""
})
),
"kind": ""
}),
"wrrPolicy": json!({})
}),
"rrdatas": (),
"signatureRrdatas": (),
"ttl": 0,
"type": ""
})
)}),
"ruleName": ""
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.request(reqwest::Method::from_str("PUT").unwrap(), url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request PUT \
--url {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule \
--header 'content-type: application/json' \
--data '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}'
echo '{
"behavior": "",
"dnsName": "",
"kind": "",
"localData": {
"localDatas": [
{
"kind": "",
"name": "",
"routingPolicy": {
"geo": {
"enableFencing": false,
"items": [
{
"healthCheckedTargets": {
"externalEndpoints": [],
"internalLoadBalancers": [
{
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
}
]
},
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
}
],
"kind": ""
},
"geoPolicy": {},
"healthCheck": "",
"kind": "",
"primaryBackup": {
"backupGeoTargets": {},
"kind": "",
"primaryTargets": {},
"trickleTraffic": ""
},
"wrr": {
"items": [
{
"healthCheckedTargets": {},
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
}
],
"kind": ""
},
"wrrPolicy": {}
},
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
}
]
},
"ruleName": ""
}' | \
http PUT {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule \
content-type:application/json
wget --quiet \
--method PUT \
--header 'content-type: application/json' \
--body-data '{\n "behavior": "",\n "dnsName": "",\n "kind": "",\n "localData": {\n "localDatas": [\n {\n "kind": "",\n "name": "",\n "routingPolicy": {\n "geo": {\n "enableFencing": false,\n "items": [\n {\n "healthCheckedTargets": {\n "externalEndpoints": [],\n "internalLoadBalancers": [\n {\n "ipAddress": "",\n "ipProtocol": "",\n "kind": "",\n "loadBalancerType": "",\n "networkUrl": "",\n "port": "",\n "project": "",\n "region": ""\n }\n ]\n },\n "kind": "",\n "location": "",\n "rrdatas": [],\n "signatureRrdatas": []\n }\n ],\n "kind": ""\n },\n "geoPolicy": {},\n "healthCheck": "",\n "kind": "",\n "primaryBackup": {\n "backupGeoTargets": {},\n "kind": "",\n "primaryTargets": {},\n "trickleTraffic": ""\n },\n "wrr": {\n "items": [\n {\n "healthCheckedTargets": {},\n "kind": "",\n "rrdatas": [],\n "signatureRrdatas": [],\n "weight": ""\n }\n ],\n "kind": ""\n },\n "wrrPolicy": {}\n },\n "rrdatas": [],\n "signatureRrdatas": [],\n "ttl": 0,\n "type": ""\n }\n ]\n },\n "ruleName": ""\n}' \
--output-document \
- {{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"behavior": "",
"dnsName": "",
"kind": "",
"localData": ["localDatas": [
[
"kind": "",
"name": "",
"routingPolicy": [
"geo": [
"enableFencing": false,
"items": [
[
"healthCheckedTargets": [
"externalEndpoints": [],
"internalLoadBalancers": [
[
"ipAddress": "",
"ipProtocol": "",
"kind": "",
"loadBalancerType": "",
"networkUrl": "",
"port": "",
"project": "",
"region": ""
]
]
],
"kind": "",
"location": "",
"rrdatas": [],
"signatureRrdatas": []
]
],
"kind": ""
],
"geoPolicy": [],
"healthCheck": "",
"kind": "",
"primaryBackup": [
"backupGeoTargets": [],
"kind": "",
"primaryTargets": [],
"trickleTraffic": ""
],
"wrr": [
"items": [
[
"healthCheckedTargets": [],
"kind": "",
"rrdatas": [],
"signatureRrdatas": [],
"weight": ""
]
],
"kind": ""
],
"wrrPolicy": []
],
"rrdatas": [],
"signatureRrdatas": [],
"ttl": 0,
"type": ""
]
]],
"ruleName": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/dns/v1beta2/projects/:project/responsePolicies/:responsePolicy/rules/:responsePolicyRule")! 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()