Get VPC peering details
curl --request GET \
--url https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "px3dngttwvje2kmr2sn8x12x4r",
"local_cidr": "<string>",
"location": "<string>",
"peer_account_id": "<string>",
"peer_cidrs": [
"<string>"
],
"peer_vpc_id": "<string>",
"private_subnet_id": "<string>",
"state": "<string>",
"state_message": "<string>",
"aws": {
"expires_at": "2023-11-07T05:31:56Z",
"peer_region": "<string>",
"peering_connection_id": "<string>",
"requester_account_id": "<string>",
"requester_vpc_id": "<string>"
},
"gcp": {
"local_network_name": "<string>",
"local_project_id": "<string>",
"peering_name": "<string>"
}
}{
"error": {
"code": 401,
"message": "There was an error logging in",
"type": "InvalidCredentials",
"details": {}
}
}VPC Peering
Get VPC peering details
GET
/
project
/
{project_id}
/
location
/
{location}
/
private-subnet
/
{private_subnet_reference}
/
vpc-peering
/
{vpc_peering_id}
Get VPC peering details
curl --request GET \
--url https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ubicloud.com/project/{project_id}/location/{location}/private-subnet/{private_subnet_reference}/vpc-peering/{vpc_peering_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"created_at": "2023-11-07T05:31:56Z",
"id": "px3dngttwvje2kmr2sn8x12x4r",
"local_cidr": "<string>",
"location": "<string>",
"peer_account_id": "<string>",
"peer_cidrs": [
"<string>"
],
"peer_vpc_id": "<string>",
"private_subnet_id": "<string>",
"state": "<string>",
"state_message": "<string>",
"aws": {
"expires_at": "2023-11-07T05:31:56Z",
"peer_region": "<string>",
"peering_connection_id": "<string>",
"requester_account_id": "<string>",
"requester_vpc_id": "<string>"
},
"gcp": {
"local_network_name": "<string>",
"local_project_id": "<string>",
"peering_name": "<string>"
}
}{
"error": {
"code": 401,
"message": "There was an error logging in",
"type": "InvalidCredentials",
"details": {}
}
}Authorizations
Path Parameters
Response
A VPC peering