VM Migration API
POST
vmmigration.projects.locations.groups.addGroupMigration
{{baseUrl}}/v1alpha1/:group:addGroupMigration
QUERY PARAMS
group
BODY json
{
"migratingVm": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:group:addGroupMigration");
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 \"migratingVm\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:group:addGroupMigration" {:content-type :json
:form-params {:migratingVm ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:group:addGroupMigration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"migratingVm\": \"\"\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}}/v1alpha1/:group:addGroupMigration"),
Content = new StringContent("{\n \"migratingVm\": \"\"\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}}/v1alpha1/:group:addGroupMigration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"migratingVm\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:group:addGroupMigration"
payload := strings.NewReader("{\n \"migratingVm\": \"\"\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/v1alpha1/:group:addGroupMigration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"migratingVm": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:group:addGroupMigration")
.setHeader("content-type", "application/json")
.setBody("{\n \"migratingVm\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:group:addGroupMigration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"migratingVm\": \"\"\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 \"migratingVm\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:group:addGroupMigration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:group:addGroupMigration")
.header("content-type", "application/json")
.body("{\n \"migratingVm\": \"\"\n}")
.asString();
const data = JSON.stringify({
migratingVm: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:group:addGroupMigration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:group:addGroupMigration',
headers: {'content-type': 'application/json'},
data: {migratingVm: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:group:addGroupMigration';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"migratingVm":""}'
};
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}}/v1alpha1/:group:addGroupMigration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "migratingVm": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"migratingVm\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:group:addGroupMigration")
.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/v1alpha1/:group:addGroupMigration',
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({migratingVm: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:group:addGroupMigration',
headers: {'content-type': 'application/json'},
body: {migratingVm: ''},
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}}/v1alpha1/:group:addGroupMigration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
migratingVm: ''
});
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}}/v1alpha1/:group:addGroupMigration',
headers: {'content-type': 'application/json'},
data: {migratingVm: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:group:addGroupMigration';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"migratingVm":""}'
};
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 = @{ @"migratingVm": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:group:addGroupMigration"]
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}}/v1alpha1/:group:addGroupMigration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"migratingVm\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:group:addGroupMigration",
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([
'migratingVm' => ''
]),
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}}/v1alpha1/:group:addGroupMigration', [
'body' => '{
"migratingVm": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:group:addGroupMigration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'migratingVm' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'migratingVm' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:group:addGroupMigration');
$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}}/v1alpha1/:group:addGroupMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"migratingVm": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:group:addGroupMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"migratingVm": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"migratingVm\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:group:addGroupMigration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:group:addGroupMigration"
payload = { "migratingVm": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:group:addGroupMigration"
payload <- "{\n \"migratingVm\": \"\"\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}}/v1alpha1/:group:addGroupMigration")
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 \"migratingVm\": \"\"\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/v1alpha1/:group:addGroupMigration') do |req|
req.body = "{\n \"migratingVm\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:group:addGroupMigration";
let payload = json!({"migratingVm": ""});
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}}/v1alpha1/:group:addGroupMigration \
--header 'content-type: application/json' \
--data '{
"migratingVm": ""
}'
echo '{
"migratingVm": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:group:addGroupMigration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "migratingVm": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:group:addGroupMigration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["migratingVm": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:group:addGroupMigration")! 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
vmmigration.projects.locations.groups.create
{{baseUrl}}/v1alpha1/:parent/groups
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/groups");
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 \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/groups" {:content-type :json
:form-params {:createTime ""
:description ""
:displayName ""
:name ""
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/groups"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/groups"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/groups");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/groups"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\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/v1alpha1/:parent/groups HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 98
{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/groups")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/groups"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\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 \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/groups")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/groups")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
description: '',
displayName: '',
name: '',
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/groups');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/groups',
headers: {'content-type': 'application/json'},
data: {createTime: '', description: '', displayName: '', name: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/groups';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","description":"","displayName":"","name":"","updateTime":""}'
};
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}}/v1alpha1/:parent/groups',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "description": "",\n "displayName": "",\n "name": "",\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/groups")
.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/v1alpha1/:parent/groups',
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({createTime: '', description: '', displayName: '', name: '', updateTime: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/groups',
headers: {'content-type': 'application/json'},
body: {createTime: '', description: '', displayName: '', name: '', updateTime: ''},
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}}/v1alpha1/:parent/groups');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
description: '',
displayName: '',
name: '',
updateTime: ''
});
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}}/v1alpha1/:parent/groups',
headers: {'content-type': 'application/json'},
data: {createTime: '', description: '', displayName: '', name: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/groups';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","description":"","displayName":"","name":"","updateTime":""}'
};
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 = @{ @"createTime": @"",
@"description": @"",
@"displayName": @"",
@"name": @"",
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/groups"]
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}}/v1alpha1/:parent/groups" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/groups",
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([
'createTime' => '',
'description' => '',
'displayName' => '',
'name' => '',
'updateTime' => ''
]),
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}}/v1alpha1/:parent/groups', [
'body' => '{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/groups');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'description' => '',
'displayName' => '',
'name' => '',
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'description' => '',
'displayName' => '',
'name' => '',
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/groups');
$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}}/v1alpha1/:parent/groups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/groups' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/groups", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/groups"
payload = {
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/groups"
payload <- "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/groups")
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 \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\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/v1alpha1/:parent/groups') do |req|
req.body = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"displayName\": \"\",\n \"name\": \"\",\n \"updateTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/groups";
let payload = json!({
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
});
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}}/v1alpha1/:parent/groups \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}'
echo '{
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/groups \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "description": "",\n "displayName": "",\n "name": "",\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/groups
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"description": "",
"displayName": "",
"name": "",
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/groups")! 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
vmmigration.projects.locations.groups.list
{{baseUrl}}/v1alpha1/:parent/groups
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/groups");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/groups")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/groups"
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}}/v1alpha1/:parent/groups"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/groups");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/groups"
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/v1alpha1/:parent/groups HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/groups")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/groups"))
.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}}/v1alpha1/:parent/groups")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/groups")
.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}}/v1alpha1/:parent/groups');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:parent/groups'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/groups';
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}}/v1alpha1/:parent/groups',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/groups")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/groups',
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}}/v1alpha1/:parent/groups'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/groups');
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}}/v1alpha1/:parent/groups'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/groups';
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}}/v1alpha1/:parent/groups"]
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}}/v1alpha1/:parent/groups" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/groups",
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}}/v1alpha1/:parent/groups');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/groups');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/groups');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/groups' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/groups' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/groups")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/groups"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/groups"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/groups")
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/v1alpha1/:parent/groups') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/groups";
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}}/v1alpha1/:parent/groups
http GET {{baseUrl}}/v1alpha1/:parent/groups
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/groups
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/groups")! 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
vmmigration.projects.locations.groups.removeGroupMigration
{{baseUrl}}/v1alpha1/:group:removeGroupMigration
QUERY PARAMS
group
BODY json
{
"migratingVm": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:group:removeGroupMigration");
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 \"migratingVm\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:group:removeGroupMigration" {:content-type :json
:form-params {:migratingVm ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:group:removeGroupMigration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"migratingVm\": \"\"\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}}/v1alpha1/:group:removeGroupMigration"),
Content = new StringContent("{\n \"migratingVm\": \"\"\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}}/v1alpha1/:group:removeGroupMigration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"migratingVm\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:group:removeGroupMigration"
payload := strings.NewReader("{\n \"migratingVm\": \"\"\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/v1alpha1/:group:removeGroupMigration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 23
{
"migratingVm": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:group:removeGroupMigration")
.setHeader("content-type", "application/json")
.setBody("{\n \"migratingVm\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:group:removeGroupMigration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"migratingVm\": \"\"\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 \"migratingVm\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:group:removeGroupMigration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:group:removeGroupMigration")
.header("content-type", "application/json")
.body("{\n \"migratingVm\": \"\"\n}")
.asString();
const data = JSON.stringify({
migratingVm: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:group:removeGroupMigration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:group:removeGroupMigration',
headers: {'content-type': 'application/json'},
data: {migratingVm: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:group:removeGroupMigration';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"migratingVm":""}'
};
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}}/v1alpha1/:group:removeGroupMigration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "migratingVm": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"migratingVm\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:group:removeGroupMigration")
.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/v1alpha1/:group:removeGroupMigration',
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({migratingVm: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:group:removeGroupMigration',
headers: {'content-type': 'application/json'},
body: {migratingVm: ''},
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}}/v1alpha1/:group:removeGroupMigration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
migratingVm: ''
});
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}}/v1alpha1/:group:removeGroupMigration',
headers: {'content-type': 'application/json'},
data: {migratingVm: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:group:removeGroupMigration';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"migratingVm":""}'
};
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 = @{ @"migratingVm": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:group:removeGroupMigration"]
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}}/v1alpha1/:group:removeGroupMigration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"migratingVm\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:group:removeGroupMigration",
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([
'migratingVm' => ''
]),
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}}/v1alpha1/:group:removeGroupMigration', [
'body' => '{
"migratingVm": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:group:removeGroupMigration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'migratingVm' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'migratingVm' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:group:removeGroupMigration');
$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}}/v1alpha1/:group:removeGroupMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"migratingVm": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:group:removeGroupMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"migratingVm": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"migratingVm\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:group:removeGroupMigration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:group:removeGroupMigration"
payload = { "migratingVm": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:group:removeGroupMigration"
payload <- "{\n \"migratingVm\": \"\"\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}}/v1alpha1/:group:removeGroupMigration")
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 \"migratingVm\": \"\"\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/v1alpha1/:group:removeGroupMigration') do |req|
req.body = "{\n \"migratingVm\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:group:removeGroupMigration";
let payload = json!({"migratingVm": ""});
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}}/v1alpha1/:group:removeGroupMigration \
--header 'content-type: application/json' \
--data '{
"migratingVm": ""
}'
echo '{
"migratingVm": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:group:removeGroupMigration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "migratingVm": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:group:removeGroupMigration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["migratingVm": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:group:removeGroupMigration")! 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
vmmigration.projects.locations.list
{{baseUrl}}/v1alpha1/:name/locations
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:name/locations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:name/locations")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:name/locations"
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}}/v1alpha1/:name/locations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:name/locations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:name/locations"
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/v1alpha1/:name/locations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:name/locations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:name/locations"))
.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}}/v1alpha1/:name/locations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:name/locations")
.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}}/v1alpha1/:name/locations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:name/locations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:name/locations';
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}}/v1alpha1/:name/locations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name/locations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:name/locations',
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}}/v1alpha1/:name/locations'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:name/locations');
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}}/v1alpha1/:name/locations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:name/locations';
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}}/v1alpha1/:name/locations"]
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}}/v1alpha1/:name/locations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:name/locations",
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}}/v1alpha1/:name/locations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:name/locations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:name/locations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:name/locations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:name/locations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:name/locations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:name/locations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:name/locations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:name/locations")
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/v1alpha1/:name/locations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:name/locations";
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}}/v1alpha1/:name/locations
http GET {{baseUrl}}/v1alpha1/:name/locations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:name/locations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:name/locations")! 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
vmmigration.projects.locations.operations.list
{{baseUrl}}/v1alpha1/:name/operations
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:name/operations");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:name/operations")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/operations"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:name/operations");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:name/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/v1alpha1/:name/operations HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:name/operations")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/operations")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/operations');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:name/operations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/operations',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name/operations")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:name/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}}/v1alpha1/:name/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}}/v1alpha1/:name/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}}/v1alpha1/:name/operations'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/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}}/v1alpha1/:name/operations" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/operations');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:name/operations');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:name/operations');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:name/operations' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:name/operations' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:name/operations")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:name/operations"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:name/operations"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:name/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/v1alpha1/:name/operations') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:name/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}}/v1alpha1/:name/operations
http GET {{baseUrl}}/v1alpha1/:name/operations
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:name/operations
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:name/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
vmmigration.projects.locations.sources.create
{{baseUrl}}/v1alpha1/:parent/sources
QUERY PARAMS
parent
BODY json
{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/sources");
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 \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/sources" {:content-type :json
:form-params {:aws {:accessKeyCreds {:accessKeyId ""
:secretAccessKey ""
:sessionToken ""}
:awsRegion ""
:error {:code 0
:details [{}]
:message ""}
:inventorySecurityGroupNames []
:inventoryTagList [{:key ""
:value ""}]
:migrationResourcesUserTags {}
:publicIp ""
:state ""}
:createTime ""
:description ""
:error {}
:labels {}
:name ""
:updateTime ""
:vmware {:password ""
:thumbprint ""
:username ""
:vcenterIp ""}}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/sources"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\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}}/v1alpha1/:parent/sources"),
Content = new StringContent("{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\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}}/v1alpha1/:parent/sources");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/sources"
payload := strings.NewReader("{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\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/v1alpha1/:parent/sources HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 655
{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/sources")
.setHeader("content-type", "application/json")
.setBody("{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/sources"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\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 \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/sources")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/sources")
.header("content-type", "application/json")
.body("{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}")
.asString();
const data = JSON.stringify({
aws: {
accessKeyCreds: {
accessKeyId: '',
secretAccessKey: '',
sessionToken: ''
},
awsRegion: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
inventorySecurityGroupNames: [],
inventoryTagList: [
{
key: '',
value: ''
}
],
migrationResourcesUserTags: {},
publicIp: '',
state: ''
},
createTime: '',
description: '',
error: {},
labels: {},
name: '',
updateTime: '',
vmware: {
password: '',
thumbprint: '',
username: '',
vcenterIp: ''
}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/sources');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/sources',
headers: {'content-type': 'application/json'},
data: {
aws: {
accessKeyCreds: {accessKeyId: '', secretAccessKey: '', sessionToken: ''},
awsRegion: '',
error: {code: 0, details: [{}], message: ''},
inventorySecurityGroupNames: [],
inventoryTagList: [{key: '', value: ''}],
migrationResourcesUserTags: {},
publicIp: '',
state: ''
},
createTime: '',
description: '',
error: {},
labels: {},
name: '',
updateTime: '',
vmware: {password: '', thumbprint: '', username: '', vcenterIp: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/sources';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"aws":{"accessKeyCreds":{"accessKeyId":"","secretAccessKey":"","sessionToken":""},"awsRegion":"","error":{"code":0,"details":[{}],"message":""},"inventorySecurityGroupNames":[],"inventoryTagList":[{"key":"","value":""}],"migrationResourcesUserTags":{},"publicIp":"","state":""},"createTime":"","description":"","error":{},"labels":{},"name":"","updateTime":"","vmware":{"password":"","thumbprint":"","username":"","vcenterIp":""}}'
};
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}}/v1alpha1/:parent/sources',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "aws": {\n "accessKeyCreds": {\n "accessKeyId": "",\n "secretAccessKey": "",\n "sessionToken": ""\n },\n "awsRegion": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "inventorySecurityGroupNames": [],\n "inventoryTagList": [\n {\n "key": "",\n "value": ""\n }\n ],\n "migrationResourcesUserTags": {},\n "publicIp": "",\n "state": ""\n },\n "createTime": "",\n "description": "",\n "error": {},\n "labels": {},\n "name": "",\n "updateTime": "",\n "vmware": {\n "password": "",\n "thumbprint": "",\n "username": "",\n "vcenterIp": ""\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 \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/sources")
.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/v1alpha1/:parent/sources',
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({
aws: {
accessKeyCreds: {accessKeyId: '', secretAccessKey: '', sessionToken: ''},
awsRegion: '',
error: {code: 0, details: [{}], message: ''},
inventorySecurityGroupNames: [],
inventoryTagList: [{key: '', value: ''}],
migrationResourcesUserTags: {},
publicIp: '',
state: ''
},
createTime: '',
description: '',
error: {},
labels: {},
name: '',
updateTime: '',
vmware: {password: '', thumbprint: '', username: '', vcenterIp: ''}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/sources',
headers: {'content-type': 'application/json'},
body: {
aws: {
accessKeyCreds: {accessKeyId: '', secretAccessKey: '', sessionToken: ''},
awsRegion: '',
error: {code: 0, details: [{}], message: ''},
inventorySecurityGroupNames: [],
inventoryTagList: [{key: '', value: ''}],
migrationResourcesUserTags: {},
publicIp: '',
state: ''
},
createTime: '',
description: '',
error: {},
labels: {},
name: '',
updateTime: '',
vmware: {password: '', thumbprint: '', username: '', vcenterIp: ''}
},
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}}/v1alpha1/:parent/sources');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
aws: {
accessKeyCreds: {
accessKeyId: '',
secretAccessKey: '',
sessionToken: ''
},
awsRegion: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
inventorySecurityGroupNames: [],
inventoryTagList: [
{
key: '',
value: ''
}
],
migrationResourcesUserTags: {},
publicIp: '',
state: ''
},
createTime: '',
description: '',
error: {},
labels: {},
name: '',
updateTime: '',
vmware: {
password: '',
thumbprint: '',
username: '',
vcenterIp: ''
}
});
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}}/v1alpha1/:parent/sources',
headers: {'content-type': 'application/json'},
data: {
aws: {
accessKeyCreds: {accessKeyId: '', secretAccessKey: '', sessionToken: ''},
awsRegion: '',
error: {code: 0, details: [{}], message: ''},
inventorySecurityGroupNames: [],
inventoryTagList: [{key: '', value: ''}],
migrationResourcesUserTags: {},
publicIp: '',
state: ''
},
createTime: '',
description: '',
error: {},
labels: {},
name: '',
updateTime: '',
vmware: {password: '', thumbprint: '', username: '', vcenterIp: ''}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/sources';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"aws":{"accessKeyCreds":{"accessKeyId":"","secretAccessKey":"","sessionToken":""},"awsRegion":"","error":{"code":0,"details":[{}],"message":""},"inventorySecurityGroupNames":[],"inventoryTagList":[{"key":"","value":""}],"migrationResourcesUserTags":{},"publicIp":"","state":""},"createTime":"","description":"","error":{},"labels":{},"name":"","updateTime":"","vmware":{"password":"","thumbprint":"","username":"","vcenterIp":""}}'
};
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 = @{ @"aws": @{ @"accessKeyCreds": @{ @"accessKeyId": @"", @"secretAccessKey": @"", @"sessionToken": @"" }, @"awsRegion": @"", @"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" }, @"inventorySecurityGroupNames": @[ ], @"inventoryTagList": @[ @{ @"key": @"", @"value": @"" } ], @"migrationResourcesUserTags": @{ }, @"publicIp": @"", @"state": @"" },
@"createTime": @"",
@"description": @"",
@"error": @{ },
@"labels": @{ },
@"name": @"",
@"updateTime": @"",
@"vmware": @{ @"password": @"", @"thumbprint": @"", @"username": @"", @"vcenterIp": @"" } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/sources"]
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}}/v1alpha1/:parent/sources" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/sources",
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([
'aws' => [
'accessKeyCreds' => [
'accessKeyId' => '',
'secretAccessKey' => '',
'sessionToken' => ''
],
'awsRegion' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'inventorySecurityGroupNames' => [
],
'inventoryTagList' => [
[
'key' => '',
'value' => ''
]
],
'migrationResourcesUserTags' => [
],
'publicIp' => '',
'state' => ''
],
'createTime' => '',
'description' => '',
'error' => [
],
'labels' => [
],
'name' => '',
'updateTime' => '',
'vmware' => [
'password' => '',
'thumbprint' => '',
'username' => '',
'vcenterIp' => ''
]
]),
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}}/v1alpha1/:parent/sources', [
'body' => '{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/sources');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'aws' => [
'accessKeyCreds' => [
'accessKeyId' => '',
'secretAccessKey' => '',
'sessionToken' => ''
],
'awsRegion' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'inventorySecurityGroupNames' => [
],
'inventoryTagList' => [
[
'key' => '',
'value' => ''
]
],
'migrationResourcesUserTags' => [
],
'publicIp' => '',
'state' => ''
],
'createTime' => '',
'description' => '',
'error' => [
],
'labels' => [
],
'name' => '',
'updateTime' => '',
'vmware' => [
'password' => '',
'thumbprint' => '',
'username' => '',
'vcenterIp' => ''
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'aws' => [
'accessKeyCreds' => [
'accessKeyId' => '',
'secretAccessKey' => '',
'sessionToken' => ''
],
'awsRegion' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'inventorySecurityGroupNames' => [
],
'inventoryTagList' => [
[
'key' => '',
'value' => ''
]
],
'migrationResourcesUserTags' => [
],
'publicIp' => '',
'state' => ''
],
'createTime' => '',
'description' => '',
'error' => [
],
'labels' => [
],
'name' => '',
'updateTime' => '',
'vmware' => [
'password' => '',
'thumbprint' => '',
'username' => '',
'vcenterIp' => ''
]
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/sources');
$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}}/v1alpha1/:parent/sources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/sources' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/sources", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/sources"
payload = {
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/sources"
payload <- "{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\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}}/v1alpha1/:parent/sources")
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 \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\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/v1alpha1/:parent/sources') do |req|
req.body = "{\n \"aws\": {\n \"accessKeyCreds\": {\n \"accessKeyId\": \"\",\n \"secretAccessKey\": \"\",\n \"sessionToken\": \"\"\n },\n \"awsRegion\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"inventorySecurityGroupNames\": [],\n \"inventoryTagList\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"migrationResourcesUserTags\": {},\n \"publicIp\": \"\",\n \"state\": \"\"\n },\n \"createTime\": \"\",\n \"description\": \"\",\n \"error\": {},\n \"labels\": {},\n \"name\": \"\",\n \"updateTime\": \"\",\n \"vmware\": {\n \"password\": \"\",\n \"thumbprint\": \"\",\n \"username\": \"\",\n \"vcenterIp\": \"\"\n }\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/sources";
let payload = json!({
"aws": json!({
"accessKeyCreds": json!({
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
}),
"awsRegion": "",
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"inventorySecurityGroupNames": (),
"inventoryTagList": (
json!({
"key": "",
"value": ""
})
),
"migrationResourcesUserTags": json!({}),
"publicIp": "",
"state": ""
}),
"createTime": "",
"description": "",
"error": json!({}),
"labels": json!({}),
"name": "",
"updateTime": "",
"vmware": json!({
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
})
});
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}}/v1alpha1/:parent/sources \
--header 'content-type: application/json' \
--data '{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}'
echo '{
"aws": {
"accessKeyCreds": {
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
},
"awsRegion": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"inventorySecurityGroupNames": [],
"inventoryTagList": [
{
"key": "",
"value": ""
}
],
"migrationResourcesUserTags": {},
"publicIp": "",
"state": ""
},
"createTime": "",
"description": "",
"error": {},
"labels": {},
"name": "",
"updateTime": "",
"vmware": {
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
}
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/sources \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "aws": {\n "accessKeyCreds": {\n "accessKeyId": "",\n "secretAccessKey": "",\n "sessionToken": ""\n },\n "awsRegion": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "inventorySecurityGroupNames": [],\n "inventoryTagList": [\n {\n "key": "",\n "value": ""\n }\n ],\n "migrationResourcesUserTags": {},\n "publicIp": "",\n "state": ""\n },\n "createTime": "",\n "description": "",\n "error": {},\n "labels": {},\n "name": "",\n "updateTime": "",\n "vmware": {\n "password": "",\n "thumbprint": "",\n "username": "",\n "vcenterIp": ""\n }\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/sources
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"aws": [
"accessKeyCreds": [
"accessKeyId": "",
"secretAccessKey": "",
"sessionToken": ""
],
"awsRegion": "",
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"inventorySecurityGroupNames": [],
"inventoryTagList": [
[
"key": "",
"value": ""
]
],
"migrationResourcesUserTags": [],
"publicIp": "",
"state": ""
],
"createTime": "",
"description": "",
"error": [],
"labels": [],
"name": "",
"updateTime": "",
"vmware": [
"password": "",
"thumbprint": "",
"username": "",
"vcenterIp": ""
]
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/sources")! 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
vmmigration.projects.locations.sources.datacenterConnectors.create
{{baseUrl}}/v1alpha1/:parent/datacenterConnectors
QUERY PARAMS
parent
BODY json
{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors");
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 \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors" {:content-type :json
:form-params {:applianceInfrastructureVersion ""
:applianceSoftwareVersion ""
:availableVersions {:inPlaceUpdate {:critical false
:releaseNotesUri ""
:uri ""
:version ""}
:newDeployableAppliance {}}
:bucket ""
:createTime ""
:error {:code 0
:details [{}]
:message ""}
:name ""
:registrationId ""
:serviceAccount ""
:state ""
:stateTime ""
:updateTime ""
:upgradeStatus {:error {}
:previousVersion ""
:startTime ""
:state ""
:version ""}
:version ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\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}}/v1alpha1/:parent/datacenterConnectors"),
Content = new StringContent("{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\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}}/v1alpha1/:parent/datacenterConnectors");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
payload := strings.NewReader("{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\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/v1alpha1/:parent/datacenterConnectors HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 639
{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.setHeader("content-type", "application/json")
.setBody("{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\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 \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.header("content-type", "application/json")
.body("{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}")
.asString();
const data = JSON.stringify({
applianceInfrastructureVersion: '',
applianceSoftwareVersion: '',
availableVersions: {
inPlaceUpdate: {
critical: false,
releaseNotesUri: '',
uri: '',
version: ''
},
newDeployableAppliance: {}
},
bucket: '',
createTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
registrationId: '',
serviceAccount: '',
state: '',
stateTime: '',
updateTime: '',
upgradeStatus: {
error: {},
previousVersion: '',
startTime: '',
state: '',
version: ''
},
version: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors',
headers: {'content-type': 'application/json'},
data: {
applianceInfrastructureVersion: '',
applianceSoftwareVersion: '',
availableVersions: {
inPlaceUpdate: {critical: false, releaseNotesUri: '', uri: '', version: ''},
newDeployableAppliance: {}
},
bucket: '',
createTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
registrationId: '',
serviceAccount: '',
state: '',
stateTime: '',
updateTime: '',
upgradeStatus: {error: {}, previousVersion: '', startTime: '', state: '', version: ''},
version: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"applianceInfrastructureVersion":"","applianceSoftwareVersion":"","availableVersions":{"inPlaceUpdate":{"critical":false,"releaseNotesUri":"","uri":"","version":""},"newDeployableAppliance":{}},"bucket":"","createTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","registrationId":"","serviceAccount":"","state":"","stateTime":"","updateTime":"","upgradeStatus":{"error":{},"previousVersion":"","startTime":"","state":"","version":""},"version":""}'
};
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}}/v1alpha1/:parent/datacenterConnectors',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "applianceInfrastructureVersion": "",\n "applianceSoftwareVersion": "",\n "availableVersions": {\n "inPlaceUpdate": {\n "critical": false,\n "releaseNotesUri": "",\n "uri": "",\n "version": ""\n },\n "newDeployableAppliance": {}\n },\n "bucket": "",\n "createTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "registrationId": "",\n "serviceAccount": "",\n "state": "",\n "stateTime": "",\n "updateTime": "",\n "upgradeStatus": {\n "error": {},\n "previousVersion": "",\n "startTime": "",\n "state": "",\n "version": ""\n },\n "version": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.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/v1alpha1/:parent/datacenterConnectors',
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({
applianceInfrastructureVersion: '',
applianceSoftwareVersion: '',
availableVersions: {
inPlaceUpdate: {critical: false, releaseNotesUri: '', uri: '', version: ''},
newDeployableAppliance: {}
},
bucket: '',
createTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
registrationId: '',
serviceAccount: '',
state: '',
stateTime: '',
updateTime: '',
upgradeStatus: {error: {}, previousVersion: '', startTime: '', state: '', version: ''},
version: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors',
headers: {'content-type': 'application/json'},
body: {
applianceInfrastructureVersion: '',
applianceSoftwareVersion: '',
availableVersions: {
inPlaceUpdate: {critical: false, releaseNotesUri: '', uri: '', version: ''},
newDeployableAppliance: {}
},
bucket: '',
createTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
registrationId: '',
serviceAccount: '',
state: '',
stateTime: '',
updateTime: '',
upgradeStatus: {error: {}, previousVersion: '', startTime: '', state: '', version: ''},
version: ''
},
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}}/v1alpha1/:parent/datacenterConnectors');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
applianceInfrastructureVersion: '',
applianceSoftwareVersion: '',
availableVersions: {
inPlaceUpdate: {
critical: false,
releaseNotesUri: '',
uri: '',
version: ''
},
newDeployableAppliance: {}
},
bucket: '',
createTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
registrationId: '',
serviceAccount: '',
state: '',
stateTime: '',
updateTime: '',
upgradeStatus: {
error: {},
previousVersion: '',
startTime: '',
state: '',
version: ''
},
version: ''
});
req.end(function (res) {
if (res.error) throw new Error(res.error);
console.log(res.body);
});
const axios = require('axios').default;
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors',
headers: {'content-type': 'application/json'},
data: {
applianceInfrastructureVersion: '',
applianceSoftwareVersion: '',
availableVersions: {
inPlaceUpdate: {critical: false, releaseNotesUri: '', uri: '', version: ''},
newDeployableAppliance: {}
},
bucket: '',
createTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
registrationId: '',
serviceAccount: '',
state: '',
stateTime: '',
updateTime: '',
upgradeStatus: {error: {}, previousVersion: '', startTime: '', state: '', version: ''},
version: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"applianceInfrastructureVersion":"","applianceSoftwareVersion":"","availableVersions":{"inPlaceUpdate":{"critical":false,"releaseNotesUri":"","uri":"","version":""},"newDeployableAppliance":{}},"bucket":"","createTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","registrationId":"","serviceAccount":"","state":"","stateTime":"","updateTime":"","upgradeStatus":{"error":{},"previousVersion":"","startTime":"","state":"","version":""},"version":""}'
};
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 = @{ @"applianceInfrastructureVersion": @"",
@"applianceSoftwareVersion": @"",
@"availableVersions": @{ @"inPlaceUpdate": @{ @"critical": @NO, @"releaseNotesUri": @"", @"uri": @"", @"version": @"" }, @"newDeployableAppliance": @{ } },
@"bucket": @"",
@"createTime": @"",
@"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" },
@"name": @"",
@"registrationId": @"",
@"serviceAccount": @"",
@"state": @"",
@"stateTime": @"",
@"updateTime": @"",
@"upgradeStatus": @{ @"error": @{ }, @"previousVersion": @"", @"startTime": @"", @"state": @"", @"version": @"" },
@"version": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"]
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}}/v1alpha1/:parent/datacenterConnectors" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/datacenterConnectors",
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([
'applianceInfrastructureVersion' => '',
'applianceSoftwareVersion' => '',
'availableVersions' => [
'inPlaceUpdate' => [
'critical' => null,
'releaseNotesUri' => '',
'uri' => '',
'version' => ''
],
'newDeployableAppliance' => [
]
],
'bucket' => '',
'createTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'registrationId' => '',
'serviceAccount' => '',
'state' => '',
'stateTime' => '',
'updateTime' => '',
'upgradeStatus' => [
'error' => [
],
'previousVersion' => '',
'startTime' => '',
'state' => '',
'version' => ''
],
'version' => ''
]),
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}}/v1alpha1/:parent/datacenterConnectors', [
'body' => '{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/datacenterConnectors');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'applianceInfrastructureVersion' => '',
'applianceSoftwareVersion' => '',
'availableVersions' => [
'inPlaceUpdate' => [
'critical' => null,
'releaseNotesUri' => '',
'uri' => '',
'version' => ''
],
'newDeployableAppliance' => [
]
],
'bucket' => '',
'createTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'registrationId' => '',
'serviceAccount' => '',
'state' => '',
'stateTime' => '',
'updateTime' => '',
'upgradeStatus' => [
'error' => [
],
'previousVersion' => '',
'startTime' => '',
'state' => '',
'version' => ''
],
'version' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'applianceInfrastructureVersion' => '',
'applianceSoftwareVersion' => '',
'availableVersions' => [
'inPlaceUpdate' => [
'critical' => null,
'releaseNotesUri' => '',
'uri' => '',
'version' => ''
],
'newDeployableAppliance' => [
]
],
'bucket' => '',
'createTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'registrationId' => '',
'serviceAccount' => '',
'state' => '',
'stateTime' => '',
'updateTime' => '',
'upgradeStatus' => [
'error' => [
],
'previousVersion' => '',
'startTime' => '',
'state' => '',
'version' => ''
],
'version' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/datacenterConnectors');
$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}}/v1alpha1/:parent/datacenterConnectors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/datacenterConnectors", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
payload = {
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": False,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
payload <- "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\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}}/v1alpha1/:parent/datacenterConnectors")
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 \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\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/v1alpha1/:parent/datacenterConnectors') do |req|
req.body = "{\n \"applianceInfrastructureVersion\": \"\",\n \"applianceSoftwareVersion\": \"\",\n \"availableVersions\": {\n \"inPlaceUpdate\": {\n \"critical\": false,\n \"releaseNotesUri\": \"\",\n \"uri\": \"\",\n \"version\": \"\"\n },\n \"newDeployableAppliance\": {}\n },\n \"bucket\": \"\",\n \"createTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"registrationId\": \"\",\n \"serviceAccount\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"updateTime\": \"\",\n \"upgradeStatus\": {\n \"error\": {},\n \"previousVersion\": \"\",\n \"startTime\": \"\",\n \"state\": \"\",\n \"version\": \"\"\n },\n \"version\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors";
let payload = json!({
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": json!({
"inPlaceUpdate": json!({
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
}),
"newDeployableAppliance": json!({})
}),
"bucket": "",
"createTime": "",
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": json!({
"error": json!({}),
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
}),
"version": ""
});
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}}/v1alpha1/:parent/datacenterConnectors \
--header 'content-type: application/json' \
--data '{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}'
echo '{
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": {
"inPlaceUpdate": {
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
},
"newDeployableAppliance": {}
},
"bucket": "",
"createTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": {
"error": {},
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
},
"version": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/datacenterConnectors \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "applianceInfrastructureVersion": "",\n "applianceSoftwareVersion": "",\n "availableVersions": {\n "inPlaceUpdate": {\n "critical": false,\n "releaseNotesUri": "",\n "uri": "",\n "version": ""\n },\n "newDeployableAppliance": {}\n },\n "bucket": "",\n "createTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "registrationId": "",\n "serviceAccount": "",\n "state": "",\n "stateTime": "",\n "updateTime": "",\n "upgradeStatus": {\n "error": {},\n "previousVersion": "",\n "startTime": "",\n "state": "",\n "version": ""\n },\n "version": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/datacenterConnectors
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"applianceInfrastructureVersion": "",
"applianceSoftwareVersion": "",
"availableVersions": [
"inPlaceUpdate": [
"critical": false,
"releaseNotesUri": "",
"uri": "",
"version": ""
],
"newDeployableAppliance": []
],
"bucket": "",
"createTime": "",
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"name": "",
"registrationId": "",
"serviceAccount": "",
"state": "",
"stateTime": "",
"updateTime": "",
"upgradeStatus": [
"error": [],
"previousVersion": "",
"startTime": "",
"state": "",
"version": ""
],
"version": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")! 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
vmmigration.projects.locations.sources.datacenterConnectors.list
{{baseUrl}}/v1alpha1/:parent/datacenterConnectors
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
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}}/v1alpha1/:parent/datacenterConnectors"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
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/v1alpha1/:parent/datacenterConnectors HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"))
.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}}/v1alpha1/:parent/datacenterConnectors")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.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}}/v1alpha1/:parent/datacenterConnectors');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors';
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}}/v1alpha1/:parent/datacenterConnectors',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/datacenterConnectors',
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}}/v1alpha1/:parent/datacenterConnectors'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors');
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}}/v1alpha1/:parent/datacenterConnectors'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors';
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}}/v1alpha1/:parent/datacenterConnectors"]
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}}/v1alpha1/:parent/datacenterConnectors" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/datacenterConnectors",
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}}/v1alpha1/:parent/datacenterConnectors');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/datacenterConnectors');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/datacenterConnectors');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/datacenterConnectors' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/datacenterConnectors")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")
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/v1alpha1/:parent/datacenterConnectors') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors";
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}}/v1alpha1/:parent/datacenterConnectors
http GET {{baseUrl}}/v1alpha1/:parent/datacenterConnectors
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/datacenterConnectors
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/datacenterConnectors")! 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
vmmigration.projects.locations.sources.datacenterConnectors.upgradeAppliance
{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance
QUERY PARAMS
datacenterConnector
BODY json
{
"requestId": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance");
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 \"requestId\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance" {:content-type :json
:form-params {:requestId ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"requestId\": \"\"\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}}/v1alpha1/:datacenterConnector:upgradeAppliance"),
Content = new StringContent("{\n \"requestId\": \"\"\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}}/v1alpha1/:datacenterConnector:upgradeAppliance");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"requestId\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance"
payload := strings.NewReader("{\n \"requestId\": \"\"\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/v1alpha1/:datacenterConnector:upgradeAppliance HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 21
{
"requestId": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance")
.setHeader("content-type", "application/json")
.setBody("{\n \"requestId\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"requestId\": \"\"\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 \"requestId\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance")
.header("content-type", "application/json")
.body("{\n \"requestId\": \"\"\n}")
.asString();
const data = JSON.stringify({
requestId: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance',
headers: {'content-type': 'application/json'},
data: {requestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"requestId":""}'
};
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}}/v1alpha1/:datacenterConnector:upgradeAppliance',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "requestId": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"requestId\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance")
.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/v1alpha1/:datacenterConnector:upgradeAppliance',
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({requestId: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance',
headers: {'content-type': 'application/json'},
body: {requestId: ''},
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}}/v1alpha1/:datacenterConnector:upgradeAppliance');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
requestId: ''
});
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}}/v1alpha1/:datacenterConnector:upgradeAppliance',
headers: {'content-type': 'application/json'},
data: {requestId: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"requestId":""}'
};
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 = @{ @"requestId": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance"]
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}}/v1alpha1/:datacenterConnector:upgradeAppliance" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"requestId\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance",
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([
'requestId' => ''
]),
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}}/v1alpha1/:datacenterConnector:upgradeAppliance', [
'body' => '{
"requestId": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'requestId' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'requestId' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance');
$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}}/v1alpha1/:datacenterConnector:upgradeAppliance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"requestId": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"requestId\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:datacenterConnector:upgradeAppliance", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance"
payload = { "requestId": "" }
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance"
payload <- "{\n \"requestId\": \"\"\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}}/v1alpha1/:datacenterConnector:upgradeAppliance")
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 \"requestId\": \"\"\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/v1alpha1/:datacenterConnector:upgradeAppliance') do |req|
req.body = "{\n \"requestId\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance";
let payload = json!({"requestId": ""});
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}}/v1alpha1/:datacenterConnector:upgradeAppliance \
--header 'content-type: application/json' \
--data '{
"requestId": ""
}'
echo '{
"requestId": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "requestId": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance
import Foundation
let headers = ["content-type": "application/json"]
let parameters = ["requestId": ""] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:datacenterConnector:upgradeAppliance")! 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
vmmigration.projects.locations.sources.fetchInventory
{{baseUrl}}/v1alpha1/:source:fetchInventory
QUERY PARAMS
source
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:source:fetchInventory");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:source:fetchInventory")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:source:fetchInventory"
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}}/v1alpha1/:source:fetchInventory"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:source:fetchInventory");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:source:fetchInventory"
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/v1alpha1/:source:fetchInventory HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:source:fetchInventory")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:source:fetchInventory"))
.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}}/v1alpha1/:source:fetchInventory")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:source:fetchInventory")
.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}}/v1alpha1/:source:fetchInventory');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1alpha1/:source:fetchInventory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:source:fetchInventory';
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}}/v1alpha1/:source:fetchInventory',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:source:fetchInventory")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:source:fetchInventory',
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}}/v1alpha1/:source:fetchInventory'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:source:fetchInventory');
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}}/v1alpha1/:source:fetchInventory'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:source:fetchInventory';
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}}/v1alpha1/:source:fetchInventory"]
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}}/v1alpha1/:source:fetchInventory" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:source:fetchInventory",
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}}/v1alpha1/:source:fetchInventory');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:source:fetchInventory');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:source:fetchInventory');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:source:fetchInventory' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:source:fetchInventory' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:source:fetchInventory")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:source:fetchInventory"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:source:fetchInventory"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:source:fetchInventory")
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/v1alpha1/:source:fetchInventory') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:source:fetchInventory";
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}}/v1alpha1/:source:fetchInventory
http GET {{baseUrl}}/v1alpha1/:source:fetchInventory
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:source:fetchInventory
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:source:fetchInventory")! 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
vmmigration.projects.locations.sources.list
{{baseUrl}}/v1alpha1/:parent/sources
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/sources");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/sources")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/sources"
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}}/v1alpha1/:parent/sources"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/sources");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/sources"
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/v1alpha1/:parent/sources HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/sources")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/sources"))
.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}}/v1alpha1/:parent/sources")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/sources")
.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}}/v1alpha1/:parent/sources');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:parent/sources'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/sources';
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}}/v1alpha1/:parent/sources',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/sources")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/sources',
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}}/v1alpha1/:parent/sources'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/sources');
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}}/v1alpha1/:parent/sources'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/sources';
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}}/v1alpha1/:parent/sources"]
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}}/v1alpha1/:parent/sources" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/sources",
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}}/v1alpha1/:parent/sources');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/sources');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/sources');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/sources' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/sources' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/sources")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/sources"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/sources"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/sources")
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/v1alpha1/:parent/sources') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/sources";
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}}/v1alpha1/:parent/sources
http GET {{baseUrl}}/v1alpha1/:parent/sources
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/sources
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/sources")! 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
vmmigration.projects.locations.sources.migratingVms.cloneJobs.create
{{baseUrl}}/v1alpha1/:parent/cloneJobs
QUERY PARAMS
parent
BODY json
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/cloneJobs");
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 \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/cloneJobs" {:content-type :json
:form-params {:computeEngineTargetDetails {:additionalLicenses []
:appliedLicense {:osLicense ""
:type ""}
:bootOption ""
:computeScheduling {:automaticRestart false
:minNodeCpus 0
:nodeAffinities [{:key ""
:operator ""
:values []}]
:onHostMaintenance ""
:restartType ""}
:diskType ""
:hostname ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:networkInterfaces [{:externalIp ""
:internalIp ""
:network ""
:subnetwork ""}]
:networkTags []
:project ""
:secureBoot false
:serviceAccount ""
:vmName ""
:zone ""}
:computeEngineVmDetails {:appliedLicense {}
:bootOption ""
:computeScheduling {}
:diskType ""
:externalIp ""
:internalIp ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:name ""
:network ""
:networkInterfaces [{}]
:networkTags []
:project ""
:secureBoot false
:serviceAccount ""
:subnetwork ""
:targetProject ""
:zone ""}
:createTime ""
:endTime ""
:error {:code 0
:details [{}]
:message ""}
:name ""
:state ""
:stateTime ""
:steps [{:adaptingOs {}
:endTime ""
:instantiatingMigratedVm {}
:preparingVmDisks {}
:startTime ""}]
:targetDetails {}}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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}}/v1alpha1/:parent/cloneJobs"),
Content = new StringContent("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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}}/v1alpha1/:parent/cloneJobs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
payload := strings.NewReader("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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/v1alpha1/:parent/cloneJobs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1742
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.setHeader("content-type", "application/json")
.setBody("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/cloneJobs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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 \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.header("content-type", "application/json")
.body("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}")
.asString();
const data = JSON.stringify({
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {
osLicense: '',
type: ''
},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [
{
key: '',
operator: '',
values: []
}
],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{
externalIp: '',
internalIp: '',
network: '',
subnetwork: ''
}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/cloneJobs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/cloneJobs',
headers: {'content-type': 'application/json'},
data: {
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/cloneJobs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"computeEngineTargetDetails":{"additionalLicenses":[],"appliedLicense":{"osLicense":"","type":""},"bootOption":"","computeScheduling":{"automaticRestart":false,"minNodeCpus":0,"nodeAffinities":[{"key":"","operator":"","values":[]}],"onHostMaintenance":"","restartType":""},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{"externalIp":"","internalIp":"","network":"","subnetwork":""}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","vmName":"","zone":""},"computeEngineVmDetails":{"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","externalIp":"","internalIp":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"name":"","network":"","networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","subnetwork":"","targetProject":"","zone":""},"createTime":"","endTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","state":"","stateTime":"","steps":[{"adaptingOs":{},"endTime":"","instantiatingMigratedVm":{},"preparingVmDisks":{},"startTime":""}],"targetDetails":{}}'
};
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}}/v1alpha1/:parent/cloneJobs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "computeEngineTargetDetails": {\n "additionalLicenses": [],\n "appliedLicense": {\n "osLicense": "",\n "type": ""\n },\n "bootOption": "",\n "computeScheduling": {\n "automaticRestart": false,\n "minNodeCpus": 0,\n "nodeAffinities": [\n {\n "key": "",\n "operator": "",\n "values": []\n }\n ],\n "onHostMaintenance": "",\n "restartType": ""\n },\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {\n "externalIp": "",\n "internalIp": "",\n "network": "",\n "subnetwork": ""\n }\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDetails": {\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "externalIp": "",\n "internalIp": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "name": "",\n "network": "",\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "subnetwork": "",\n "targetProject": "",\n "zone": ""\n },\n "createTime": "",\n "endTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "state": "",\n "stateTime": "",\n "steps": [\n {\n "adaptingOs": {},\n "endTime": "",\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.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/v1alpha1/:parent/cloneJobs',
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({
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/cloneJobs',
headers: {'content-type': 'application/json'},
body: {
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
},
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}}/v1alpha1/:parent/cloneJobs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {
osLicense: '',
type: ''
},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [
{
key: '',
operator: '',
values: []
}
],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{
externalIp: '',
internalIp: '',
network: '',
subnetwork: ''
}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
});
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}}/v1alpha1/:parent/cloneJobs',
headers: {'content-type': 'application/json'},
data: {
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/cloneJobs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"computeEngineTargetDetails":{"additionalLicenses":[],"appliedLicense":{"osLicense":"","type":""},"bootOption":"","computeScheduling":{"automaticRestart":false,"minNodeCpus":0,"nodeAffinities":[{"key":"","operator":"","values":[]}],"onHostMaintenance":"","restartType":""},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{"externalIp":"","internalIp":"","network":"","subnetwork":""}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","vmName":"","zone":""},"computeEngineVmDetails":{"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","externalIp":"","internalIp":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"name":"","network":"","networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","subnetwork":"","targetProject":"","zone":""},"createTime":"","endTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","state":"","stateTime":"","steps":[{"adaptingOs":{},"endTime":"","instantiatingMigratedVm":{},"preparingVmDisks":{},"startTime":""}],"targetDetails":{}}'
};
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 = @{ @"computeEngineTargetDetails": @{ @"additionalLicenses": @[ ], @"appliedLicense": @{ @"osLicense": @"", @"type": @"" }, @"bootOption": @"", @"computeScheduling": @{ @"automaticRestart": @NO, @"minNodeCpus": @0, @"nodeAffinities": @[ @{ @"key": @"", @"operator": @"", @"values": @[ ] } ], @"onHostMaintenance": @"", @"restartType": @"" }, @"diskType": @"", @"hostname": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"networkInterfaces": @[ @{ @"externalIp": @"", @"internalIp": @"", @"network": @"", @"subnetwork": @"" } ], @"networkTags": @[ ], @"project": @"", @"secureBoot": @NO, @"serviceAccount": @"", @"vmName": @"", @"zone": @"" },
@"computeEngineVmDetails": @{ @"appliedLicense": @{ }, @"bootOption": @"", @"computeScheduling": @{ }, @"diskType": @"", @"externalIp": @"", @"internalIp": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"name": @"", @"network": @"", @"networkInterfaces": @[ @{ } ], @"networkTags": @[ ], @"project": @"", @"secureBoot": @NO, @"serviceAccount": @"", @"subnetwork": @"", @"targetProject": @"", @"zone": @"" },
@"createTime": @"",
@"endTime": @"",
@"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" },
@"name": @"",
@"state": @"",
@"stateTime": @"",
@"steps": @[ @{ @"adaptingOs": @{ }, @"endTime": @"", @"instantiatingMigratedVm": @{ }, @"preparingVmDisks": @{ }, @"startTime": @"" } ],
@"targetDetails": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/cloneJobs"]
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}}/v1alpha1/:parent/cloneJobs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/cloneJobs",
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([
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'state' => '',
'stateTime' => '',
'steps' => [
[
'adaptingOs' => [
],
'endTime' => '',
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]),
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}}/v1alpha1/:parent/cloneJobs', [
'body' => '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/cloneJobs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'state' => '',
'stateTime' => '',
'steps' => [
[
'adaptingOs' => [
],
'endTime' => '',
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'state' => '',
'stateTime' => '',
'steps' => [
[
'adaptingOs' => [
],
'endTime' => '',
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/cloneJobs');
$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}}/v1alpha1/:parent/cloneJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/cloneJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/cloneJobs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
payload = {
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": False,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": False,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [{}],
"networkTags": [],
"project": "",
"secureBoot": False,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
payload <- "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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}}/v1alpha1/:parent/cloneJobs")
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 \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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/v1alpha1/:parent/cloneJobs') do |req|
req.body = "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/cloneJobs";
let payload = json!({
"computeEngineTargetDetails": json!({
"additionalLicenses": (),
"appliedLicense": json!({
"osLicense": "",
"type": ""
}),
"bootOption": "",
"computeScheduling": json!({
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": (
json!({
"key": "",
"operator": "",
"values": ()
})
),
"onHostMaintenance": "",
"restartType": ""
}),
"diskType": "",
"hostname": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"networkInterfaces": (
json!({
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
})
),
"networkTags": (),
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
}),
"computeEngineVmDetails": json!({
"appliedLicense": json!({}),
"bootOption": "",
"computeScheduling": json!({}),
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"name": "",
"network": "",
"networkInterfaces": (json!({})),
"networkTags": (),
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
}),
"createTime": "",
"endTime": "",
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"name": "",
"state": "",
"stateTime": "",
"steps": (
json!({
"adaptingOs": json!({}),
"endTime": "",
"instantiatingMigratedVm": json!({}),
"preparingVmDisks": json!({}),
"startTime": ""
})
),
"targetDetails": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:parent/cloneJobs \
--header 'content-type: application/json' \
--data '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}'
echo '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/cloneJobs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "computeEngineTargetDetails": {\n "additionalLicenses": [],\n "appliedLicense": {\n "osLicense": "",\n "type": ""\n },\n "bootOption": "",\n "computeScheduling": {\n "automaticRestart": false,\n "minNodeCpus": 0,\n "nodeAffinities": [\n {\n "key": "",\n "operator": "",\n "values": []\n }\n ],\n "onHostMaintenance": "",\n "restartType": ""\n },\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {\n "externalIp": "",\n "internalIp": "",\n "network": "",\n "subnetwork": ""\n }\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDetails": {\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "externalIp": "",\n "internalIp": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "name": "",\n "network": "",\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "subnetwork": "",\n "targetProject": "",\n "zone": ""\n },\n "createTime": "",\n "endTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "state": "",\n "stateTime": "",\n "steps": [\n {\n "adaptingOs": {},\n "endTime": "",\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/cloneJobs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"computeEngineTargetDetails": [
"additionalLicenses": [],
"appliedLicense": [
"osLicense": "",
"type": ""
],
"bootOption": "",
"computeScheduling": [
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
[
"key": "",
"operator": "",
"values": []
]
],
"onHostMaintenance": "",
"restartType": ""
],
"diskType": "",
"hostname": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"networkInterfaces": [
[
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
]
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
],
"computeEngineVmDetails": [
"appliedLicense": [],
"bootOption": "",
"computeScheduling": [],
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"name": "",
"network": "",
"networkInterfaces": [[]],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
],
"createTime": "",
"endTime": "",
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"name": "",
"state": "",
"stateTime": "",
"steps": [
[
"adaptingOs": [],
"endTime": "",
"instantiatingMigratedVm": [],
"preparingVmDisks": [],
"startTime": ""
]
],
"targetDetails": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/cloneJobs")! 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
vmmigration.projects.locations.sources.migratingVms.cloneJobs.list
{{baseUrl}}/v1alpha1/:parent/cloneJobs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/cloneJobs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/cloneJobs")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
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}}/v1alpha1/:parent/cloneJobs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/cloneJobs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
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/v1alpha1/:parent/cloneJobs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/cloneJobs"))
.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}}/v1alpha1/:parent/cloneJobs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.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}}/v1alpha1/:parent/cloneJobs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:parent/cloneJobs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/cloneJobs';
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}}/v1alpha1/:parent/cloneJobs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/cloneJobs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/cloneJobs',
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}}/v1alpha1/:parent/cloneJobs'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/cloneJobs');
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}}/v1alpha1/:parent/cloneJobs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/cloneJobs';
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}}/v1alpha1/:parent/cloneJobs"]
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}}/v1alpha1/:parent/cloneJobs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/cloneJobs",
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}}/v1alpha1/:parent/cloneJobs');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/cloneJobs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/cloneJobs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/cloneJobs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/cloneJobs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/cloneJobs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/cloneJobs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/cloneJobs")
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/v1alpha1/:parent/cloneJobs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/cloneJobs";
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}}/v1alpha1/:parent/cloneJobs
http GET {{baseUrl}}/v1alpha1/:parent/cloneJobs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/cloneJobs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/cloneJobs")! 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
vmmigration.projects.locations.sources.migratingVms.create
{{baseUrl}}/v1alpha1/:parent/migratingVms
QUERY PARAMS
parent
BODY json
{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/migratingVms");
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 \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/migratingVms" {:content-type :json
:form-params {:awsSourceVmDetails {:committedStorageBytes ""
:firmware ""}
:computeEngineTargetDefaults {:additionalLicenses []
:appliedLicense {:osLicense ""
:type ""}
:bootOption ""
:computeScheduling {:automaticRestart false
:minNodeCpus 0
:nodeAffinities [{:key ""
:operator ""
:values []}]
:onHostMaintenance ""
:restartType ""}
:diskType ""
:hostname ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:networkInterfaces [{:externalIp ""
:internalIp ""
:network ""
:subnetwork ""}]
:networkTags []
:secureBoot false
:serviceAccount ""
:targetProject ""
:vmName ""
:zone ""}
:computeEngineVmDefaults {:appliedLicense {}
:bootOption ""
:computeScheduling {}
:diskType ""
:externalIp ""
:internalIp ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:name ""
:network ""
:networkInterfaces [{}]
:networkTags []
:project ""
:secureBoot false
:serviceAccount ""
:subnetwork ""
:targetProject ""
:zone ""}
:createTime ""
:currentSyncInfo {:cycleNumber 0
:endTime ""
:error {:code 0
:details [{}]
:message ""}
:name ""
:progress 0
:progressPercent 0
:startTime ""
:state ""
:steps [{:endTime ""
:initializingReplication {}
:postProcessing {}
:replicating {:lastThirtyMinutesAverageBytesPerSecond ""
:lastTwoMinutesAverageBytesPerSecond ""
:replicatedBytes ""
:totalBytes ""}
:startTime ""}]
:totalPauseDuration ""
:warnings [{:actionItem {:locale ""
:message ""}
:code ""
:helpLinks [{:description ""
:url ""}]
:warningMessage {}
:warningTime ""}]}
:cutoverForecast {:estimatedCutoverJobDuration ""}
:description ""
:displayName ""
:error {}
:group ""
:labels {}
:lastReplicationCycle {}
:lastSync {:lastSyncTime ""}
:name ""
:policy {:idleDuration ""
:skipOsAdaptation false}
:recentCloneJobs [{:computeEngineTargetDetails {:additionalLicenses []
:appliedLicense {}
:bootOption ""
:computeScheduling {}
:diskType ""
:hostname ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:networkInterfaces [{}]
:networkTags []
:project ""
:secureBoot false
:serviceAccount ""
:vmName ""
:zone ""}
:computeEngineVmDetails {}
:createTime ""
:endTime ""
:error {}
:name ""
:state ""
:stateTime ""
:steps [{:adaptingOs {}
:endTime ""
:instantiatingMigratedVm {}
:preparingVmDisks {}
:startTime ""}]
:targetDetails {}}]
:recentCutoverJobs [{:computeEngineTargetDetails {}
:computeEngineVmDetails {}
:createTime ""
:endTime ""
:error {}
:name ""
:progress 0
:progressPercent 0
:state ""
:stateMessage ""
:stateTime ""
:steps [{:endTime ""
:finalSync {}
:instantiatingMigratedVm {}
:preparingVmDisks {}
:previousReplicationCycle {}
:shuttingDownSourceVm {}
:startTime ""}]
:targetDetails {}}]
:sourceVmId ""
:state ""
:stateTime ""
:targetDefaults {}
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/migratingVms"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/migratingVms"),
Content = new StringContent("{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/migratingVms");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/migratingVms"
payload := strings.NewReader("{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\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/v1alpha1/:parent/migratingVms HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 4479
{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/migratingVms")
.setHeader("content-type", "application/json")
.setBody("{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/migratingVms"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\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 \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/migratingVms")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/migratingVms")
.header("content-type", "application/json")
.body("{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
awsSourceVmDetails: {
committedStorageBytes: '',
firmware: ''
},
computeEngineTargetDefaults: {
additionalLicenses: [],
appliedLicense: {
osLicense: '',
type: ''
},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [
{
key: '',
operator: '',
values: []
}
],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{
externalIp: '',
internalIp: '',
network: '',
subnetwork: ''
}
],
networkTags: [],
secureBoot: false,
serviceAccount: '',
targetProject: '',
vmName: '',
zone: ''
},
computeEngineVmDefaults: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
currentSyncInfo: {
cycleNumber: 0,
endTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {
locale: '',
message: ''
},
code: '',
helpLinks: [
{
description: '',
url: ''
}
],
warningMessage: {},
warningTime: ''
}
]
},
cutoverForecast: {
estimatedCutoverJobDuration: ''
},
description: '',
displayName: '',
error: {},
group: '',
labels: {},
lastReplicationCycle: {},
lastSync: {
lastSyncTime: ''
},
name: '',
policy: {
idleDuration: '',
skipOsAdaptation: false
},
recentCloneJobs: [
{
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
],
recentCutoverJobs: [
{
computeEngineTargetDetails: {},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
],
sourceVmId: '',
state: '',
stateTime: '',
targetDefaults: {},
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/migratingVms');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/migratingVms',
headers: {'content-type': 'application/json'},
data: {
awsSourceVmDetails: {committedStorageBytes: '', firmware: ''},
computeEngineTargetDefaults: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
secureBoot: false,
serviceAccount: '',
targetProject: '',
vmName: '',
zone: ''
},
computeEngineVmDefaults: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
currentSyncInfo: {
cycleNumber: 0,
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
cutoverForecast: {estimatedCutoverJobDuration: ''},
description: '',
displayName: '',
error: {},
group: '',
labels: {},
lastReplicationCycle: {},
lastSync: {lastSyncTime: ''},
name: '',
policy: {idleDuration: '', skipOsAdaptation: false},
recentCloneJobs: [
{
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
],
recentCutoverJobs: [
{
computeEngineTargetDetails: {},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
],
sourceVmId: '',
state: '',
stateTime: '',
targetDefaults: {},
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/migratingVms';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"awsSourceVmDetails":{"committedStorageBytes":"","firmware":""},"computeEngineTargetDefaults":{"additionalLicenses":[],"appliedLicense":{"osLicense":"","type":""},"bootOption":"","computeScheduling":{"automaticRestart":false,"minNodeCpus":0,"nodeAffinities":[{"key":"","operator":"","values":[]}],"onHostMaintenance":"","restartType":""},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{"externalIp":"","internalIp":"","network":"","subnetwork":""}],"networkTags":[],"secureBoot":false,"serviceAccount":"","targetProject":"","vmName":"","zone":""},"computeEngineVmDefaults":{"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","externalIp":"","internalIp":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"name":"","network":"","networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","subnetwork":"","targetProject":"","zone":""},"createTime":"","currentSyncInfo":{"cycleNumber":0,"endTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","progress":0,"progressPercent":0,"startTime":"","state":"","steps":[{"endTime":"","initializingReplication":{},"postProcessing":{},"replicating":{"lastThirtyMinutesAverageBytesPerSecond":"","lastTwoMinutesAverageBytesPerSecond":"","replicatedBytes":"","totalBytes":""},"startTime":""}],"totalPauseDuration":"","warnings":[{"actionItem":{"locale":"","message":""},"code":"","helpLinks":[{"description":"","url":""}],"warningMessage":{},"warningTime":""}]},"cutoverForecast":{"estimatedCutoverJobDuration":""},"description":"","displayName":"","error":{},"group":"","labels":{},"lastReplicationCycle":{},"lastSync":{"lastSyncTime":""},"name":"","policy":{"idleDuration":"","skipOsAdaptation":false},"recentCloneJobs":[{"computeEngineTargetDetails":{"additionalLicenses":[],"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","vmName":"","zone":""},"computeEngineVmDetails":{},"createTime":"","endTime":"","error":{},"name":"","state":"","stateTime":"","steps":[{"adaptingOs":{},"endTime":"","instantiatingMigratedVm":{},"preparingVmDisks":{},"startTime":""}],"targetDetails":{}}],"recentCutoverJobs":[{"computeEngineTargetDetails":{},"computeEngineVmDetails":{},"createTime":"","endTime":"","error":{},"name":"","progress":0,"progressPercent":0,"state":"","stateMessage":"","stateTime":"","steps":[{"endTime":"","finalSync":{},"instantiatingMigratedVm":{},"preparingVmDisks":{},"previousReplicationCycle":{},"shuttingDownSourceVm":{},"startTime":""}],"targetDetails":{}}],"sourceVmId":"","state":"","stateTime":"","targetDefaults":{},"updateTime":""}'
};
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}}/v1alpha1/:parent/migratingVms',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "awsSourceVmDetails": {\n "committedStorageBytes": "",\n "firmware": ""\n },\n "computeEngineTargetDefaults": {\n "additionalLicenses": [],\n "appliedLicense": {\n "osLicense": "",\n "type": ""\n },\n "bootOption": "",\n "computeScheduling": {\n "automaticRestart": false,\n "minNodeCpus": 0,\n "nodeAffinities": [\n {\n "key": "",\n "operator": "",\n "values": []\n }\n ],\n "onHostMaintenance": "",\n "restartType": ""\n },\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {\n "externalIp": "",\n "internalIp": "",\n "network": "",\n "subnetwork": ""\n }\n ],\n "networkTags": [],\n "secureBoot": false,\n "serviceAccount": "",\n "targetProject": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDefaults": {\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "externalIp": "",\n "internalIp": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "name": "",\n "network": "",\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "subnetwork": "",\n "targetProject": "",\n "zone": ""\n },\n "createTime": "",\n "currentSyncInfo": {\n "cycleNumber": 0,\n "endTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "startTime": "",\n "state": "",\n "steps": [\n {\n "endTime": "",\n "initializingReplication": {},\n "postProcessing": {},\n "replicating": {\n "lastThirtyMinutesAverageBytesPerSecond": "",\n "lastTwoMinutesAverageBytesPerSecond": "",\n "replicatedBytes": "",\n "totalBytes": ""\n },\n "startTime": ""\n }\n ],\n "totalPauseDuration": "",\n "warnings": [\n {\n "actionItem": {\n "locale": "",\n "message": ""\n },\n "code": "",\n "helpLinks": [\n {\n "description": "",\n "url": ""\n }\n ],\n "warningMessage": {},\n "warningTime": ""\n }\n ]\n },\n "cutoverForecast": {\n "estimatedCutoverJobDuration": ""\n },\n "description": "",\n "displayName": "",\n "error": {},\n "group": "",\n "labels": {},\n "lastReplicationCycle": {},\n "lastSync": {\n "lastSyncTime": ""\n },\n "name": "",\n "policy": {\n "idleDuration": "",\n "skipOsAdaptation": false\n },\n "recentCloneJobs": [\n {\n "computeEngineTargetDetails": {\n "additionalLicenses": [],\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDetails": {},\n "createTime": "",\n "endTime": "",\n "error": {},\n "name": "",\n "state": "",\n "stateTime": "",\n "steps": [\n {\n "adaptingOs": {},\n "endTime": "",\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n }\n ],\n "recentCutoverJobs": [\n {\n "computeEngineTargetDetails": {},\n "computeEngineVmDetails": {},\n "createTime": "",\n "endTime": "",\n "error": {},\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "state": "",\n "stateMessage": "",\n "stateTime": "",\n "steps": [\n {\n "endTime": "",\n "finalSync": {},\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "previousReplicationCycle": {},\n "shuttingDownSourceVm": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n }\n ],\n "sourceVmId": "",\n "state": "",\n "stateTime": "",\n "targetDefaults": {},\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/migratingVms")
.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/v1alpha1/:parent/migratingVms',
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({
awsSourceVmDetails: {committedStorageBytes: '', firmware: ''},
computeEngineTargetDefaults: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
secureBoot: false,
serviceAccount: '',
targetProject: '',
vmName: '',
zone: ''
},
computeEngineVmDefaults: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
currentSyncInfo: {
cycleNumber: 0,
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
cutoverForecast: {estimatedCutoverJobDuration: ''},
description: '',
displayName: '',
error: {},
group: '',
labels: {},
lastReplicationCycle: {},
lastSync: {lastSyncTime: ''},
name: '',
policy: {idleDuration: '', skipOsAdaptation: false},
recentCloneJobs: [
{
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
],
recentCutoverJobs: [
{
computeEngineTargetDetails: {},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
],
sourceVmId: '',
state: '',
stateTime: '',
targetDefaults: {},
updateTime: ''
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/migratingVms',
headers: {'content-type': 'application/json'},
body: {
awsSourceVmDetails: {committedStorageBytes: '', firmware: ''},
computeEngineTargetDefaults: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
secureBoot: false,
serviceAccount: '',
targetProject: '',
vmName: '',
zone: ''
},
computeEngineVmDefaults: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
currentSyncInfo: {
cycleNumber: 0,
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
cutoverForecast: {estimatedCutoverJobDuration: ''},
description: '',
displayName: '',
error: {},
group: '',
labels: {},
lastReplicationCycle: {},
lastSync: {lastSyncTime: ''},
name: '',
policy: {idleDuration: '', skipOsAdaptation: false},
recentCloneJobs: [
{
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
],
recentCutoverJobs: [
{
computeEngineTargetDetails: {},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
],
sourceVmId: '',
state: '',
stateTime: '',
targetDefaults: {},
updateTime: ''
},
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}}/v1alpha1/:parent/migratingVms');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
awsSourceVmDetails: {
committedStorageBytes: '',
firmware: ''
},
computeEngineTargetDefaults: {
additionalLicenses: [],
appliedLicense: {
osLicense: '',
type: ''
},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [
{
key: '',
operator: '',
values: []
}
],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{
externalIp: '',
internalIp: '',
network: '',
subnetwork: ''
}
],
networkTags: [],
secureBoot: false,
serviceAccount: '',
targetProject: '',
vmName: '',
zone: ''
},
computeEngineVmDefaults: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
currentSyncInfo: {
cycleNumber: 0,
endTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {
locale: '',
message: ''
},
code: '',
helpLinks: [
{
description: '',
url: ''
}
],
warningMessage: {},
warningTime: ''
}
]
},
cutoverForecast: {
estimatedCutoverJobDuration: ''
},
description: '',
displayName: '',
error: {},
group: '',
labels: {},
lastReplicationCycle: {},
lastSync: {
lastSyncTime: ''
},
name: '',
policy: {
idleDuration: '',
skipOsAdaptation: false
},
recentCloneJobs: [
{
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
],
recentCutoverJobs: [
{
computeEngineTargetDetails: {},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
],
sourceVmId: '',
state: '',
stateTime: '',
targetDefaults: {},
updateTime: ''
});
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}}/v1alpha1/:parent/migratingVms',
headers: {'content-type': 'application/json'},
data: {
awsSourceVmDetails: {committedStorageBytes: '', firmware: ''},
computeEngineTargetDefaults: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
secureBoot: false,
serviceAccount: '',
targetProject: '',
vmName: '',
zone: ''
},
computeEngineVmDefaults: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
currentSyncInfo: {
cycleNumber: 0,
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
cutoverForecast: {estimatedCutoverJobDuration: ''},
description: '',
displayName: '',
error: {},
group: '',
labels: {},
lastReplicationCycle: {},
lastSync: {lastSyncTime: ''},
name: '',
policy: {idleDuration: '', skipOsAdaptation: false},
recentCloneJobs: [
{
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
state: '',
stateTime: '',
steps: [
{
adaptingOs: {},
endTime: '',
instantiatingMigratedVm: {},
preparingVmDisks: {},
startTime: ''
}
],
targetDetails: {}
}
],
recentCutoverJobs: [
{
computeEngineTargetDetails: {},
computeEngineVmDetails: {},
createTime: '',
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
],
sourceVmId: '',
state: '',
stateTime: '',
targetDefaults: {},
updateTime: ''
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/migratingVms';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"awsSourceVmDetails":{"committedStorageBytes":"","firmware":""},"computeEngineTargetDefaults":{"additionalLicenses":[],"appliedLicense":{"osLicense":"","type":""},"bootOption":"","computeScheduling":{"automaticRestart":false,"minNodeCpus":0,"nodeAffinities":[{"key":"","operator":"","values":[]}],"onHostMaintenance":"","restartType":""},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{"externalIp":"","internalIp":"","network":"","subnetwork":""}],"networkTags":[],"secureBoot":false,"serviceAccount":"","targetProject":"","vmName":"","zone":""},"computeEngineVmDefaults":{"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","externalIp":"","internalIp":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"name":"","network":"","networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","subnetwork":"","targetProject":"","zone":""},"createTime":"","currentSyncInfo":{"cycleNumber":0,"endTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","progress":0,"progressPercent":0,"startTime":"","state":"","steps":[{"endTime":"","initializingReplication":{},"postProcessing":{},"replicating":{"lastThirtyMinutesAverageBytesPerSecond":"","lastTwoMinutesAverageBytesPerSecond":"","replicatedBytes":"","totalBytes":""},"startTime":""}],"totalPauseDuration":"","warnings":[{"actionItem":{"locale":"","message":""},"code":"","helpLinks":[{"description":"","url":""}],"warningMessage":{},"warningTime":""}]},"cutoverForecast":{"estimatedCutoverJobDuration":""},"description":"","displayName":"","error":{},"group":"","labels":{},"lastReplicationCycle":{},"lastSync":{"lastSyncTime":""},"name":"","policy":{"idleDuration":"","skipOsAdaptation":false},"recentCloneJobs":[{"computeEngineTargetDetails":{"additionalLicenses":[],"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","vmName":"","zone":""},"computeEngineVmDetails":{},"createTime":"","endTime":"","error":{},"name":"","state":"","stateTime":"","steps":[{"adaptingOs":{},"endTime":"","instantiatingMigratedVm":{},"preparingVmDisks":{},"startTime":""}],"targetDetails":{}}],"recentCutoverJobs":[{"computeEngineTargetDetails":{},"computeEngineVmDetails":{},"createTime":"","endTime":"","error":{},"name":"","progress":0,"progressPercent":0,"state":"","stateMessage":"","stateTime":"","steps":[{"endTime":"","finalSync":{},"instantiatingMigratedVm":{},"preparingVmDisks":{},"previousReplicationCycle":{},"shuttingDownSourceVm":{},"startTime":""}],"targetDetails":{}}],"sourceVmId":"","state":"","stateTime":"","targetDefaults":{},"updateTime":""}'
};
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 = @{ @"awsSourceVmDetails": @{ @"committedStorageBytes": @"", @"firmware": @"" },
@"computeEngineTargetDefaults": @{ @"additionalLicenses": @[ ], @"appliedLicense": @{ @"osLicense": @"", @"type": @"" }, @"bootOption": @"", @"computeScheduling": @{ @"automaticRestart": @NO, @"minNodeCpus": @0, @"nodeAffinities": @[ @{ @"key": @"", @"operator": @"", @"values": @[ ] } ], @"onHostMaintenance": @"", @"restartType": @"" }, @"diskType": @"", @"hostname": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"networkInterfaces": @[ @{ @"externalIp": @"", @"internalIp": @"", @"network": @"", @"subnetwork": @"" } ], @"networkTags": @[ ], @"secureBoot": @NO, @"serviceAccount": @"", @"targetProject": @"", @"vmName": @"", @"zone": @"" },
@"computeEngineVmDefaults": @{ @"appliedLicense": @{ }, @"bootOption": @"", @"computeScheduling": @{ }, @"diskType": @"", @"externalIp": @"", @"internalIp": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"name": @"", @"network": @"", @"networkInterfaces": @[ @{ } ], @"networkTags": @[ ], @"project": @"", @"secureBoot": @NO, @"serviceAccount": @"", @"subnetwork": @"", @"targetProject": @"", @"zone": @"" },
@"createTime": @"",
@"currentSyncInfo": @{ @"cycleNumber": @0, @"endTime": @"", @"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" }, @"name": @"", @"progress": @0, @"progressPercent": @0, @"startTime": @"", @"state": @"", @"steps": @[ @{ @"endTime": @"", @"initializingReplication": @{ }, @"postProcessing": @{ }, @"replicating": @{ @"lastThirtyMinutesAverageBytesPerSecond": @"", @"lastTwoMinutesAverageBytesPerSecond": @"", @"replicatedBytes": @"", @"totalBytes": @"" }, @"startTime": @"" } ], @"totalPauseDuration": @"", @"warnings": @[ @{ @"actionItem": @{ @"locale": @"", @"message": @"" }, @"code": @"", @"helpLinks": @[ @{ @"description": @"", @"url": @"" } ], @"warningMessage": @{ }, @"warningTime": @"" } ] },
@"cutoverForecast": @{ @"estimatedCutoverJobDuration": @"" },
@"description": @"",
@"displayName": @"",
@"error": @{ },
@"group": @"",
@"labels": @{ },
@"lastReplicationCycle": @{ },
@"lastSync": @{ @"lastSyncTime": @"" },
@"name": @"",
@"policy": @{ @"idleDuration": @"", @"skipOsAdaptation": @NO },
@"recentCloneJobs": @[ @{ @"computeEngineTargetDetails": @{ @"additionalLicenses": @[ ], @"appliedLicense": @{ }, @"bootOption": @"", @"computeScheduling": @{ }, @"diskType": @"", @"hostname": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"networkInterfaces": @[ @{ } ], @"networkTags": @[ ], @"project": @"", @"secureBoot": @NO, @"serviceAccount": @"", @"vmName": @"", @"zone": @"" }, @"computeEngineVmDetails": @{ }, @"createTime": @"", @"endTime": @"", @"error": @{ }, @"name": @"", @"state": @"", @"stateTime": @"", @"steps": @[ @{ @"adaptingOs": @{ }, @"endTime": @"", @"instantiatingMigratedVm": @{ }, @"preparingVmDisks": @{ }, @"startTime": @"" } ], @"targetDetails": @{ } } ],
@"recentCutoverJobs": @[ @{ @"computeEngineTargetDetails": @{ }, @"computeEngineVmDetails": @{ }, @"createTime": @"", @"endTime": @"", @"error": @{ }, @"name": @"", @"progress": @0, @"progressPercent": @0, @"state": @"", @"stateMessage": @"", @"stateTime": @"", @"steps": @[ @{ @"endTime": @"", @"finalSync": @{ }, @"instantiatingMigratedVm": @{ }, @"preparingVmDisks": @{ }, @"previousReplicationCycle": @{ }, @"shuttingDownSourceVm": @{ }, @"startTime": @"" } ], @"targetDetails": @{ } } ],
@"sourceVmId": @"",
@"state": @"",
@"stateTime": @"",
@"targetDefaults": @{ },
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/migratingVms"]
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}}/v1alpha1/:parent/migratingVms" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/migratingVms",
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([
'awsSourceVmDetails' => [
'committedStorageBytes' => '',
'firmware' => ''
],
'computeEngineTargetDefaults' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'secureBoot' => null,
'serviceAccount' => '',
'targetProject' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDefaults' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'currentSyncInfo' => [
'cycleNumber' => 0,
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'startTime' => '',
'state' => '',
'steps' => [
[
'endTime' => '',
'initializingReplication' => [
],
'postProcessing' => [
],
'replicating' => [
'lastThirtyMinutesAverageBytesPerSecond' => '',
'lastTwoMinutesAverageBytesPerSecond' => '',
'replicatedBytes' => '',
'totalBytes' => ''
],
'startTime' => ''
]
],
'totalPauseDuration' => '',
'warnings' => [
[
'actionItem' => [
'locale' => '',
'message' => ''
],
'code' => '',
'helpLinks' => [
[
'description' => '',
'url' => ''
]
],
'warningMessage' => [
],
'warningTime' => ''
]
]
],
'cutoverForecast' => [
'estimatedCutoverJobDuration' => ''
],
'description' => '',
'displayName' => '',
'error' => [
],
'group' => '',
'labels' => [
],
'lastReplicationCycle' => [
],
'lastSync' => [
'lastSyncTime' => ''
],
'name' => '',
'policy' => [
'idleDuration' => '',
'skipOsAdaptation' => null
],
'recentCloneJobs' => [
[
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
],
'createTime' => '',
'endTime' => '',
'error' => [
],
'name' => '',
'state' => '',
'stateTime' => '',
'steps' => [
[
'adaptingOs' => [
],
'endTime' => '',
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]
],
'recentCutoverJobs' => [
[
'computeEngineTargetDetails' => [
],
'computeEngineVmDetails' => [
],
'createTime' => '',
'endTime' => '',
'error' => [
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'state' => '',
'stateMessage' => '',
'stateTime' => '',
'steps' => [
[
'endTime' => '',
'finalSync' => [
],
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'previousReplicationCycle' => [
],
'shuttingDownSourceVm' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]
],
'sourceVmId' => '',
'state' => '',
'stateTime' => '',
'targetDefaults' => [
],
'updateTime' => ''
]),
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}}/v1alpha1/:parent/migratingVms', [
'body' => '{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/migratingVms');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'awsSourceVmDetails' => [
'committedStorageBytes' => '',
'firmware' => ''
],
'computeEngineTargetDefaults' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'secureBoot' => null,
'serviceAccount' => '',
'targetProject' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDefaults' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'currentSyncInfo' => [
'cycleNumber' => 0,
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'startTime' => '',
'state' => '',
'steps' => [
[
'endTime' => '',
'initializingReplication' => [
],
'postProcessing' => [
],
'replicating' => [
'lastThirtyMinutesAverageBytesPerSecond' => '',
'lastTwoMinutesAverageBytesPerSecond' => '',
'replicatedBytes' => '',
'totalBytes' => ''
],
'startTime' => ''
]
],
'totalPauseDuration' => '',
'warnings' => [
[
'actionItem' => [
'locale' => '',
'message' => ''
],
'code' => '',
'helpLinks' => [
[
'description' => '',
'url' => ''
]
],
'warningMessage' => [
],
'warningTime' => ''
]
]
],
'cutoverForecast' => [
'estimatedCutoverJobDuration' => ''
],
'description' => '',
'displayName' => '',
'error' => [
],
'group' => '',
'labels' => [
],
'lastReplicationCycle' => [
],
'lastSync' => [
'lastSyncTime' => ''
],
'name' => '',
'policy' => [
'idleDuration' => '',
'skipOsAdaptation' => null
],
'recentCloneJobs' => [
[
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
],
'createTime' => '',
'endTime' => '',
'error' => [
],
'name' => '',
'state' => '',
'stateTime' => '',
'steps' => [
[
'adaptingOs' => [
],
'endTime' => '',
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]
],
'recentCutoverJobs' => [
[
'computeEngineTargetDetails' => [
],
'computeEngineVmDetails' => [
],
'createTime' => '',
'endTime' => '',
'error' => [
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'state' => '',
'stateMessage' => '',
'stateTime' => '',
'steps' => [
[
'endTime' => '',
'finalSync' => [
],
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'previousReplicationCycle' => [
],
'shuttingDownSourceVm' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]
],
'sourceVmId' => '',
'state' => '',
'stateTime' => '',
'targetDefaults' => [
],
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'awsSourceVmDetails' => [
'committedStorageBytes' => '',
'firmware' => ''
],
'computeEngineTargetDefaults' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'secureBoot' => null,
'serviceAccount' => '',
'targetProject' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDefaults' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'currentSyncInfo' => [
'cycleNumber' => 0,
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'startTime' => '',
'state' => '',
'steps' => [
[
'endTime' => '',
'initializingReplication' => [
],
'postProcessing' => [
],
'replicating' => [
'lastThirtyMinutesAverageBytesPerSecond' => '',
'lastTwoMinutesAverageBytesPerSecond' => '',
'replicatedBytes' => '',
'totalBytes' => ''
],
'startTime' => ''
]
],
'totalPauseDuration' => '',
'warnings' => [
[
'actionItem' => [
'locale' => '',
'message' => ''
],
'code' => '',
'helpLinks' => [
[
'description' => '',
'url' => ''
]
],
'warningMessage' => [
],
'warningTime' => ''
]
]
],
'cutoverForecast' => [
'estimatedCutoverJobDuration' => ''
],
'description' => '',
'displayName' => '',
'error' => [
],
'group' => '',
'labels' => [
],
'lastReplicationCycle' => [
],
'lastSync' => [
'lastSyncTime' => ''
],
'name' => '',
'policy' => [
'idleDuration' => '',
'skipOsAdaptation' => null
],
'recentCloneJobs' => [
[
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
],
'createTime' => '',
'endTime' => '',
'error' => [
],
'name' => '',
'state' => '',
'stateTime' => '',
'steps' => [
[
'adaptingOs' => [
],
'endTime' => '',
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]
],
'recentCutoverJobs' => [
[
'computeEngineTargetDetails' => [
],
'computeEngineVmDetails' => [
],
'createTime' => '',
'endTime' => '',
'error' => [
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'state' => '',
'stateMessage' => '',
'stateTime' => '',
'steps' => [
[
'endTime' => '',
'finalSync' => [
],
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'previousReplicationCycle' => [
],
'shuttingDownSourceVm' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]
],
'sourceVmId' => '',
'state' => '',
'stateTime' => '',
'targetDefaults' => [
],
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/migratingVms');
$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}}/v1alpha1/:parent/migratingVms' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/migratingVms' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/migratingVms", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/migratingVms"
payload = {
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": False,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": False,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [{}],
"networkTags": [],
"project": "",
"secureBoot": False,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": { "estimatedCutoverJobDuration": "" },
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": { "lastSyncTime": "" },
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": False
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [{}],
"networkTags": [],
"project": "",
"secureBoot": False,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/migratingVms"
payload <- "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/migratingVms")
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 \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\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/v1alpha1/:parent/migratingVms') do |req|
req.body = "{\n \"awsSourceVmDetails\": {\n \"committedStorageBytes\": \"\",\n \"firmware\": \"\"\n },\n \"computeEngineTargetDefaults\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"targetProject\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDefaults\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"currentSyncInfo\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"cutoverForecast\": {\n \"estimatedCutoverJobDuration\": \"\"\n },\n \"description\": \"\",\n \"displayName\": \"\",\n \"error\": {},\n \"group\": \"\",\n \"labels\": {},\n \"lastReplicationCycle\": {},\n \"lastSync\": {\n \"lastSyncTime\": \"\"\n },\n \"name\": \"\",\n \"policy\": {\n \"idleDuration\": \"\",\n \"skipOsAdaptation\": false\n },\n \"recentCloneJobs\": [\n {\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"adaptingOs\": {},\n \"endTime\": \"\",\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"recentCutoverJobs\": [\n {\n \"computeEngineTargetDetails\": {},\n \"computeEngineVmDetails\": {},\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {},\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n }\n ],\n \"sourceVmId\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"targetDefaults\": {},\n \"updateTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/migratingVms";
let payload = json!({
"awsSourceVmDetails": json!({
"committedStorageBytes": "",
"firmware": ""
}),
"computeEngineTargetDefaults": json!({
"additionalLicenses": (),
"appliedLicense": json!({
"osLicense": "",
"type": ""
}),
"bootOption": "",
"computeScheduling": json!({
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": (
json!({
"key": "",
"operator": "",
"values": ()
})
),
"onHostMaintenance": "",
"restartType": ""
}),
"diskType": "",
"hostname": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"networkInterfaces": (
json!({
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
})
),
"networkTags": (),
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
}),
"computeEngineVmDefaults": json!({
"appliedLicense": json!({}),
"bootOption": "",
"computeScheduling": json!({}),
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"name": "",
"network": "",
"networkInterfaces": (json!({})),
"networkTags": (),
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
}),
"createTime": "",
"currentSyncInfo": json!({
"cycleNumber": 0,
"endTime": "",
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": (
json!({
"endTime": "",
"initializingReplication": json!({}),
"postProcessing": json!({}),
"replicating": json!({
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
}),
"startTime": ""
})
),
"totalPauseDuration": "",
"warnings": (
json!({
"actionItem": json!({
"locale": "",
"message": ""
}),
"code": "",
"helpLinks": (
json!({
"description": "",
"url": ""
})
),
"warningMessage": json!({}),
"warningTime": ""
})
)
}),
"cutoverForecast": json!({"estimatedCutoverJobDuration": ""}),
"description": "",
"displayName": "",
"error": json!({}),
"group": "",
"labels": json!({}),
"lastReplicationCycle": json!({}),
"lastSync": json!({"lastSyncTime": ""}),
"name": "",
"policy": json!({
"idleDuration": "",
"skipOsAdaptation": false
}),
"recentCloneJobs": (
json!({
"computeEngineTargetDetails": json!({
"additionalLicenses": (),
"appliedLicense": json!({}),
"bootOption": "",
"computeScheduling": json!({}),
"diskType": "",
"hostname": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"networkInterfaces": (json!({})),
"networkTags": (),
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
}),
"computeEngineVmDetails": json!({}),
"createTime": "",
"endTime": "",
"error": json!({}),
"name": "",
"state": "",
"stateTime": "",
"steps": (
json!({
"adaptingOs": json!({}),
"endTime": "",
"instantiatingMigratedVm": json!({}),
"preparingVmDisks": json!({}),
"startTime": ""
})
),
"targetDetails": json!({})
})
),
"recentCutoverJobs": (
json!({
"computeEngineTargetDetails": json!({}),
"computeEngineVmDetails": json!({}),
"createTime": "",
"endTime": "",
"error": json!({}),
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": (
json!({
"endTime": "",
"finalSync": json!({}),
"instantiatingMigratedVm": json!({}),
"preparingVmDisks": json!({}),
"previousReplicationCycle": json!({}),
"shuttingDownSourceVm": json!({}),
"startTime": ""
})
),
"targetDetails": json!({})
})
),
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": json!({}),
"updateTime": ""
});
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}}/v1alpha1/:parent/migratingVms \
--header 'content-type: application/json' \
--data '{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}'
echo '{
"awsSourceVmDetails": {
"committedStorageBytes": "",
"firmware": ""
},
"computeEngineTargetDefaults": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDefaults": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"currentSyncInfo": {
"cycleNumber": 0,
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"cutoverForecast": {
"estimatedCutoverJobDuration": ""
},
"description": "",
"displayName": "",
"error": {},
"group": "",
"labels": {},
"lastReplicationCycle": {},
"lastSync": {
"lastSyncTime": ""
},
"name": "",
"policy": {
"idleDuration": "",
"skipOsAdaptation": false
},
"recentCloneJobs": [
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"state": "",
"stateTime": "",
"steps": [
{
"adaptingOs": {},
"endTime": "",
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"recentCutoverJobs": [
{
"computeEngineTargetDetails": {},
"computeEngineVmDetails": {},
"createTime": "",
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": {},
"updateTime": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/migratingVms \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "awsSourceVmDetails": {\n "committedStorageBytes": "",\n "firmware": ""\n },\n "computeEngineTargetDefaults": {\n "additionalLicenses": [],\n "appliedLicense": {\n "osLicense": "",\n "type": ""\n },\n "bootOption": "",\n "computeScheduling": {\n "automaticRestart": false,\n "minNodeCpus": 0,\n "nodeAffinities": [\n {\n "key": "",\n "operator": "",\n "values": []\n }\n ],\n "onHostMaintenance": "",\n "restartType": ""\n },\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {\n "externalIp": "",\n "internalIp": "",\n "network": "",\n "subnetwork": ""\n }\n ],\n "networkTags": [],\n "secureBoot": false,\n "serviceAccount": "",\n "targetProject": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDefaults": {\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "externalIp": "",\n "internalIp": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "name": "",\n "network": "",\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "subnetwork": "",\n "targetProject": "",\n "zone": ""\n },\n "createTime": "",\n "currentSyncInfo": {\n "cycleNumber": 0,\n "endTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "startTime": "",\n "state": "",\n "steps": [\n {\n "endTime": "",\n "initializingReplication": {},\n "postProcessing": {},\n "replicating": {\n "lastThirtyMinutesAverageBytesPerSecond": "",\n "lastTwoMinutesAverageBytesPerSecond": "",\n "replicatedBytes": "",\n "totalBytes": ""\n },\n "startTime": ""\n }\n ],\n "totalPauseDuration": "",\n "warnings": [\n {\n "actionItem": {\n "locale": "",\n "message": ""\n },\n "code": "",\n "helpLinks": [\n {\n "description": "",\n "url": ""\n }\n ],\n "warningMessage": {},\n "warningTime": ""\n }\n ]\n },\n "cutoverForecast": {\n "estimatedCutoverJobDuration": ""\n },\n "description": "",\n "displayName": "",\n "error": {},\n "group": "",\n "labels": {},\n "lastReplicationCycle": {},\n "lastSync": {\n "lastSyncTime": ""\n },\n "name": "",\n "policy": {\n "idleDuration": "",\n "skipOsAdaptation": false\n },\n "recentCloneJobs": [\n {\n "computeEngineTargetDetails": {\n "additionalLicenses": [],\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDetails": {},\n "createTime": "",\n "endTime": "",\n "error": {},\n "name": "",\n "state": "",\n "stateTime": "",\n "steps": [\n {\n "adaptingOs": {},\n "endTime": "",\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n }\n ],\n "recentCutoverJobs": [\n {\n "computeEngineTargetDetails": {},\n "computeEngineVmDetails": {},\n "createTime": "",\n "endTime": "",\n "error": {},\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "state": "",\n "stateMessage": "",\n "stateTime": "",\n "steps": [\n {\n "endTime": "",\n "finalSync": {},\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "previousReplicationCycle": {},\n "shuttingDownSourceVm": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n }\n ],\n "sourceVmId": "",\n "state": "",\n "stateTime": "",\n "targetDefaults": {},\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/migratingVms
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"awsSourceVmDetails": [
"committedStorageBytes": "",
"firmware": ""
],
"computeEngineTargetDefaults": [
"additionalLicenses": [],
"appliedLicense": [
"osLicense": "",
"type": ""
],
"bootOption": "",
"computeScheduling": [
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
[
"key": "",
"operator": "",
"values": []
]
],
"onHostMaintenance": "",
"restartType": ""
],
"diskType": "",
"hostname": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"networkInterfaces": [
[
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
]
],
"networkTags": [],
"secureBoot": false,
"serviceAccount": "",
"targetProject": "",
"vmName": "",
"zone": ""
],
"computeEngineVmDefaults": [
"appliedLicense": [],
"bootOption": "",
"computeScheduling": [],
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"name": "",
"network": "",
"networkInterfaces": [[]],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
],
"createTime": "",
"currentSyncInfo": [
"cycleNumber": 0,
"endTime": "",
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
[
"endTime": "",
"initializingReplication": [],
"postProcessing": [],
"replicating": [
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
],
"startTime": ""
]
],
"totalPauseDuration": "",
"warnings": [
[
"actionItem": [
"locale": "",
"message": ""
],
"code": "",
"helpLinks": [
[
"description": "",
"url": ""
]
],
"warningMessage": [],
"warningTime": ""
]
]
],
"cutoverForecast": ["estimatedCutoverJobDuration": ""],
"description": "",
"displayName": "",
"error": [],
"group": "",
"labels": [],
"lastReplicationCycle": [],
"lastSync": ["lastSyncTime": ""],
"name": "",
"policy": [
"idleDuration": "",
"skipOsAdaptation": false
],
"recentCloneJobs": [
[
"computeEngineTargetDetails": [
"additionalLicenses": [],
"appliedLicense": [],
"bootOption": "",
"computeScheduling": [],
"diskType": "",
"hostname": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"networkInterfaces": [[]],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
],
"computeEngineVmDetails": [],
"createTime": "",
"endTime": "",
"error": [],
"name": "",
"state": "",
"stateTime": "",
"steps": [
[
"adaptingOs": [],
"endTime": "",
"instantiatingMigratedVm": [],
"preparingVmDisks": [],
"startTime": ""
]
],
"targetDetails": []
]
],
"recentCutoverJobs": [
[
"computeEngineTargetDetails": [],
"computeEngineVmDetails": [],
"createTime": "",
"endTime": "",
"error": [],
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
[
"endTime": "",
"finalSync": [],
"instantiatingMigratedVm": [],
"preparingVmDisks": [],
"previousReplicationCycle": [],
"shuttingDownSourceVm": [],
"startTime": ""
]
],
"targetDetails": []
]
],
"sourceVmId": "",
"state": "",
"stateTime": "",
"targetDefaults": [],
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/migratingVms")! 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
vmmigration.projects.locations.sources.migratingVms.cutoverJobs.cancel
{{baseUrl}}/v1alpha1/:name:cancel
QUERY PARAMS
name
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:name:cancel");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:name:cancel" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:name:cancel"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v1alpha1/:name:cancel"),
Content = new StringContent("{}")
{
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}}/v1alpha1/:name:cancel");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:name:cancel"
payload := strings.NewReader("{}")
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/v1alpha1/:name:cancel HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:name:cancel")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:name:cancel"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name:cancel")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:name:cancel")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:name:cancel');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:name:cancel',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:name:cancel';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v1alpha1/:name:cancel',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name:cancel")
.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/v1alpha1/:name:cancel',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:name:cancel',
headers: {'content-type': 'application/json'},
body: {},
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}}/v1alpha1/:name:cancel');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v1alpha1/:name:cancel',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:name:cancel';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:name:cancel"]
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}}/v1alpha1/:name:cancel" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:name:cancel",
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([
]),
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}}/v1alpha1/:name:cancel', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:name:cancel');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:name:cancel');
$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}}/v1alpha1/:name:cancel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:name:cancel' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:name:cancel", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:name:cancel"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:name:cancel"
payload <- "{}"
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}}/v1alpha1/:name:cancel")
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 = "{}"
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/v1alpha1/:name:cancel') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:name:cancel";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:name:cancel \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1alpha1/:name:cancel \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1alpha1/:name:cancel
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:name:cancel")! 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
vmmigration.projects.locations.sources.migratingVms.cutoverJobs.create
{{baseUrl}}/v1alpha1/:parent/cutoverJobs
QUERY PARAMS
parent
BODY json
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/cutoverJobs");
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 \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/cutoverJobs" {:content-type :json
:form-params {:computeEngineTargetDetails {:additionalLicenses []
:appliedLicense {:osLicense ""
:type ""}
:bootOption ""
:computeScheduling {:automaticRestart false
:minNodeCpus 0
:nodeAffinities [{:key ""
:operator ""
:values []}]
:onHostMaintenance ""
:restartType ""}
:diskType ""
:hostname ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:networkInterfaces [{:externalIp ""
:internalIp ""
:network ""
:subnetwork ""}]
:networkTags []
:project ""
:secureBoot false
:serviceAccount ""
:vmName ""
:zone ""}
:computeEngineVmDetails {:appliedLicense {}
:bootOption ""
:computeScheduling {}
:diskType ""
:externalIp ""
:internalIp ""
:labels {}
:licenseType ""
:machineType ""
:machineTypeSeries ""
:metadata {}
:name ""
:network ""
:networkInterfaces [{}]
:networkTags []
:project ""
:secureBoot false
:serviceAccount ""
:subnetwork ""
:targetProject ""
:zone ""}
:createTime ""
:endTime ""
:error {:code 0
:details [{}]
:message ""}
:name ""
:progress 0
:progressPercent 0
:state ""
:stateMessage ""
:stateTime ""
:steps [{:endTime ""
:finalSync {:cycleNumber 0
:endTime ""
:error {}
:name ""
:progress 0
:progressPercent 0
:startTime ""
:state ""
:steps [{:endTime ""
:initializingReplication {}
:postProcessing {}
:replicating {:lastThirtyMinutesAverageBytesPerSecond ""
:lastTwoMinutesAverageBytesPerSecond ""
:replicatedBytes ""
:totalBytes ""}
:startTime ""}]
:totalPauseDuration ""
:warnings [{:actionItem {:locale ""
:message ""}
:code ""
:helpLinks [{:description ""
:url ""}]
:warningMessage {}
:warningTime ""}]}
:instantiatingMigratedVm {}
:preparingVmDisks {}
:previousReplicationCycle {}
:shuttingDownSourceVm {}
:startTime ""}]
:targetDetails {}}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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}}/v1alpha1/:parent/cutoverJobs"),
Content = new StringContent("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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}}/v1alpha1/:parent/cutoverJobs");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
payload := strings.NewReader("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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/v1alpha1/:parent/cutoverJobs HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2899
{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.setHeader("content-type", "application/json")
.setBody("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/cutoverJobs"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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 \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.header("content-type", "application/json")
.body("{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}")
.asString();
const data = JSON.stringify({
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {
osLicense: '',
type: ''
},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [
{
key: '',
operator: '',
values: []
}
],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{
externalIp: '',
internalIp: '',
network: '',
subnetwork: ''
}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {
cycleNumber: 0,
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {
locale: '',
message: ''
},
code: '',
helpLinks: [
{
description: '',
url: ''
}
],
warningMessage: {},
warningTime: ''
}
]
},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/cutoverJobs');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/cutoverJobs',
headers: {'content-type': 'application/json'},
data: {
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {
cycleNumber: 0,
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/cutoverJobs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"computeEngineTargetDetails":{"additionalLicenses":[],"appliedLicense":{"osLicense":"","type":""},"bootOption":"","computeScheduling":{"automaticRestart":false,"minNodeCpus":0,"nodeAffinities":[{"key":"","operator":"","values":[]}],"onHostMaintenance":"","restartType":""},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{"externalIp":"","internalIp":"","network":"","subnetwork":""}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","vmName":"","zone":""},"computeEngineVmDetails":{"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","externalIp":"","internalIp":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"name":"","network":"","networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","subnetwork":"","targetProject":"","zone":""},"createTime":"","endTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","progress":0,"progressPercent":0,"state":"","stateMessage":"","stateTime":"","steps":[{"endTime":"","finalSync":{"cycleNumber":0,"endTime":"","error":{},"name":"","progress":0,"progressPercent":0,"startTime":"","state":"","steps":[{"endTime":"","initializingReplication":{},"postProcessing":{},"replicating":{"lastThirtyMinutesAverageBytesPerSecond":"","lastTwoMinutesAverageBytesPerSecond":"","replicatedBytes":"","totalBytes":""},"startTime":""}],"totalPauseDuration":"","warnings":[{"actionItem":{"locale":"","message":""},"code":"","helpLinks":[{"description":"","url":""}],"warningMessage":{},"warningTime":""}]},"instantiatingMigratedVm":{},"preparingVmDisks":{},"previousReplicationCycle":{},"shuttingDownSourceVm":{},"startTime":""}],"targetDetails":{}}'
};
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}}/v1alpha1/:parent/cutoverJobs',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "computeEngineTargetDetails": {\n "additionalLicenses": [],\n "appliedLicense": {\n "osLicense": "",\n "type": ""\n },\n "bootOption": "",\n "computeScheduling": {\n "automaticRestart": false,\n "minNodeCpus": 0,\n "nodeAffinities": [\n {\n "key": "",\n "operator": "",\n "values": []\n }\n ],\n "onHostMaintenance": "",\n "restartType": ""\n },\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {\n "externalIp": "",\n "internalIp": "",\n "network": "",\n "subnetwork": ""\n }\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDetails": {\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "externalIp": "",\n "internalIp": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "name": "",\n "network": "",\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "subnetwork": "",\n "targetProject": "",\n "zone": ""\n },\n "createTime": "",\n "endTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "state": "",\n "stateMessage": "",\n "stateTime": "",\n "steps": [\n {\n "endTime": "",\n "finalSync": {\n "cycleNumber": 0,\n "endTime": "",\n "error": {},\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "startTime": "",\n "state": "",\n "steps": [\n {\n "endTime": "",\n "initializingReplication": {},\n "postProcessing": {},\n "replicating": {\n "lastThirtyMinutesAverageBytesPerSecond": "",\n "lastTwoMinutesAverageBytesPerSecond": "",\n "replicatedBytes": "",\n "totalBytes": ""\n },\n "startTime": ""\n }\n ],\n "totalPauseDuration": "",\n "warnings": [\n {\n "actionItem": {\n "locale": "",\n "message": ""\n },\n "code": "",\n "helpLinks": [\n {\n "description": "",\n "url": ""\n }\n ],\n "warningMessage": {},\n "warningTime": ""\n }\n ]\n },\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "previousReplicationCycle": {},\n "shuttingDownSourceVm": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.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/v1alpha1/:parent/cutoverJobs',
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({
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {
cycleNumber: 0,
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/cutoverJobs',
headers: {'content-type': 'application/json'},
body: {
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {
cycleNumber: 0,
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
},
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}}/v1alpha1/:parent/cutoverJobs');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {
osLicense: '',
type: ''
},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [
{
key: '',
operator: '',
values: []
}
],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [
{
externalIp: '',
internalIp: '',
network: '',
subnetwork: ''
}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [
{}
],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {
cycleNumber: 0,
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {
locale: '',
message: ''
},
code: '',
helpLinks: [
{
description: '',
url: ''
}
],
warningMessage: {},
warningTime: ''
}
]
},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
});
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}}/v1alpha1/:parent/cutoverJobs',
headers: {'content-type': 'application/json'},
data: {
computeEngineTargetDetails: {
additionalLicenses: [],
appliedLicense: {osLicense: '', type: ''},
bootOption: '',
computeScheduling: {
automaticRestart: false,
minNodeCpus: 0,
nodeAffinities: [{key: '', operator: '', values: []}],
onHostMaintenance: '',
restartType: ''
},
diskType: '',
hostname: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
networkInterfaces: [{externalIp: '', internalIp: '', network: '', subnetwork: ''}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
vmName: '',
zone: ''
},
computeEngineVmDetails: {
appliedLicense: {},
bootOption: '',
computeScheduling: {},
diskType: '',
externalIp: '',
internalIp: '',
labels: {},
licenseType: '',
machineType: '',
machineTypeSeries: '',
metadata: {},
name: '',
network: '',
networkInterfaces: [{}],
networkTags: [],
project: '',
secureBoot: false,
serviceAccount: '',
subnetwork: '',
targetProject: '',
zone: ''
},
createTime: '',
endTime: '',
error: {code: 0, details: [{}], message: ''},
name: '',
progress: 0,
progressPercent: 0,
state: '',
stateMessage: '',
stateTime: '',
steps: [
{
endTime: '',
finalSync: {
cycleNumber: 0,
endTime: '',
error: {},
name: '',
progress: 0,
progressPercent: 0,
startTime: '',
state: '',
steps: [
{
endTime: '',
initializingReplication: {},
postProcessing: {},
replicating: {
lastThirtyMinutesAverageBytesPerSecond: '',
lastTwoMinutesAverageBytesPerSecond: '',
replicatedBytes: '',
totalBytes: ''
},
startTime: ''
}
],
totalPauseDuration: '',
warnings: [
{
actionItem: {locale: '', message: ''},
code: '',
helpLinks: [{description: '', url: ''}],
warningMessage: {},
warningTime: ''
}
]
},
instantiatingMigratedVm: {},
preparingVmDisks: {},
previousReplicationCycle: {},
shuttingDownSourceVm: {},
startTime: ''
}
],
targetDetails: {}
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/cutoverJobs';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"computeEngineTargetDetails":{"additionalLicenses":[],"appliedLicense":{"osLicense":"","type":""},"bootOption":"","computeScheduling":{"automaticRestart":false,"minNodeCpus":0,"nodeAffinities":[{"key":"","operator":"","values":[]}],"onHostMaintenance":"","restartType":""},"diskType":"","hostname":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"networkInterfaces":[{"externalIp":"","internalIp":"","network":"","subnetwork":""}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","vmName":"","zone":""},"computeEngineVmDetails":{"appliedLicense":{},"bootOption":"","computeScheduling":{},"diskType":"","externalIp":"","internalIp":"","labels":{},"licenseType":"","machineType":"","machineTypeSeries":"","metadata":{},"name":"","network":"","networkInterfaces":[{}],"networkTags":[],"project":"","secureBoot":false,"serviceAccount":"","subnetwork":"","targetProject":"","zone":""},"createTime":"","endTime":"","error":{"code":0,"details":[{}],"message":""},"name":"","progress":0,"progressPercent":0,"state":"","stateMessage":"","stateTime":"","steps":[{"endTime":"","finalSync":{"cycleNumber":0,"endTime":"","error":{},"name":"","progress":0,"progressPercent":0,"startTime":"","state":"","steps":[{"endTime":"","initializingReplication":{},"postProcessing":{},"replicating":{"lastThirtyMinutesAverageBytesPerSecond":"","lastTwoMinutesAverageBytesPerSecond":"","replicatedBytes":"","totalBytes":""},"startTime":""}],"totalPauseDuration":"","warnings":[{"actionItem":{"locale":"","message":""},"code":"","helpLinks":[{"description":"","url":""}],"warningMessage":{},"warningTime":""}]},"instantiatingMigratedVm":{},"preparingVmDisks":{},"previousReplicationCycle":{},"shuttingDownSourceVm":{},"startTime":""}],"targetDetails":{}}'
};
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 = @{ @"computeEngineTargetDetails": @{ @"additionalLicenses": @[ ], @"appliedLicense": @{ @"osLicense": @"", @"type": @"" }, @"bootOption": @"", @"computeScheduling": @{ @"automaticRestart": @NO, @"minNodeCpus": @0, @"nodeAffinities": @[ @{ @"key": @"", @"operator": @"", @"values": @[ ] } ], @"onHostMaintenance": @"", @"restartType": @"" }, @"diskType": @"", @"hostname": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"networkInterfaces": @[ @{ @"externalIp": @"", @"internalIp": @"", @"network": @"", @"subnetwork": @"" } ], @"networkTags": @[ ], @"project": @"", @"secureBoot": @NO, @"serviceAccount": @"", @"vmName": @"", @"zone": @"" },
@"computeEngineVmDetails": @{ @"appliedLicense": @{ }, @"bootOption": @"", @"computeScheduling": @{ }, @"diskType": @"", @"externalIp": @"", @"internalIp": @"", @"labels": @{ }, @"licenseType": @"", @"machineType": @"", @"machineTypeSeries": @"", @"metadata": @{ }, @"name": @"", @"network": @"", @"networkInterfaces": @[ @{ } ], @"networkTags": @[ ], @"project": @"", @"secureBoot": @NO, @"serviceAccount": @"", @"subnetwork": @"", @"targetProject": @"", @"zone": @"" },
@"createTime": @"",
@"endTime": @"",
@"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" },
@"name": @"",
@"progress": @0,
@"progressPercent": @0,
@"state": @"",
@"stateMessage": @"",
@"stateTime": @"",
@"steps": @[ @{ @"endTime": @"", @"finalSync": @{ @"cycleNumber": @0, @"endTime": @"", @"error": @{ }, @"name": @"", @"progress": @0, @"progressPercent": @0, @"startTime": @"", @"state": @"", @"steps": @[ @{ @"endTime": @"", @"initializingReplication": @{ }, @"postProcessing": @{ }, @"replicating": @{ @"lastThirtyMinutesAverageBytesPerSecond": @"", @"lastTwoMinutesAverageBytesPerSecond": @"", @"replicatedBytes": @"", @"totalBytes": @"" }, @"startTime": @"" } ], @"totalPauseDuration": @"", @"warnings": @[ @{ @"actionItem": @{ @"locale": @"", @"message": @"" }, @"code": @"", @"helpLinks": @[ @{ @"description": @"", @"url": @"" } ], @"warningMessage": @{ }, @"warningTime": @"" } ] }, @"instantiatingMigratedVm": @{ }, @"preparingVmDisks": @{ }, @"previousReplicationCycle": @{ }, @"shuttingDownSourceVm": @{ }, @"startTime": @"" } ],
@"targetDetails": @{ } };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/cutoverJobs"]
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}}/v1alpha1/:parent/cutoverJobs" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/cutoverJobs",
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([
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'state' => '',
'stateMessage' => '',
'stateTime' => '',
'steps' => [
[
'endTime' => '',
'finalSync' => [
'cycleNumber' => 0,
'endTime' => '',
'error' => [
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'startTime' => '',
'state' => '',
'steps' => [
[
'endTime' => '',
'initializingReplication' => [
],
'postProcessing' => [
],
'replicating' => [
'lastThirtyMinutesAverageBytesPerSecond' => '',
'lastTwoMinutesAverageBytesPerSecond' => '',
'replicatedBytes' => '',
'totalBytes' => ''
],
'startTime' => ''
]
],
'totalPauseDuration' => '',
'warnings' => [
[
'actionItem' => [
'locale' => '',
'message' => ''
],
'code' => '',
'helpLinks' => [
[
'description' => '',
'url' => ''
]
],
'warningMessage' => [
],
'warningTime' => ''
]
]
],
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'previousReplicationCycle' => [
],
'shuttingDownSourceVm' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]),
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}}/v1alpha1/:parent/cutoverJobs', [
'body' => '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/cutoverJobs');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'state' => '',
'stateMessage' => '',
'stateTime' => '',
'steps' => [
[
'endTime' => '',
'finalSync' => [
'cycleNumber' => 0,
'endTime' => '',
'error' => [
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'startTime' => '',
'state' => '',
'steps' => [
[
'endTime' => '',
'initializingReplication' => [
],
'postProcessing' => [
],
'replicating' => [
'lastThirtyMinutesAverageBytesPerSecond' => '',
'lastTwoMinutesAverageBytesPerSecond' => '',
'replicatedBytes' => '',
'totalBytes' => ''
],
'startTime' => ''
]
],
'totalPauseDuration' => '',
'warnings' => [
[
'actionItem' => [
'locale' => '',
'message' => ''
],
'code' => '',
'helpLinks' => [
[
'description' => '',
'url' => ''
]
],
'warningMessage' => [
],
'warningTime' => ''
]
]
],
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'previousReplicationCycle' => [
],
'shuttingDownSourceVm' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'computeEngineTargetDetails' => [
'additionalLicenses' => [
],
'appliedLicense' => [
'osLicense' => '',
'type' => ''
],
'bootOption' => '',
'computeScheduling' => [
'automaticRestart' => null,
'minNodeCpus' => 0,
'nodeAffinities' => [
[
'key' => '',
'operator' => '',
'values' => [
]
]
],
'onHostMaintenance' => '',
'restartType' => ''
],
'diskType' => '',
'hostname' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'networkInterfaces' => [
[
'externalIp' => '',
'internalIp' => '',
'network' => '',
'subnetwork' => ''
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'vmName' => '',
'zone' => ''
],
'computeEngineVmDetails' => [
'appliedLicense' => [
],
'bootOption' => '',
'computeScheduling' => [
],
'diskType' => '',
'externalIp' => '',
'internalIp' => '',
'labels' => [
],
'licenseType' => '',
'machineType' => '',
'machineTypeSeries' => '',
'metadata' => [
],
'name' => '',
'network' => '',
'networkInterfaces' => [
[
]
],
'networkTags' => [
],
'project' => '',
'secureBoot' => null,
'serviceAccount' => '',
'subnetwork' => '',
'targetProject' => '',
'zone' => ''
],
'createTime' => '',
'endTime' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'state' => '',
'stateMessage' => '',
'stateTime' => '',
'steps' => [
[
'endTime' => '',
'finalSync' => [
'cycleNumber' => 0,
'endTime' => '',
'error' => [
],
'name' => '',
'progress' => 0,
'progressPercent' => 0,
'startTime' => '',
'state' => '',
'steps' => [
[
'endTime' => '',
'initializingReplication' => [
],
'postProcessing' => [
],
'replicating' => [
'lastThirtyMinutesAverageBytesPerSecond' => '',
'lastTwoMinutesAverageBytesPerSecond' => '',
'replicatedBytes' => '',
'totalBytes' => ''
],
'startTime' => ''
]
],
'totalPauseDuration' => '',
'warnings' => [
[
'actionItem' => [
'locale' => '',
'message' => ''
],
'code' => '',
'helpLinks' => [
[
'description' => '',
'url' => ''
]
],
'warningMessage' => [
],
'warningTime' => ''
]
]
],
'instantiatingMigratedVm' => [
],
'preparingVmDisks' => [
],
'previousReplicationCycle' => [
],
'shuttingDownSourceVm' => [
],
'startTime' => ''
]
],
'targetDetails' => [
]
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/cutoverJobs');
$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}}/v1alpha1/:parent/cutoverJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/cutoverJobs' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/cutoverJobs", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
payload = {
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": False,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": False,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [{}],
"networkTags": [],
"project": "",
"secureBoot": False,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
payload <- "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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}}/v1alpha1/:parent/cutoverJobs")
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 \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\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/v1alpha1/:parent/cutoverJobs') do |req|
req.body = "{\n \"computeEngineTargetDetails\": {\n \"additionalLicenses\": [],\n \"appliedLicense\": {\n \"osLicense\": \"\",\n \"type\": \"\"\n },\n \"bootOption\": \"\",\n \"computeScheduling\": {\n \"automaticRestart\": false,\n \"minNodeCpus\": 0,\n \"nodeAffinities\": [\n {\n \"key\": \"\",\n \"operator\": \"\",\n \"values\": []\n }\n ],\n \"onHostMaintenance\": \"\",\n \"restartType\": \"\"\n },\n \"diskType\": \"\",\n \"hostname\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"networkInterfaces\": [\n {\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"network\": \"\",\n \"subnetwork\": \"\"\n }\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"vmName\": \"\",\n \"zone\": \"\"\n },\n \"computeEngineVmDetails\": {\n \"appliedLicense\": {},\n \"bootOption\": \"\",\n \"computeScheduling\": {},\n \"diskType\": \"\",\n \"externalIp\": \"\",\n \"internalIp\": \"\",\n \"labels\": {},\n \"licenseType\": \"\",\n \"machineType\": \"\",\n \"machineTypeSeries\": \"\",\n \"metadata\": {},\n \"name\": \"\",\n \"network\": \"\",\n \"networkInterfaces\": [\n {}\n ],\n \"networkTags\": [],\n \"project\": \"\",\n \"secureBoot\": false,\n \"serviceAccount\": \"\",\n \"subnetwork\": \"\",\n \"targetProject\": \"\",\n \"zone\": \"\"\n },\n \"createTime\": \"\",\n \"endTime\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"state\": \"\",\n \"stateMessage\": \"\",\n \"stateTime\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"finalSync\": {\n \"cycleNumber\": 0,\n \"endTime\": \"\",\n \"error\": {},\n \"name\": \"\",\n \"progress\": 0,\n \"progressPercent\": 0,\n \"startTime\": \"\",\n \"state\": \"\",\n \"steps\": [\n {\n \"endTime\": \"\",\n \"initializingReplication\": {},\n \"postProcessing\": {},\n \"replicating\": {\n \"lastThirtyMinutesAverageBytesPerSecond\": \"\",\n \"lastTwoMinutesAverageBytesPerSecond\": \"\",\n \"replicatedBytes\": \"\",\n \"totalBytes\": \"\"\n },\n \"startTime\": \"\"\n }\n ],\n \"totalPauseDuration\": \"\",\n \"warnings\": [\n {\n \"actionItem\": {\n \"locale\": \"\",\n \"message\": \"\"\n },\n \"code\": \"\",\n \"helpLinks\": [\n {\n \"description\": \"\",\n \"url\": \"\"\n }\n ],\n \"warningMessage\": {},\n \"warningTime\": \"\"\n }\n ]\n },\n \"instantiatingMigratedVm\": {},\n \"preparingVmDisks\": {},\n \"previousReplicationCycle\": {},\n \"shuttingDownSourceVm\": {},\n \"startTime\": \"\"\n }\n ],\n \"targetDetails\": {}\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/cutoverJobs";
let payload = json!({
"computeEngineTargetDetails": json!({
"additionalLicenses": (),
"appliedLicense": json!({
"osLicense": "",
"type": ""
}),
"bootOption": "",
"computeScheduling": json!({
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": (
json!({
"key": "",
"operator": "",
"values": ()
})
),
"onHostMaintenance": "",
"restartType": ""
}),
"diskType": "",
"hostname": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"networkInterfaces": (
json!({
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
})
),
"networkTags": (),
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
}),
"computeEngineVmDetails": json!({
"appliedLicense": json!({}),
"bootOption": "",
"computeScheduling": json!({}),
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": json!({}),
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": json!({}),
"name": "",
"network": "",
"networkInterfaces": (json!({})),
"networkTags": (),
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
}),
"createTime": "",
"endTime": "",
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": (
json!({
"endTime": "",
"finalSync": json!({
"cycleNumber": 0,
"endTime": "",
"error": json!({}),
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": (
json!({
"endTime": "",
"initializingReplication": json!({}),
"postProcessing": json!({}),
"replicating": json!({
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
}),
"startTime": ""
})
),
"totalPauseDuration": "",
"warnings": (
json!({
"actionItem": json!({
"locale": "",
"message": ""
}),
"code": "",
"helpLinks": (
json!({
"description": "",
"url": ""
})
),
"warningMessage": json!({}),
"warningTime": ""
})
)
}),
"instantiatingMigratedVm": json!({}),
"preparingVmDisks": json!({}),
"previousReplicationCycle": json!({}),
"shuttingDownSourceVm": json!({}),
"startTime": ""
})
),
"targetDetails": json!({})
});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:parent/cutoverJobs \
--header 'content-type: application/json' \
--data '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}'
echo '{
"computeEngineTargetDetails": {
"additionalLicenses": [],
"appliedLicense": {
"osLicense": "",
"type": ""
},
"bootOption": "",
"computeScheduling": {
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
{
"key": "",
"operator": "",
"values": []
}
],
"onHostMaintenance": "",
"restartType": ""
},
"diskType": "",
"hostname": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"networkInterfaces": [
{
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
},
"computeEngineVmDetails": {
"appliedLicense": {},
"bootOption": "",
"computeScheduling": {},
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": {},
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": {},
"name": "",
"network": "",
"networkInterfaces": [
{}
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
},
"createTime": "",
"endTime": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
{
"endTime": "",
"finalSync": {
"cycleNumber": 0,
"endTime": "",
"error": {},
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
{
"endTime": "",
"initializingReplication": {},
"postProcessing": {},
"replicating": {
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
},
"startTime": ""
}
],
"totalPauseDuration": "",
"warnings": [
{
"actionItem": {
"locale": "",
"message": ""
},
"code": "",
"helpLinks": [
{
"description": "",
"url": ""
}
],
"warningMessage": {},
"warningTime": ""
}
]
},
"instantiatingMigratedVm": {},
"preparingVmDisks": {},
"previousReplicationCycle": {},
"shuttingDownSourceVm": {},
"startTime": ""
}
],
"targetDetails": {}
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/cutoverJobs \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "computeEngineTargetDetails": {\n "additionalLicenses": [],\n "appliedLicense": {\n "osLicense": "",\n "type": ""\n },\n "bootOption": "",\n "computeScheduling": {\n "automaticRestart": false,\n "minNodeCpus": 0,\n "nodeAffinities": [\n {\n "key": "",\n "operator": "",\n "values": []\n }\n ],\n "onHostMaintenance": "",\n "restartType": ""\n },\n "diskType": "",\n "hostname": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "networkInterfaces": [\n {\n "externalIp": "",\n "internalIp": "",\n "network": "",\n "subnetwork": ""\n }\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "vmName": "",\n "zone": ""\n },\n "computeEngineVmDetails": {\n "appliedLicense": {},\n "bootOption": "",\n "computeScheduling": {},\n "diskType": "",\n "externalIp": "",\n "internalIp": "",\n "labels": {},\n "licenseType": "",\n "machineType": "",\n "machineTypeSeries": "",\n "metadata": {},\n "name": "",\n "network": "",\n "networkInterfaces": [\n {}\n ],\n "networkTags": [],\n "project": "",\n "secureBoot": false,\n "serviceAccount": "",\n "subnetwork": "",\n "targetProject": "",\n "zone": ""\n },\n "createTime": "",\n "endTime": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "state": "",\n "stateMessage": "",\n "stateTime": "",\n "steps": [\n {\n "endTime": "",\n "finalSync": {\n "cycleNumber": 0,\n "endTime": "",\n "error": {},\n "name": "",\n "progress": 0,\n "progressPercent": 0,\n "startTime": "",\n "state": "",\n "steps": [\n {\n "endTime": "",\n "initializingReplication": {},\n "postProcessing": {},\n "replicating": {\n "lastThirtyMinutesAverageBytesPerSecond": "",\n "lastTwoMinutesAverageBytesPerSecond": "",\n "replicatedBytes": "",\n "totalBytes": ""\n },\n "startTime": ""\n }\n ],\n "totalPauseDuration": "",\n "warnings": [\n {\n "actionItem": {\n "locale": "",\n "message": ""\n },\n "code": "",\n "helpLinks": [\n {\n "description": "",\n "url": ""\n }\n ],\n "warningMessage": {},\n "warningTime": ""\n }\n ]\n },\n "instantiatingMigratedVm": {},\n "preparingVmDisks": {},\n "previousReplicationCycle": {},\n "shuttingDownSourceVm": {},\n "startTime": ""\n }\n ],\n "targetDetails": {}\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/cutoverJobs
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"computeEngineTargetDetails": [
"additionalLicenses": [],
"appliedLicense": [
"osLicense": "",
"type": ""
],
"bootOption": "",
"computeScheduling": [
"automaticRestart": false,
"minNodeCpus": 0,
"nodeAffinities": [
[
"key": "",
"operator": "",
"values": []
]
],
"onHostMaintenance": "",
"restartType": ""
],
"diskType": "",
"hostname": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"networkInterfaces": [
[
"externalIp": "",
"internalIp": "",
"network": "",
"subnetwork": ""
]
],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"vmName": "",
"zone": ""
],
"computeEngineVmDetails": [
"appliedLicense": [],
"bootOption": "",
"computeScheduling": [],
"diskType": "",
"externalIp": "",
"internalIp": "",
"labels": [],
"licenseType": "",
"machineType": "",
"machineTypeSeries": "",
"metadata": [],
"name": "",
"network": "",
"networkInterfaces": [[]],
"networkTags": [],
"project": "",
"secureBoot": false,
"serviceAccount": "",
"subnetwork": "",
"targetProject": "",
"zone": ""
],
"createTime": "",
"endTime": "",
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"name": "",
"progress": 0,
"progressPercent": 0,
"state": "",
"stateMessage": "",
"stateTime": "",
"steps": [
[
"endTime": "",
"finalSync": [
"cycleNumber": 0,
"endTime": "",
"error": [],
"name": "",
"progress": 0,
"progressPercent": 0,
"startTime": "",
"state": "",
"steps": [
[
"endTime": "",
"initializingReplication": [],
"postProcessing": [],
"replicating": [
"lastThirtyMinutesAverageBytesPerSecond": "",
"lastTwoMinutesAverageBytesPerSecond": "",
"replicatedBytes": "",
"totalBytes": ""
],
"startTime": ""
]
],
"totalPauseDuration": "",
"warnings": [
[
"actionItem": [
"locale": "",
"message": ""
],
"code": "",
"helpLinks": [
[
"description": "",
"url": ""
]
],
"warningMessage": [],
"warningTime": ""
]
]
],
"instantiatingMigratedVm": [],
"preparingVmDisks": [],
"previousReplicationCycle": [],
"shuttingDownSourceVm": [],
"startTime": ""
]
],
"targetDetails": []
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/cutoverJobs")! 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
vmmigration.projects.locations.sources.migratingVms.cutoverJobs.list
{{baseUrl}}/v1alpha1/:parent/cutoverJobs
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/cutoverJobs");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
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}}/v1alpha1/:parent/cutoverJobs"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/cutoverJobs");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
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/v1alpha1/:parent/cutoverJobs HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/cutoverJobs"))
.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}}/v1alpha1/:parent/cutoverJobs")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.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}}/v1alpha1/:parent/cutoverJobs');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:parent/cutoverJobs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/cutoverJobs';
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}}/v1alpha1/:parent/cutoverJobs',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/cutoverJobs',
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}}/v1alpha1/:parent/cutoverJobs'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/cutoverJobs');
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}}/v1alpha1/:parent/cutoverJobs'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/cutoverJobs';
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}}/v1alpha1/:parent/cutoverJobs"]
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}}/v1alpha1/:parent/cutoverJobs" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/cutoverJobs",
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}}/v1alpha1/:parent/cutoverJobs');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/cutoverJobs');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/cutoverJobs');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/cutoverJobs' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/cutoverJobs' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/cutoverJobs")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/cutoverJobs"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/cutoverJobs")
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/v1alpha1/:parent/cutoverJobs') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/cutoverJobs";
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}}/v1alpha1/:parent/cutoverJobs
http GET {{baseUrl}}/v1alpha1/:parent/cutoverJobs
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/cutoverJobs
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/cutoverJobs")! 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
vmmigration.projects.locations.sources.migratingVms.finalizeMigration
{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration
QUERY PARAMS
migratingVm
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v1alpha1/:migratingVm:finalizeMigration"),
Content = new StringContent("{}")
{
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}}/v1alpha1/:migratingVm:finalizeMigration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration"
payload := strings.NewReader("{}")
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/v1alpha1/:migratingVm:finalizeMigration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v1alpha1/:migratingVm:finalizeMigration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration")
.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/v1alpha1/:migratingVm:finalizeMigration',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration',
headers: {'content-type': 'application/json'},
body: {},
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}}/v1alpha1/:migratingVm:finalizeMigration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v1alpha1/:migratingVm:finalizeMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration"]
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}}/v1alpha1/:migratingVm:finalizeMigration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration",
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([
]),
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}}/v1alpha1/:migratingVm:finalizeMigration', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration');
$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}}/v1alpha1/:migratingVm:finalizeMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:migratingVm:finalizeMigration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration"
payload <- "{}"
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}}/v1alpha1/:migratingVm:finalizeMigration")
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 = "{}"
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/v1alpha1/:migratingVm:finalizeMigration') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:migratingVm:finalizeMigration")! 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
vmmigration.projects.locations.sources.migratingVms.list
{{baseUrl}}/v1alpha1/:parent/migratingVms
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/migratingVms");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/migratingVms")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/migratingVms"
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}}/v1alpha1/:parent/migratingVms"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/migratingVms");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/migratingVms"
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/v1alpha1/:parent/migratingVms HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/migratingVms")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/migratingVms"))
.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}}/v1alpha1/:parent/migratingVms")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/migratingVms")
.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}}/v1alpha1/:parent/migratingVms');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1alpha1/:parent/migratingVms'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/migratingVms';
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}}/v1alpha1/:parent/migratingVms',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/migratingVms")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/migratingVms',
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}}/v1alpha1/:parent/migratingVms'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/migratingVms');
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}}/v1alpha1/:parent/migratingVms'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/migratingVms';
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}}/v1alpha1/:parent/migratingVms"]
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}}/v1alpha1/:parent/migratingVms" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/migratingVms",
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}}/v1alpha1/:parent/migratingVms');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/migratingVms');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/migratingVms');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/migratingVms' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/migratingVms' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/migratingVms")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/migratingVms"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/migratingVms"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/migratingVms")
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/v1alpha1/:parent/migratingVms') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/migratingVms";
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}}/v1alpha1/:parent/migratingVms
http GET {{baseUrl}}/v1alpha1/:parent/migratingVms
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/migratingVms
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/migratingVms")! 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
vmmigration.projects.locations.sources.migratingVms.pauseMigration
{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration
QUERY PARAMS
migratingVm
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v1alpha1/:migratingVm:pauseMigration"),
Content = new StringContent("{}")
{
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}}/v1alpha1/:migratingVm:pauseMigration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration"
payload := strings.NewReader("{}")
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/v1alpha1/:migratingVm:pauseMigration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v1alpha1/:migratingVm:pauseMigration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration")
.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/v1alpha1/:migratingVm:pauseMigration',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration',
headers: {'content-type': 'application/json'},
body: {},
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}}/v1alpha1/:migratingVm:pauseMigration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v1alpha1/:migratingVm:pauseMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration"]
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}}/v1alpha1/:migratingVm:pauseMigration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration",
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([
]),
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}}/v1alpha1/:migratingVm:pauseMigration', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration');
$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}}/v1alpha1/:migratingVm:pauseMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:migratingVm:pauseMigration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration"
payload <- "{}"
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}}/v1alpha1/:migratingVm:pauseMigration")
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 = "{}"
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/v1alpha1/:migratingVm:pauseMigration') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:migratingVm:pauseMigration \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1alpha1/:migratingVm:pauseMigration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1alpha1/:migratingVm:pauseMigration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:migratingVm:pauseMigration")! 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
vmmigration.projects.locations.sources.migratingVms.replicationCycles.list
{{baseUrl}}/v1alpha1/:parent/replicationCycles
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/replicationCycles");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/replicationCycles")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/replicationCycles"
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}}/v1alpha1/:parent/replicationCycles"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/replicationCycles");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/replicationCycles"
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/v1alpha1/:parent/replicationCycles HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/replicationCycles")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/replicationCycles"))
.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}}/v1alpha1/:parent/replicationCycles")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/replicationCycles")
.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}}/v1alpha1/:parent/replicationCycles');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1alpha1/:parent/replicationCycles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/replicationCycles';
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}}/v1alpha1/:parent/replicationCycles',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/replicationCycles")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/replicationCycles',
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}}/v1alpha1/:parent/replicationCycles'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/replicationCycles');
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}}/v1alpha1/:parent/replicationCycles'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/replicationCycles';
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}}/v1alpha1/:parent/replicationCycles"]
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}}/v1alpha1/:parent/replicationCycles" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/replicationCycles",
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}}/v1alpha1/:parent/replicationCycles');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/replicationCycles');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/replicationCycles');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/replicationCycles' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/replicationCycles' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/replicationCycles")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/replicationCycles"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/replicationCycles"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/replicationCycles")
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/v1alpha1/:parent/replicationCycles') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/replicationCycles";
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}}/v1alpha1/:parent/replicationCycles
http GET {{baseUrl}}/v1alpha1/:parent/replicationCycles
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/replicationCycles
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/replicationCycles")! 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
vmmigration.projects.locations.sources.migratingVms.resumeMigration
{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration
QUERY PARAMS
migratingVm
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v1alpha1/:migratingVm:resumeMigration"),
Content = new StringContent("{}")
{
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}}/v1alpha1/:migratingVm:resumeMigration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration"
payload := strings.NewReader("{}")
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/v1alpha1/:migratingVm:resumeMigration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v1alpha1/:migratingVm:resumeMigration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration")
.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/v1alpha1/:migratingVm:resumeMigration',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration',
headers: {'content-type': 'application/json'},
body: {},
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}}/v1alpha1/:migratingVm:resumeMigration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v1alpha1/:migratingVm:resumeMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration"]
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}}/v1alpha1/:migratingVm:resumeMigration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration",
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([
]),
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}}/v1alpha1/:migratingVm:resumeMigration', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration');
$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}}/v1alpha1/:migratingVm:resumeMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:migratingVm:resumeMigration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration"
payload <- "{}"
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}}/v1alpha1/:migratingVm:resumeMigration")
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 = "{}"
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/v1alpha1/:migratingVm:resumeMigration') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:migratingVm:resumeMigration \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1alpha1/:migratingVm:resumeMigration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1alpha1/:migratingVm:resumeMigration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:migratingVm:resumeMigration")! 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
vmmigration.projects.locations.sources.migratingVms.startMigration
{{baseUrl}}/v1alpha1/:migratingVm:startMigration
QUERY PARAMS
migratingVm
BODY json
{}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:migratingVm:startMigration");
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, "{}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:migratingVm:startMigration" {:content-type :json})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:migratingVm:startMigration"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{}"
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}}/v1alpha1/:migratingVm:startMigration"),
Content = new StringContent("{}")
{
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}}/v1alpha1/:migratingVm:startMigration");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:migratingVm:startMigration"
payload := strings.NewReader("{}")
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/v1alpha1/:migratingVm:startMigration HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 2
{}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:migratingVm:startMigration")
.setHeader("content-type", "application/json")
.setBody("{}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:migratingVm:startMigration"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{}"))
.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, "{}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:startMigration")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:migratingVm:startMigration")
.header("content-type", "application/json")
.body("{}")
.asString();
const data = JSON.stringify({});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:migratingVm:startMigration');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:startMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:migratingVm:startMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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}}/v1alpha1/:migratingVm:startMigration',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:migratingVm:startMigration")
.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/v1alpha1/:migratingVm:startMigration',
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({}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:migratingVm:startMigration',
headers: {'content-type': 'application/json'},
body: {},
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}}/v1alpha1/:migratingVm:startMigration');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({});
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}}/v1alpha1/:migratingVm:startMigration',
headers: {'content-type': 'application/json'},
data: {}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:migratingVm:startMigration';
const options = {method: 'POST', headers: {'content-type': 'application/json'}, body: '{}'};
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 = @{ };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:migratingVm:startMigration"]
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}}/v1alpha1/:migratingVm:startMigration" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:migratingVm:startMigration",
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([
]),
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}}/v1alpha1/:migratingVm:startMigration', [
'body' => '{}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:migratingVm:startMigration');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:migratingVm:startMigration');
$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}}/v1alpha1/:migratingVm:startMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:migratingVm:startMigration' -Method POST -Headers $headers -ContentType 'application/json' -Body '{}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:migratingVm:startMigration", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:migratingVm:startMigration"
payload = {}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:migratingVm:startMigration"
payload <- "{}"
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}}/v1alpha1/:migratingVm:startMigration")
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 = "{}"
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/v1alpha1/:migratingVm:startMigration') do |req|
req.body = "{}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:migratingVm:startMigration";
let payload = json!({});
let mut headers = reqwest::header::HeaderMap::new();
headers.insert("content-type", "application/json".parse().unwrap());
let client = reqwest::Client::new();
let response = client.post(url)
.headers(headers)
.json(&payload)
.send()
.await;
let results = response.unwrap()
.json::()
.await
.unwrap();
dbg!(results);
}
curl --request POST \
--url {{baseUrl}}/v1alpha1/:migratingVm:startMigration \
--header 'content-type: application/json' \
--data '{}'
echo '{}' | \
http POST {{baseUrl}}/v1alpha1/:migratingVm:startMigration \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{}' \
--output-document \
- {{baseUrl}}/v1alpha1/:migratingVm:startMigration
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:migratingVm:startMigration")! 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
vmmigration.projects.locations.sources.utilizationReports.create
{{baseUrl}}/v1alpha1/:parent/utilizationReports
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/utilizationReports");
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 \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/utilizationReports" {:content-type :json
:form-params {:createTime ""
:displayName ""
:error {:code 0
:details [{}]
:message ""}
:frameEndTime ""
:name ""
:state ""
:stateTime ""
:timeFrame ""
:vmCount 0
:vms [{:utilization {:cpuAverage 0
:cpuAveragePercent 0
:cpuMax 0
:cpuMaxPercent 0
:diskIoRateAverage ""
:diskIoRateAverageKbps ""
:diskIoRateMax ""
:diskIoRateMaxKbps ""
:memoryAverage 0
:memoryAveragePercent 0
:memoryMax 0
:memoryMaxPercent 0
:networkThroughputAverage ""
:networkThroughputAverageKbps ""
:networkThroughputMax ""
:networkThroughputMaxKbps ""}
:vmId ""
:vmwareVmDetails {:bootOption ""
:committedStorage ""
:committedStorageMb ""
:cpuCount 0
:datacenterDescription ""
:datacenterId ""
:diskCount 0
:displayName ""
:guestDescription ""
:memoryMb 0
:powerState ""
:uuid ""
:vmId ""}}]
:vmsCount 0}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}"
response = HTTP::Client.post url, headers: headers, body: reqBody
puts response.body
using System.Net.Http.Headers;
var client = new HttpClient();
var request = new HttpRequestMessage
{
Method = HttpMethod.Post,
RequestUri = new Uri("{{baseUrl}}/v1alpha1/:parent/utilizationReports"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}")
{
Headers =
{
ContentType = new MediaTypeHeaderValue("application/json")
}
}
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/utilizationReports");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("content-type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
POST /baseUrl/v1alpha1/:parent/utilizationReports HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 1228
{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/utilizationReports"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}"))
.build();
HttpResponse response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
OkHttpClient client = new OkHttpClient();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}")
.asString();
const data = JSON.stringify({
createTime: '',
displayName: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
frameEndTime: '',
name: '',
state: '',
stateTime: '',
timeFrame: '',
vmCount: 0,
vms: [
{
utilization: {
cpuAverage: 0,
cpuAveragePercent: 0,
cpuMax: 0,
cpuMaxPercent: 0,
diskIoRateAverage: '',
diskIoRateAverageKbps: '',
diskIoRateMax: '',
diskIoRateMaxKbps: '',
memoryAverage: 0,
memoryAveragePercent: 0,
memoryMax: 0,
memoryMaxPercent: 0,
networkThroughputAverage: '',
networkThroughputAverageKbps: '',
networkThroughputMax: '',
networkThroughputMaxKbps: ''
},
vmId: '',
vmwareVmDetails: {
bootOption: '',
committedStorage: '',
committedStorageMb: '',
cpuCount: 0,
datacenterDescription: '',
datacenterId: '',
diskCount: 0,
displayName: '',
guestDescription: '',
memoryMb: 0,
powerState: '',
uuid: '',
vmId: ''
}
}
],
vmsCount: 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}}/v1alpha1/:parent/utilizationReports');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/utilizationReports',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
displayName: '',
error: {code: 0, details: [{}], message: ''},
frameEndTime: '',
name: '',
state: '',
stateTime: '',
timeFrame: '',
vmCount: 0,
vms: [
{
utilization: {
cpuAverage: 0,
cpuAveragePercent: 0,
cpuMax: 0,
cpuMaxPercent: 0,
diskIoRateAverage: '',
diskIoRateAverageKbps: '',
diskIoRateMax: '',
diskIoRateMaxKbps: '',
memoryAverage: 0,
memoryAveragePercent: 0,
memoryMax: 0,
memoryMaxPercent: 0,
networkThroughputAverage: '',
networkThroughputAverageKbps: '',
networkThroughputMax: '',
networkThroughputMaxKbps: ''
},
vmId: '',
vmwareVmDetails: {
bootOption: '',
committedStorage: '',
committedStorageMb: '',
cpuCount: 0,
datacenterDescription: '',
datacenterId: '',
diskCount: 0,
displayName: '',
guestDescription: '',
memoryMb: 0,
powerState: '',
uuid: '',
vmId: ''
}
}
],
vmsCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/utilizationReports';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","error":{"code":0,"details":[{}],"message":""},"frameEndTime":"","name":"","state":"","stateTime":"","timeFrame":"","vmCount":0,"vms":[{"utilization":{"cpuAverage":0,"cpuAveragePercent":0,"cpuMax":0,"cpuMaxPercent":0,"diskIoRateAverage":"","diskIoRateAverageKbps":"","diskIoRateMax":"","diskIoRateMaxKbps":"","memoryAverage":0,"memoryAveragePercent":0,"memoryMax":0,"memoryMaxPercent":0,"networkThroughputAverage":"","networkThroughputAverageKbps":"","networkThroughputMax":"","networkThroughputMaxKbps":""},"vmId":"","vmwareVmDetails":{"bootOption":"","committedStorage":"","committedStorageMb":"","cpuCount":0,"datacenterDescription":"","datacenterId":"","diskCount":0,"displayName":"","guestDescription":"","memoryMb":0,"powerState":"","uuid":"","vmId":""}}],"vmsCount":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}}/v1alpha1/:parent/utilizationReports',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "displayName": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "frameEndTime": "",\n "name": "",\n "state": "",\n "stateTime": "",\n "timeFrame": "",\n "vmCount": 0,\n "vms": [\n {\n "utilization": {\n "cpuAverage": 0,\n "cpuAveragePercent": 0,\n "cpuMax": 0,\n "cpuMaxPercent": 0,\n "diskIoRateAverage": "",\n "diskIoRateAverageKbps": "",\n "diskIoRateMax": "",\n "diskIoRateMaxKbps": "",\n "memoryAverage": 0,\n "memoryAveragePercent": 0,\n "memoryMax": 0,\n "memoryMaxPercent": 0,\n "networkThroughputAverage": "",\n "networkThroughputAverageKbps": "",\n "networkThroughputMax": "",\n "networkThroughputMaxKbps": ""\n },\n "vmId": "",\n "vmwareVmDetails": {\n "bootOption": "",\n "committedStorage": "",\n "committedStorageMb": "",\n "cpuCount": 0,\n "datacenterDescription": "",\n "datacenterId": "",\n "diskCount": 0,\n "displayName": "",\n "guestDescription": "",\n "memoryMb": 0,\n "powerState": "",\n "uuid": "",\n "vmId": ""\n }\n }\n ],\n "vmsCount": 0\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.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/v1alpha1/:parent/utilizationReports',
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({
createTime: '',
displayName: '',
error: {code: 0, details: [{}], message: ''},
frameEndTime: '',
name: '',
state: '',
stateTime: '',
timeFrame: '',
vmCount: 0,
vms: [
{
utilization: {
cpuAverage: 0,
cpuAveragePercent: 0,
cpuMax: 0,
cpuMaxPercent: 0,
diskIoRateAverage: '',
diskIoRateAverageKbps: '',
diskIoRateMax: '',
diskIoRateMaxKbps: '',
memoryAverage: 0,
memoryAveragePercent: 0,
memoryMax: 0,
memoryMaxPercent: 0,
networkThroughputAverage: '',
networkThroughputAverageKbps: '',
networkThroughputMax: '',
networkThroughputMaxKbps: ''
},
vmId: '',
vmwareVmDetails: {
bootOption: '',
committedStorage: '',
committedStorageMb: '',
cpuCount: 0,
datacenterDescription: '',
datacenterId: '',
diskCount: 0,
displayName: '',
guestDescription: '',
memoryMb: 0,
powerState: '',
uuid: '',
vmId: ''
}
}
],
vmsCount: 0
}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/utilizationReports',
headers: {'content-type': 'application/json'},
body: {
createTime: '',
displayName: '',
error: {code: 0, details: [{}], message: ''},
frameEndTime: '',
name: '',
state: '',
stateTime: '',
timeFrame: '',
vmCount: 0,
vms: [
{
utilization: {
cpuAverage: 0,
cpuAveragePercent: 0,
cpuMax: 0,
cpuMaxPercent: 0,
diskIoRateAverage: '',
diskIoRateAverageKbps: '',
diskIoRateMax: '',
diskIoRateMaxKbps: '',
memoryAverage: 0,
memoryAveragePercent: 0,
memoryMax: 0,
memoryMaxPercent: 0,
networkThroughputAverage: '',
networkThroughputAverageKbps: '',
networkThroughputMax: '',
networkThroughputMaxKbps: ''
},
vmId: '',
vmwareVmDetails: {
bootOption: '',
committedStorage: '',
committedStorageMb: '',
cpuCount: 0,
datacenterDescription: '',
datacenterId: '',
diskCount: 0,
displayName: '',
guestDescription: '',
memoryMb: 0,
powerState: '',
uuid: '',
vmId: ''
}
}
],
vmsCount: 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}}/v1alpha1/:parent/utilizationReports');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
displayName: '',
error: {
code: 0,
details: [
{}
],
message: ''
},
frameEndTime: '',
name: '',
state: '',
stateTime: '',
timeFrame: '',
vmCount: 0,
vms: [
{
utilization: {
cpuAverage: 0,
cpuAveragePercent: 0,
cpuMax: 0,
cpuMaxPercent: 0,
diskIoRateAverage: '',
diskIoRateAverageKbps: '',
diskIoRateMax: '',
diskIoRateMaxKbps: '',
memoryAverage: 0,
memoryAveragePercent: 0,
memoryMax: 0,
memoryMaxPercent: 0,
networkThroughputAverage: '',
networkThroughputAverageKbps: '',
networkThroughputMax: '',
networkThroughputMaxKbps: ''
},
vmId: '',
vmwareVmDetails: {
bootOption: '',
committedStorage: '',
committedStorageMb: '',
cpuCount: 0,
datacenterDescription: '',
datacenterId: '',
diskCount: 0,
displayName: '',
guestDescription: '',
memoryMb: 0,
powerState: '',
uuid: '',
vmId: ''
}
}
],
vmsCount: 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}}/v1alpha1/:parent/utilizationReports',
headers: {'content-type': 'application/json'},
data: {
createTime: '',
displayName: '',
error: {code: 0, details: [{}], message: ''},
frameEndTime: '',
name: '',
state: '',
stateTime: '',
timeFrame: '',
vmCount: 0,
vms: [
{
utilization: {
cpuAverage: 0,
cpuAveragePercent: 0,
cpuMax: 0,
cpuMaxPercent: 0,
diskIoRateAverage: '',
diskIoRateAverageKbps: '',
diskIoRateMax: '',
diskIoRateMaxKbps: '',
memoryAverage: 0,
memoryAveragePercent: 0,
memoryMax: 0,
memoryMaxPercent: 0,
networkThroughputAverage: '',
networkThroughputAverageKbps: '',
networkThroughputMax: '',
networkThroughputMaxKbps: ''
},
vmId: '',
vmwareVmDetails: {
bootOption: '',
committedStorage: '',
committedStorageMb: '',
cpuCount: 0,
datacenterDescription: '',
datacenterId: '',
diskCount: 0,
displayName: '',
guestDescription: '',
memoryMb: 0,
powerState: '',
uuid: '',
vmId: ''
}
}
],
vmsCount: 0
}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/utilizationReports';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","displayName":"","error":{"code":0,"details":[{}],"message":""},"frameEndTime":"","name":"","state":"","stateTime":"","timeFrame":"","vmCount":0,"vms":[{"utilization":{"cpuAverage":0,"cpuAveragePercent":0,"cpuMax":0,"cpuMaxPercent":0,"diskIoRateAverage":"","diskIoRateAverageKbps":"","diskIoRateMax":"","diskIoRateMaxKbps":"","memoryAverage":0,"memoryAveragePercent":0,"memoryMax":0,"memoryMaxPercent":0,"networkThroughputAverage":"","networkThroughputAverageKbps":"","networkThroughputMax":"","networkThroughputMaxKbps":""},"vmId":"","vmwareVmDetails":{"bootOption":"","committedStorage":"","committedStorageMb":"","cpuCount":0,"datacenterDescription":"","datacenterId":"","diskCount":0,"displayName":"","guestDescription":"","memoryMb":0,"powerState":"","uuid":"","vmId":""}}],"vmsCount":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 = @{ @"createTime": @"",
@"displayName": @"",
@"error": @{ @"code": @0, @"details": @[ @{ } ], @"message": @"" },
@"frameEndTime": @"",
@"name": @"",
@"state": @"",
@"stateTime": @"",
@"timeFrame": @"",
@"vmCount": @0,
@"vms": @[ @{ @"utilization": @{ @"cpuAverage": @0, @"cpuAveragePercent": @0, @"cpuMax": @0, @"cpuMaxPercent": @0, @"diskIoRateAverage": @"", @"diskIoRateAverageKbps": @"", @"diskIoRateMax": @"", @"diskIoRateMaxKbps": @"", @"memoryAverage": @0, @"memoryAveragePercent": @0, @"memoryMax": @0, @"memoryMaxPercent": @0, @"networkThroughputAverage": @"", @"networkThroughputAverageKbps": @"", @"networkThroughputMax": @"", @"networkThroughputMaxKbps": @"" }, @"vmId": @"", @"vmwareVmDetails": @{ @"bootOption": @"", @"committedStorage": @"", @"committedStorageMb": @"", @"cpuCount": @0, @"datacenterDescription": @"", @"datacenterId": @"", @"diskCount": @0, @"displayName": @"", @"guestDescription": @"", @"memoryMb": @0, @"powerState": @"", @"uuid": @"", @"vmId": @"" } } ],
@"vmsCount": @0 };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/utilizationReports"]
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}}/v1alpha1/:parent/utilizationReports" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/utilizationReports",
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([
'createTime' => '',
'displayName' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'frameEndTime' => '',
'name' => '',
'state' => '',
'stateTime' => '',
'timeFrame' => '',
'vmCount' => 0,
'vms' => [
[
'utilization' => [
'cpuAverage' => 0,
'cpuAveragePercent' => 0,
'cpuMax' => 0,
'cpuMaxPercent' => 0,
'diskIoRateAverage' => '',
'diskIoRateAverageKbps' => '',
'diskIoRateMax' => '',
'diskIoRateMaxKbps' => '',
'memoryAverage' => 0,
'memoryAveragePercent' => 0,
'memoryMax' => 0,
'memoryMaxPercent' => 0,
'networkThroughputAverage' => '',
'networkThroughputAverageKbps' => '',
'networkThroughputMax' => '',
'networkThroughputMaxKbps' => ''
],
'vmId' => '',
'vmwareVmDetails' => [
'bootOption' => '',
'committedStorage' => '',
'committedStorageMb' => '',
'cpuCount' => 0,
'datacenterDescription' => '',
'datacenterId' => '',
'diskCount' => 0,
'displayName' => '',
'guestDescription' => '',
'memoryMb' => 0,
'powerState' => '',
'uuid' => '',
'vmId' => ''
]
]
],
'vmsCount' => 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}}/v1alpha1/:parent/utilizationReports', [
'body' => '{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/utilizationReports');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'displayName' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'frameEndTime' => '',
'name' => '',
'state' => '',
'stateTime' => '',
'timeFrame' => '',
'vmCount' => 0,
'vms' => [
[
'utilization' => [
'cpuAverage' => 0,
'cpuAveragePercent' => 0,
'cpuMax' => 0,
'cpuMaxPercent' => 0,
'diskIoRateAverage' => '',
'diskIoRateAverageKbps' => '',
'diskIoRateMax' => '',
'diskIoRateMaxKbps' => '',
'memoryAverage' => 0,
'memoryAveragePercent' => 0,
'memoryMax' => 0,
'memoryMaxPercent' => 0,
'networkThroughputAverage' => '',
'networkThroughputAverageKbps' => '',
'networkThroughputMax' => '',
'networkThroughputMaxKbps' => ''
],
'vmId' => '',
'vmwareVmDetails' => [
'bootOption' => '',
'committedStorage' => '',
'committedStorageMb' => '',
'cpuCount' => 0,
'datacenterDescription' => '',
'datacenterId' => '',
'diskCount' => 0,
'displayName' => '',
'guestDescription' => '',
'memoryMb' => 0,
'powerState' => '',
'uuid' => '',
'vmId' => ''
]
]
],
'vmsCount' => 0
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'displayName' => '',
'error' => [
'code' => 0,
'details' => [
[
]
],
'message' => ''
],
'frameEndTime' => '',
'name' => '',
'state' => '',
'stateTime' => '',
'timeFrame' => '',
'vmCount' => 0,
'vms' => [
[
'utilization' => [
'cpuAverage' => 0,
'cpuAveragePercent' => 0,
'cpuMax' => 0,
'cpuMaxPercent' => 0,
'diskIoRateAverage' => '',
'diskIoRateAverageKbps' => '',
'diskIoRateMax' => '',
'diskIoRateMaxKbps' => '',
'memoryAverage' => 0,
'memoryAveragePercent' => 0,
'memoryMax' => 0,
'memoryMaxPercent' => 0,
'networkThroughputAverage' => '',
'networkThroughputAverageKbps' => '',
'networkThroughputMax' => '',
'networkThroughputMaxKbps' => ''
],
'vmId' => '',
'vmwareVmDetails' => [
'bootOption' => '',
'committedStorage' => '',
'committedStorageMb' => '',
'cpuCount' => 0,
'datacenterDescription' => '',
'datacenterId' => '',
'diskCount' => 0,
'displayName' => '',
'guestDescription' => '',
'memoryMb' => 0,
'powerState' => '',
'uuid' => '',
'vmId' => ''
]
]
],
'vmsCount' => 0
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/utilizationReports');
$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}}/v1alpha1/:parent/utilizationReports' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/utilizationReports' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/utilizationReports", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
payload = {
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [{}],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
payload <- "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}"
encode <- "json"
response <- VERB("POST", url, body = payload, content_type("application/json"), encode = encode)
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
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 \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}"
response = http.request(request)
puts response.read_body
require 'faraday'
conn = Faraday.new(
url: 'https://example.com',
headers: {'Content-Type' => 'application/json'}
)
response = conn.post('/baseUrl/v1alpha1/:parent/utilizationReports') do |req|
req.body = "{\n \"createTime\": \"\",\n \"displayName\": \"\",\n \"error\": {\n \"code\": 0,\n \"details\": [\n {}\n ],\n \"message\": \"\"\n },\n \"frameEndTime\": \"\",\n \"name\": \"\",\n \"state\": \"\",\n \"stateTime\": \"\",\n \"timeFrame\": \"\",\n \"vmCount\": 0,\n \"vms\": [\n {\n \"utilization\": {\n \"cpuAverage\": 0,\n \"cpuAveragePercent\": 0,\n \"cpuMax\": 0,\n \"cpuMaxPercent\": 0,\n \"diskIoRateAverage\": \"\",\n \"diskIoRateAverageKbps\": \"\",\n \"diskIoRateMax\": \"\",\n \"diskIoRateMaxKbps\": \"\",\n \"memoryAverage\": 0,\n \"memoryAveragePercent\": 0,\n \"memoryMax\": 0,\n \"memoryMaxPercent\": 0,\n \"networkThroughputAverage\": \"\",\n \"networkThroughputAverageKbps\": \"\",\n \"networkThroughputMax\": \"\",\n \"networkThroughputMaxKbps\": \"\"\n },\n \"vmId\": \"\",\n \"vmwareVmDetails\": {\n \"bootOption\": \"\",\n \"committedStorage\": \"\",\n \"committedStorageMb\": \"\",\n \"cpuCount\": 0,\n \"datacenterDescription\": \"\",\n \"datacenterId\": \"\",\n \"diskCount\": 0,\n \"displayName\": \"\",\n \"guestDescription\": \"\",\n \"memoryMb\": 0,\n \"powerState\": \"\",\n \"uuid\": \"\",\n \"vmId\": \"\"\n }\n }\n ],\n \"vmsCount\": 0\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/utilizationReports";
let payload = json!({
"createTime": "",
"displayName": "",
"error": json!({
"code": 0,
"details": (json!({})),
"message": ""
}),
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": (
json!({
"utilization": json!({
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
}),
"vmId": "",
"vmwareVmDetails": json!({
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
})
})
),
"vmsCount": 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}}/v1alpha1/:parent/utilizationReports \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}'
echo '{
"createTime": "",
"displayName": "",
"error": {
"code": 0,
"details": [
{}
],
"message": ""
},
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
{
"utilization": {
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
},
"vmId": "",
"vmwareVmDetails": {
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
}
}
],
"vmsCount": 0
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/utilizationReports \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "displayName": "",\n "error": {\n "code": 0,\n "details": [\n {}\n ],\n "message": ""\n },\n "frameEndTime": "",\n "name": "",\n "state": "",\n "stateTime": "",\n "timeFrame": "",\n "vmCount": 0,\n "vms": [\n {\n "utilization": {\n "cpuAverage": 0,\n "cpuAveragePercent": 0,\n "cpuMax": 0,\n "cpuMaxPercent": 0,\n "diskIoRateAverage": "",\n "diskIoRateAverageKbps": "",\n "diskIoRateMax": "",\n "diskIoRateMaxKbps": "",\n "memoryAverage": 0,\n "memoryAveragePercent": 0,\n "memoryMax": 0,\n "memoryMaxPercent": 0,\n "networkThroughputAverage": "",\n "networkThroughputAverageKbps": "",\n "networkThroughputMax": "",\n "networkThroughputMaxKbps": ""\n },\n "vmId": "",\n "vmwareVmDetails": {\n "bootOption": "",\n "committedStorage": "",\n "committedStorageMb": "",\n "cpuCount": 0,\n "datacenterDescription": "",\n "datacenterId": "",\n "diskCount": 0,\n "displayName": "",\n "guestDescription": "",\n "memoryMb": 0,\n "powerState": "",\n "uuid": "",\n "vmId": ""\n }\n }\n ],\n "vmsCount": 0\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/utilizationReports
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"displayName": "",
"error": [
"code": 0,
"details": [[]],
"message": ""
],
"frameEndTime": "",
"name": "",
"state": "",
"stateTime": "",
"timeFrame": "",
"vmCount": 0,
"vms": [
[
"utilization": [
"cpuAverage": 0,
"cpuAveragePercent": 0,
"cpuMax": 0,
"cpuMaxPercent": 0,
"diskIoRateAverage": "",
"diskIoRateAverageKbps": "",
"diskIoRateMax": "",
"diskIoRateMaxKbps": "",
"memoryAverage": 0,
"memoryAveragePercent": 0,
"memoryMax": 0,
"memoryMaxPercent": 0,
"networkThroughputAverage": "",
"networkThroughputAverageKbps": "",
"networkThroughputMax": "",
"networkThroughputMaxKbps": ""
],
"vmId": "",
"vmwareVmDetails": [
"bootOption": "",
"committedStorage": "",
"committedStorageMb": "",
"cpuCount": 0,
"datacenterDescription": "",
"datacenterId": "",
"diskCount": 0,
"displayName": "",
"guestDescription": "",
"memoryMb": 0,
"powerState": "",
"uuid": "",
"vmId": ""
]
]
],
"vmsCount": 0
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/utilizationReports")! 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
vmmigration.projects.locations.sources.utilizationReports.list
{{baseUrl}}/v1alpha1/:parent/utilizationReports
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/utilizationReports");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/utilizationReports")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
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}}/v1alpha1/:parent/utilizationReports"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/utilizationReports");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
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/v1alpha1/:parent/utilizationReports HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/utilizationReports"))
.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}}/v1alpha1/:parent/utilizationReports")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.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}}/v1alpha1/:parent/utilizationReports');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1alpha1/:parent/utilizationReports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/utilizationReports';
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}}/v1alpha1/:parent/utilizationReports',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/utilizationReports',
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}}/v1alpha1/:parent/utilizationReports'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/utilizationReports');
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}}/v1alpha1/:parent/utilizationReports'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/utilizationReports';
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}}/v1alpha1/:parent/utilizationReports"]
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}}/v1alpha1/:parent/utilizationReports" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/utilizationReports",
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}}/v1alpha1/:parent/utilizationReports');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/utilizationReports');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/utilizationReports');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/utilizationReports' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/utilizationReports' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/utilizationReports")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/utilizationReports"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/utilizationReports")
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/v1alpha1/:parent/utilizationReports') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/utilizationReports";
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}}/v1alpha1/:parent/utilizationReports
http GET {{baseUrl}}/v1alpha1/:parent/utilizationReports
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/utilizationReports
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/utilizationReports")! 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
vmmigration.projects.locations.targetProjects.create
{{baseUrl}}/v1alpha1/:parent/targetProjects
QUERY PARAMS
parent
BODY json
{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "POST");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/targetProjects");
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 \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/post "{{baseUrl}}/v1alpha1/:parent/targetProjects" {:content-type :json
:form-params {:createTime ""
:description ""
:name ""
:project ""
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/targetProjects"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/targetProjects"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/targetProjects");
var request = new RestRequest("", Method.Post);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/targetProjects"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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/v1alpha1/:parent/targetProjects HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 94
{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("POST", "{{baseUrl}}/v1alpha1/:parent/targetProjects")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/targetProjects"))
.header("content-type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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 \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/targetProjects")
.post(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.post("{{baseUrl}}/v1alpha1/:parent/targetProjects")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
description: '',
name: '',
project: '',
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('POST', '{{baseUrl}}/v1alpha1/:parent/targetProjects');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/targetProjects',
headers: {'content-type': 'application/json'},
data: {createTime: '', description: '', name: '', project: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/targetProjects';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","description":"","name":"","project":"","updateTime":""}'
};
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}}/v1alpha1/:parent/targetProjects',
method: 'POST',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "description": "",\n "name": "",\n "project": "",\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/targetProjects")
.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/v1alpha1/:parent/targetProjects',
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({createTime: '', description: '', name: '', project: '', updateTime: ''}));
req.end();
const request = require('request');
const options = {
method: 'POST',
url: '{{baseUrl}}/v1alpha1/:parent/targetProjects',
headers: {'content-type': 'application/json'},
body: {createTime: '', description: '', name: '', project: '', updateTime: ''},
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}}/v1alpha1/:parent/targetProjects');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
description: '',
name: '',
project: '',
updateTime: ''
});
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}}/v1alpha1/:parent/targetProjects',
headers: {'content-type': 'application/json'},
data: {createTime: '', description: '', name: '', project: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/targetProjects';
const options = {
method: 'POST',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","description":"","name":"","project":"","updateTime":""}'
};
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 = @{ @"createTime": @"",
@"description": @"",
@"name": @"",
@"project": @"",
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:parent/targetProjects"]
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}}/v1alpha1/:parent/targetProjects" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `POST uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/targetProjects",
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([
'createTime' => '',
'description' => '',
'name' => '',
'project' => '',
'updateTime' => ''
]),
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}}/v1alpha1/:parent/targetProjects', [
'body' => '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/targetProjects');
$request->setMethod(HTTP_METH_POST);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'description' => '',
'name' => '',
'project' => '',
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'description' => '',
'name' => '',
'project' => '',
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:parent/targetProjects');
$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}}/v1alpha1/:parent/targetProjects' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/targetProjects' -Method POST -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("POST", "/baseUrl/v1alpha1/:parent/targetProjects", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/targetProjects"
payload = {
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/targetProjects"
payload <- "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:parent/targetProjects")
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 \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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/v1alpha1/:parent/targetProjects') do |req|
req.body = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}"
end
puts response.status
puts response.body
use serde_json::json;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/targetProjects";
let payload = json!({
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
});
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}}/v1alpha1/:parent/targetProjects \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}'
echo '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}' | \
http POST {{baseUrl}}/v1alpha1/:parent/targetProjects \
content-type:application/json
wget --quiet \
--method POST \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "description": "",\n "name": "",\n "project": "",\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/targetProjects
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/targetProjects")! 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
vmmigration.projects.locations.targetProjects.delete
{{baseUrl}}/v1alpha1/:name
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/delete "{{baseUrl}}/v1alpha1/:name")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:name"
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}}/v1alpha1/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:name");
var request = new RestRequest("", Method.Delete);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:name"
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/v1alpha1/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("DELETE", "{{baseUrl}}/v1alpha1/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:name"))
.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}}/v1alpha1/:name")
.delete(null)
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.delete("{{baseUrl}}/v1alpha1/:name")
.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}}/v1alpha1/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'DELETE', url: '{{baseUrl}}/v1alpha1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:name';
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}}/v1alpha1/:name',
method: 'DELETE',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name")
.delete(null)
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'DELETE',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:name',
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}}/v1alpha1/:name'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('DELETE', '{{baseUrl}}/v1alpha1/:name');
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}}/v1alpha1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:name';
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}}/v1alpha1/:name"]
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}}/v1alpha1/:name" in
Client.call `DELETE uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:name",
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}}/v1alpha1/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:name');
$request->setMethod(HTTP_METH_DELETE);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:name');
$request->setRequestMethod('DELETE');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:name' -Method DELETE
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:name' -Method DELETE
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("DELETE", "/baseUrl/v1alpha1/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:name"
response = requests.delete(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:name"
response <- VERB("DELETE", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:name")
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/v1alpha1/:name') do |req|
end
puts response.status
puts response.body
use std::str::FromStr;
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:name";
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}}/v1alpha1/:name
http DELETE {{baseUrl}}/v1alpha1/:name
wget --quiet \
--method DELETE \
--output-document \
- {{baseUrl}}/v1alpha1/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:name")! 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
vmmigration.projects.locations.targetProjects.get
{{baseUrl}}/v1alpha1/:name
QUERY PARAMS
name
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:name");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:name")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:name"
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}}/v1alpha1/:name"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:name");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:name"
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/v1alpha1/:name HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:name")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:name"))
.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}}/v1alpha1/:name")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:name")
.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}}/v1alpha1/:name');
xhr.send(data);
import axios from 'axios';
const options = {method: 'GET', url: '{{baseUrl}}/v1alpha1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:name';
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}}/v1alpha1/:name',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:name',
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}}/v1alpha1/:name'};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:name');
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}}/v1alpha1/:name'};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:name';
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}}/v1alpha1/:name"]
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}}/v1alpha1/:name" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:name",
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}}/v1alpha1/:name');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:name');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:name');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:name' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:name' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:name")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:name"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:name"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:name")
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/v1alpha1/:name') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:name";
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}}/v1alpha1/:name
http GET {{baseUrl}}/v1alpha1/:name
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:name
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:name")! 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
vmmigration.projects.locations.targetProjects.list
{{baseUrl}}/v1alpha1/:parent/targetProjects
QUERY PARAMS
parent
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "GET");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:parent/targetProjects");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/get "{{baseUrl}}/v1alpha1/:parent/targetProjects")
require "http/client"
url = "{{baseUrl}}/v1alpha1/:parent/targetProjects"
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}}/v1alpha1/:parent/targetProjects"),
};
using (var response = await client.SendAsync(request))
{
response.EnsureSuccessStatusCode();
var body = await response.Content.ReadAsStringAsync();
Console.WriteLine(body);
}
var client = new RestClient("{{baseUrl}}/v1alpha1/:parent/targetProjects");
var request = new RestRequest("", Method.Get);
var response = client.Execute(request);
package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:parent/targetProjects"
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/v1alpha1/:parent/targetProjects HTTP/1.1
Host: example.com
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("GET", "{{baseUrl}}/v1alpha1/:parent/targetProjects")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:parent/targetProjects"))
.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}}/v1alpha1/:parent/targetProjects")
.get()
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.get("{{baseUrl}}/v1alpha1/:parent/targetProjects")
.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}}/v1alpha1/:parent/targetProjects');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'GET',
url: '{{baseUrl}}/v1alpha1/:parent/targetProjects'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:parent/targetProjects';
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}}/v1alpha1/:parent/targetProjects',
method: 'GET',
headers: {}
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:parent/targetProjects")
.get()
.build()
val response = client.newCall(request).execute()
const http = require('https');
const options = {
method: 'GET',
hostname: 'example.com',
port: null,
path: '/baseUrl/v1alpha1/:parent/targetProjects',
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}}/v1alpha1/:parent/targetProjects'
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
const unirest = require('unirest');
const req = unirest('GET', '{{baseUrl}}/v1alpha1/:parent/targetProjects');
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}}/v1alpha1/:parent/targetProjects'
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:parent/targetProjects';
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}}/v1alpha1/:parent/targetProjects"]
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}}/v1alpha1/:parent/targetProjects" in
Client.call `GET uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:parent/targetProjects",
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}}/v1alpha1/:parent/targetProjects');
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:parent/targetProjects');
$request->setMethod(HTTP_METH_GET);
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
setRequestUrl('{{baseUrl}}/v1alpha1/:parent/targetProjects');
$request->setRequestMethod('GET');
$client->enqueue($request)->send();
$response = $client->getResponse();
echo $response->getBody();
$response = Invoke-WebRequest -Uri '{{baseUrl}}/v1alpha1/:parent/targetProjects' -Method GET
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:parent/targetProjects' -Method GET
import http.client
conn = http.client.HTTPSConnection("example.com")
conn.request("GET", "/baseUrl/v1alpha1/:parent/targetProjects")
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:parent/targetProjects"
response = requests.get(url)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:parent/targetProjects"
response <- VERB("GET", url, content_type("application/octet-stream"))
content(response, "text")
require 'uri'
require 'net/http'
url = URI("{{baseUrl}}/v1alpha1/:parent/targetProjects")
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/v1alpha1/:parent/targetProjects') do |req|
end
puts response.status
puts response.body
use reqwest;
#[tokio::main]
pub async fn main() {
let url = "{{baseUrl}}/v1alpha1/:parent/targetProjects";
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}}/v1alpha1/:parent/targetProjects
http GET {{baseUrl}}/v1alpha1/:parent/targetProjects
wget --quiet \
--method GET \
--output-document \
- {{baseUrl}}/v1alpha1/:parent/targetProjects
import Foundation
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:parent/targetProjects")! 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
vmmigration.projects.locations.targetProjects.patch
{{baseUrl}}/v1alpha1/:name
QUERY PARAMS
name
BODY json
{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}
Examples
REQUEST
CURL *hnd = curl_easy_init();
curl_easy_setopt(hnd, CURLOPT_CUSTOMREQUEST, "PATCH");
curl_easy_setopt(hnd, CURLOPT_URL, "{{baseUrl}}/v1alpha1/:name");
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 \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}");
CURLcode ret = curl_easy_perform(hnd);
(require '[clj-http.client :as client])
(client/patch "{{baseUrl}}/v1alpha1/:name" {:content-type :json
:form-params {:createTime ""
:description ""
:name ""
:project ""
:updateTime ""}})
require "http/client"
url = "{{baseUrl}}/v1alpha1/:name"
headers = HTTP::Headers{
"content-type" => "application/json"
}
reqBody = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:name"),
Content = new StringContent("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:name");
var request = new RestRequest("", Method.Patch);
request.AddHeader("content-type", "application/json");
request.AddParameter("application/json", "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}", ParameterType.RequestBody);
var response = client.Execute(request);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{baseUrl}}/v1alpha1/:name"
payload := strings.NewReader("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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/v1alpha1/:name HTTP/1.1
Content-Type: application/json
Host: example.com
Content-Length: 94
{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}
AsyncHttpClient client = new DefaultAsyncHttpClient();
client.prepare("PATCH", "{{baseUrl}}/v1alpha1/:name")
.setHeader("content-type", "application/json")
.setBody("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}")
.execute()
.toCompletableFuture()
.thenAccept(System.out::println)
.join();
client.close();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("{{baseUrl}}/v1alpha1/:name"))
.header("content-type", "application/json")
.method("PATCH", HttpRequest.BodyPublishers.ofString("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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 \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}");
Request request = new Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name")
.patch(body)
.addHeader("content-type", "application/json")
.build();
Response response = client.newCall(request).execute();
HttpResponse response = Unirest.patch("{{baseUrl}}/v1alpha1/:name")
.header("content-type", "application/json")
.body("{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}")
.asString();
const data = JSON.stringify({
createTime: '',
description: '',
name: '',
project: '',
updateTime: ''
});
const xhr = new XMLHttpRequest();
xhr.withCredentials = true;
xhr.addEventListener('readystatechange', function () {
if (this.readyState === this.DONE) {
console.log(this.responseText);
}
});
xhr.open('PATCH', '{{baseUrl}}/v1alpha1/:name');
xhr.setRequestHeader('content-type', 'application/json');
xhr.send(data);
import axios from 'axios';
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1alpha1/:name',
headers: {'content-type': 'application/json'},
data: {createTime: '', description: '', name: '', project: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const url = '{{baseUrl}}/v1alpha1/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","description":"","name":"","project":"","updateTime":""}'
};
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}}/v1alpha1/:name',
method: 'PATCH',
headers: {
'content-type': 'application/json'
},
processData: false,
data: '{\n "createTime": "",\n "description": "",\n "name": "",\n "project": "",\n "updateTime": ""\n}'
};
$.ajax(settings).done(function (response) {
console.log(response);
});
val client = OkHttpClient()
val mediaType = MediaType.parse("application/json")
val body = RequestBody.create(mediaType, "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}")
val request = Request.Builder()
.url("{{baseUrl}}/v1alpha1/:name")
.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/v1alpha1/:name',
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({createTime: '', description: '', name: '', project: '', updateTime: ''}));
req.end();
const request = require('request');
const options = {
method: 'PATCH',
url: '{{baseUrl}}/v1alpha1/:name',
headers: {'content-type': 'application/json'},
body: {createTime: '', description: '', name: '', project: '', updateTime: ''},
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}}/v1alpha1/:name');
req.headers({
'content-type': 'application/json'
});
req.type('json');
req.send({
createTime: '',
description: '',
name: '',
project: '',
updateTime: ''
});
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}}/v1alpha1/:name',
headers: {'content-type': 'application/json'},
data: {createTime: '', description: '', name: '', project: '', updateTime: ''}
};
try {
const { data } = await axios.request(options);
console.log(data);
} catch (error) {
console.error(error);
}
const fetch = require('node-fetch');
const url = '{{baseUrl}}/v1alpha1/:name';
const options = {
method: 'PATCH',
headers: {'content-type': 'application/json'},
body: '{"createTime":"","description":"","name":"","project":"","updateTime":""}'
};
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 = @{ @"createTime": @"",
@"description": @"",
@"name": @"",
@"project": @"",
@"updateTime": @"" };
NSData *postData = [NSJSONSerialization dataWithJSONObject:parameters options:0 error:nil];
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:@"{{baseUrl}}/v1alpha1/:name"]
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}}/v1alpha1/:name" in
let headers = Header.add (Header.init ()) "content-type" "application/json" in
let body = Cohttp_lwt_body.of_string "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}" in
Client.call ~headers ~body `PATCH uri
>>= fun (res, body_stream) ->
(* Do stuff with the result *)
"{{baseUrl}}/v1alpha1/:name",
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([
'createTime' => '',
'description' => '',
'name' => '',
'project' => '',
'updateTime' => ''
]),
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}}/v1alpha1/:name', [
'body' => '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}',
'headers' => [
'content-type' => 'application/json',
],
]);
echo $response->getBody();
setUrl('{{baseUrl}}/v1alpha1/:name');
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
$request->setHeaders([
'content-type' => 'application/json'
]);
$request->setContentType('application/json');
$request->setBody(json_encode([
'createTime' => '',
'description' => '',
'name' => '',
'project' => '',
'updateTime' => ''
]));
try {
$response = $request->send();
echo $response->getBody();
} catch (HttpException $ex) {
echo $ex;
}
append(json_encode([
'createTime' => '',
'description' => '',
'name' => '',
'project' => '',
'updateTime' => ''
]));
$request->setRequestUrl('{{baseUrl}}/v1alpha1/:name');
$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}}/v1alpha1/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}'
$headers=@{}
$headers.Add("content-type", "application/json")
$response = Invoke-RestMethod -Uri '{{baseUrl}}/v1alpha1/:name' -Method PATCH -Headers $headers -ContentType 'application/json' -Body '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}'
import http.client
conn = http.client.HTTPSConnection("example.com")
payload = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\n}"
headers = { 'content-type': "application/json" }
conn.request("PATCH", "/baseUrl/v1alpha1/:name", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
import requests
url = "{{baseUrl}}/v1alpha1/:name"
payload = {
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}
headers = {"content-type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.json())
library(httr)
url <- "{{baseUrl}}/v1alpha1/:name"
payload <- "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:name")
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 \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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/v1alpha1/:name') do |req|
req.body = "{\n \"createTime\": \"\",\n \"description\": \"\",\n \"name\": \"\",\n \"project\": \"\",\n \"updateTime\": \"\"\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}}/v1alpha1/:name";
let payload = json!({
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
});
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}}/v1alpha1/:name \
--header 'content-type: application/json' \
--data '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}'
echo '{
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
}' | \
http PATCH {{baseUrl}}/v1alpha1/:name \
content-type:application/json
wget --quiet \
--method PATCH \
--header 'content-type: application/json' \
--body-data '{\n "createTime": "",\n "description": "",\n "name": "",\n "project": "",\n "updateTime": ""\n}' \
--output-document \
- {{baseUrl}}/v1alpha1/:name
import Foundation
let headers = ["content-type": "application/json"]
let parameters = [
"createTime": "",
"description": "",
"name": "",
"project": "",
"updateTime": ""
] as [String : Any]
let postData = JSONSerialization.data(withJSONObject: parameters, options: [])
let request = NSMutableURLRequest(url: NSURL(string: "{{baseUrl}}/v1alpha1/:name")! 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()