curl --request PATCH \
--url https://network.{region}.basaltic.sh/v1/subnets/{subnet_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Public web-tier subnet",
"route_table": "a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f",
"tags": {},
"allocate_cidr_ipv6": false,
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"copy_ipv4_security_rules": true,
"ipv6_routing": "match_ipv4"
}
'import requests
url = "https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}"
payload = {
"description": "Public web-tier subnet",
"route_table": "a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f",
"tags": {},
"allocate_cidr_ipv6": False,
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"copy_ipv4_security_rules": True,
"ipv6_routing": "match_ipv4"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Public web-tier subnet',
route_table: 'a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f',
tags: {},
allocate_cidr_ipv6: false,
cidr_ipv6: '2a13:9500:1a6:100::/64',
copy_ipv4_security_rules: true,
ipv6_routing: 'match_ipv4'
})
};
fetch('https://network.{region}.basaltic.sh/v1/subnets/{subnet_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://network.{region}.basaltic.sh/v1/subnets/{subnet_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Public web-tier subnet',
'route_table' => 'a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f',
'tags' => [
],
'allocate_cidr_ipv6' => false,
'cidr_ipv6' => '2a13:9500:1a6:100::/64',
'copy_ipv4_security_rules' => true,
'ipv6_routing' => 'match_ipv4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}"
payload := strings.NewReader("{\n \"description\": \"Public web-tier subnet\",\n \"route_table\": \"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f\",\n \"tags\": {},\n \"allocate_cidr_ipv6\": false,\n \"cidr_ipv6\": \"2a13:9500:1a6:100::/64\",\n \"copy_ipv4_security_rules\": true,\n \"ipv6_routing\": \"match_ipv4\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Public web-tier subnet\",\n \"route_table\": \"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f\",\n \"tags\": {},\n \"allocate_cidr_ipv6\": false,\n \"cidr_ipv6\": \"2a13:9500:1a6:100::/64\",\n \"copy_ipv4_security_rules\": true,\n \"ipv6_routing\": \"match_ipv4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Public web-tier subnet\",\n \"route_table\": \"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f\",\n \"tags\": {},\n \"allocate_cidr_ipv6\": false,\n \"cidr_ipv6\": \"2a13:9500:1a6:100::/64\",\n \"copy_ipv4_security_rules\": true,\n \"ipv6_routing\": \"match_ipv4\"\n}"
response = http.request(request)
puts response.read_body{
"subnet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/prod-web",
"vpc": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod",
"name": "prod",
"cidr_ipv4": "10.0.0.0/16",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Production VPC for web and app tiers",
"cidr_ipv6": "2a13:9500:1a6:100::/60"
},
"route_table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/route-table/prod-private-rt",
"name": "prod-private-rt"
},
"name": "prod-web",
"cidr_ipv4": "10.0.1.0/24",
"gateway_ipv4": "10.0.1.1",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Public web-tier subnet",
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"gateway_ipv6": "2a13:9500:1a6:100::1"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "ACCESS_DENIED",
"message": "You don't have permission to perform this action",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Atualizar a sub-rede
Atualize campos mutáveis (descrição, tags). O CIDR é imutável.
curl --request PATCH \
--url https://network.{region}.basaltic.sh/v1/subnets/{subnet_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"description": "Public web-tier subnet",
"route_table": "a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f",
"tags": {},
"allocate_cidr_ipv6": false,
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"copy_ipv4_security_rules": true,
"ipv6_routing": "match_ipv4"
}
'import requests
url = "https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}"
payload = {
"description": "Public web-tier subnet",
"route_table": "a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f",
"tags": {},
"allocate_cidr_ipv6": False,
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"copy_ipv4_security_rules": True,
"ipv6_routing": "match_ipv4"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
description: 'Public web-tier subnet',
route_table: 'a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f',
tags: {},
allocate_cidr_ipv6: false,
cidr_ipv6: '2a13:9500:1a6:100::/64',
copy_ipv4_security_rules: true,
ipv6_routing: 'match_ipv4'
})
};
fetch('https://network.{region}.basaltic.sh/v1/subnets/{subnet_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://network.{region}.basaltic.sh/v1/subnets/{subnet_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'description' => 'Public web-tier subnet',
'route_table' => 'a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f',
'tags' => [
],
'allocate_cidr_ipv6' => false,
'cidr_ipv6' => '2a13:9500:1a6:100::/64',
'copy_ipv4_security_rules' => true,
'ipv6_routing' => 'match_ipv4'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}"
payload := strings.NewReader("{\n \"description\": \"Public web-tier subnet\",\n \"route_table\": \"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f\",\n \"tags\": {},\n \"allocate_cidr_ipv6\": false,\n \"cidr_ipv6\": \"2a13:9500:1a6:100::/64\",\n \"copy_ipv4_security_rules\": true,\n \"ipv6_routing\": \"match_ipv4\"\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.patch("https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"description\": \"Public web-tier subnet\",\n \"route_table\": \"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f\",\n \"tags\": {},\n \"allocate_cidr_ipv6\": false,\n \"cidr_ipv6\": \"2a13:9500:1a6:100::/64\",\n \"copy_ipv4_security_rules\": true,\n \"ipv6_routing\": \"match_ipv4\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://network.{region}.basaltic.sh/v1/subnets/{subnet_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"description\": \"Public web-tier subnet\",\n \"route_table\": \"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f\",\n \"tags\": {},\n \"allocate_cidr_ipv6\": false,\n \"cidr_ipv6\": \"2a13:9500:1a6:100::/64\",\n \"copy_ipv4_security_rules\": true,\n \"ipv6_routing\": \"match_ipv4\"\n}"
response = http.request(request)
puts response.read_body{
"subnet": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/subnet/prod-web",
"vpc": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod",
"name": "prod",
"cidr_ipv4": "10.0.0.0/16",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Production VPC for web and app tiers",
"cidr_ipv6": "2a13:9500:1a6:100::/60"
},
"route_table": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"crn": "crn:network:sa-saopaulo-1:my-account:vpc/prod/route-table/prod-private-rt",
"name": "prod-private-rt"
},
"name": "prod-web",
"cidr_ipv4": "10.0.1.0/24",
"gateway_ipv4": "10.0.1.1",
"tags": {},
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"description": "Public web-tier subnet",
"cidr_ipv6": "2a13:9500:1a6:100::/64",
"gateway_ipv6": "2a13:9500:1a6:100::1"
}
}{
"error": {
"code": "INVALID_INPUT",
"message": "Invalid request parameters",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "UNAUTHORIZED",
"message": "Authentication required",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "ACCESS_DENIED",
"message": "You don't have permission to perform this action",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "NOT_FOUND",
"message": "Resource not found",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}{
"error": {
"code": "INTERNAL_ERROR",
"message": "An internal error occurred",
"request_id": "550e8400-e29b-41d4-a716-446655440000"
}
}network:UpdateSubnet. Consulte permissões de redes para obter a lista completa, o que cada uma abrange e um exemplo de política.Autorizações
Um token bearer OAuth 2.0, enviado como Authorization: Bearer <token>. Esta é a forma recomendada de autenticação.
Obtenha o token trocando o par de chaves de acesso de uma conta de serviço em POST /v1/oauth/token com grant_type=client_credentials. Esse é o fluxo padrão de credenciais de cliente; bibliotecas compatíveis com OAuth podem obter e renovar o token para você.
curl -s -u "$KEY_ID:$SECRET" -d grant_type=client_credentials \
https://iam.basaltic.sh/v1/oauth/token
Os tokens duram uma hora por padrão. O mesmo par de chaves de acesso também serve como credencial AWS SigV4 para o endpoint de objetos compatível com S3, que aceita somente esse método de autenticação.
Parâmetros de caminho
ID da sub- rede
Corpo
"Public web-tier subnet"
UUID da tabela de rotas, CRN aninhado ou nome exato dentro da VPC de sub-rede. No PATCH, a sub-rede de caminho de propriedade fornece a VPC. Omissão em criar seleciona a tabela padrão; uma referência vazia é inválida.
"a3c9e1f4-7b2d-4a6e-8c1f-9d3b5e7a2c4f"
Show child attributes
Show child attributes
Aloque um /64 livre do intervalo IPv6 da VPC. Pode ser ativado após a criação. Cada interface existente e nova recebe um IPv6 /96 e seu primeiro /128 automaticamente. Os gateways NAT hospedados aqui também recebem um endereço IPv6 público do pool regional. A atualização de gateways hospedados requer a permissão UpdateNATGateway e a cota IPv6 pública.
Um /64 alinhado dentro do intervalo IPv6 da VPC. Pode ser adicionado mais tarde; não pode substituir um intervalo existente. Exclusivo mútuo com allocate_cidr_ipv6.
"2a13:9500:1a6:100::/64"
Ao habilitar o IPv6, copie regras equivalentes em grupos de segurança usados pelas interfaces dessa sub-rede. Copia 0.0.0.0/0 para ::/0 e referências de grupo de segurança, preservando protocolo, portas e direção. CIDRs IPv4 restritos não são alargados. Os equivalentes IPv6 existentes não são duplicados. As alterações afetam todas as interfaces que compartilham esses grupos. Requer permissão CreateSecurityGroupRule e cota de regra disponível. Só é aceito com allocate_cidr_ipv6 ou cidr_ipv6.
Ao habilitar o IPv6, adicione opcionalmente ::/0 à tabela de rotas da sub-rede. match_ipv4 segue uma rota padrão de gateway de internet IPv4 ou gateway NAT, usando o mesmo destino. Um gateway NAT já deve ter o IPv6 habilitado em sua sub-rede de hospedagem ou ser hospedado na sub-rede que está sendo habilitada. Nenhuma rota padrão IPv4 deixa o roteamento IPv6 inalterado. As rotas padrão IPv6 existentes são sempre preservadas. Os gateways somente de saída não podem fornecer acesso à Internet ULA; use um gateway NAT ou um IP flutuante IPv6 público com uma rota de gateway de Internet. As alterações afetam todas as sub-redes que compartilham a tabela de rotas e exigem a permissão CreateRoute; a criação de um gateway somente de saída também exige a permissão CreateEgressOnlyGateway. Só é aceito com allocate_cidr_ipv6 ou cidr_ipv6.
match_ipv4, unchanged, internet_gateway, nat_gateway, egress_only_gateway Resposta
Subnet atualizado
Show child attributes
Show child attributes

