curl --request PATCH \
--url https://api.coreweave.com/v1beta1/networking/vpcs/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"updateMask": "<string>",
"vpcPrefixes": [
{
"name": "<string>",
"value": "<string>"
}
],
"ingress": {
"disablePublicServices": true
},
"egress": {
"disablePublicAccess": true
},
"dhcp": {
"dns": {
"servers": [
"<string>"
]
}
}
}
'import requests
url = "https://api.coreweave.com/v1beta1/networking/vpcs/{id}"
payload = {
"id": "<string>",
"updateMask": "<string>",
"vpcPrefixes": [
{
"name": "<string>",
"value": "<string>"
}
],
"ingress": { "disablePublicServices": True },
"egress": { "disablePublicAccess": True },
"dhcp": { "dns": { "servers": ["<string>"] } }
}
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({
id: '<string>',
updateMask: '<string>',
vpcPrefixes: [{name: '<string>', value: '<string>'}],
ingress: {disablePublicServices: true},
egress: {disablePublicAccess: true},
dhcp: {dns: {servers: ['<string>']}}
})
};
fetch('https://api.coreweave.com/v1beta1/networking/vpcs/{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.coreweave.com/v1beta1/networking/vpcs/{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([
'id' => '<string>',
'updateMask' => '<string>',
'vpcPrefixes' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'ingress' => [
'disablePublicServices' => true
],
'egress' => [
'disablePublicAccess' => true
],
'dhcp' => [
'dns' => [
'servers' => [
'<string>'
]
]
]
]),
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://api.coreweave.com/v1beta1/networking/vpcs/{id}"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"updateMask\": \"<string>\",\n \"vpcPrefixes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"ingress\": {\n \"disablePublicServices\": true\n },\n \"egress\": {\n \"disablePublicAccess\": true\n },\n \"dhcp\": {\n \"dns\": {\n \"servers\": [\n \"<string>\"\n ]\n }\n }\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://api.coreweave.com/v1beta1/networking/vpcs/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"updateMask\": \"<string>\",\n \"vpcPrefixes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"ingress\": {\n \"disablePublicServices\": true\n },\n \"egress\": {\n \"disablePublicAccess\": true\n },\n \"dhcp\": {\n \"dns\": {\n \"servers\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coreweave.com/v1beta1/networking/vpcs/{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 \"id\": \"<string>\",\n \"updateMask\": \"<string>\",\n \"vpcPrefixes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"ingress\": {\n \"disablePublicServices\": true\n },\n \"egress\": {\n \"disablePublicAccess\": true\n },\n \"dhcp\": {\n \"dns\": {\n \"servers\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"vpc": {
"name": "<string>",
"zone": "<string>",
"id": "<string>",
"status": "STATUS_UNSPECIFIED",
"vpcPrefixes": [
{
"name": "<string>",
"value": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"status": "STATUS_UNSPECIFIED"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hostPrefix": "<string>",
"hostPrefixes": [
{
"name": "<string>",
"type": "UNSPECIFIED",
"prefixes": [
"<string>"
],
"ipam": {
"prefixLength": 123,
"gatewayAddressPolicy": "UNSPECIFIED"
}
}
],
"ingress": {
"disablePublicServices": true
},
"egress": {
"disablePublicAccess": true
},
"dhcp": {
"dns": {
"servers": [
"<string>"
]
}
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Update VPC
Update selected fields on a CoreWeave VPC using a field mask.
curl --request PATCH \
--url https://api.coreweave.com/v1beta1/networking/vpcs/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"id": "<string>",
"updateMask": "<string>",
"vpcPrefixes": [
{
"name": "<string>",
"value": "<string>"
}
],
"ingress": {
"disablePublicServices": true
},
"egress": {
"disablePublicAccess": true
},
"dhcp": {
"dns": {
"servers": [
"<string>"
]
}
}
}
'import requests
url = "https://api.coreweave.com/v1beta1/networking/vpcs/{id}"
payload = {
"id": "<string>",
"updateMask": "<string>",
"vpcPrefixes": [
{
"name": "<string>",
"value": "<string>"
}
],
"ingress": { "disablePublicServices": True },
"egress": { "disablePublicAccess": True },
"dhcp": { "dns": { "servers": ["<string>"] } }
}
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({
id: '<string>',
updateMask: '<string>',
vpcPrefixes: [{name: '<string>', value: '<string>'}],
ingress: {disablePublicServices: true},
egress: {disablePublicAccess: true},
dhcp: {dns: {servers: ['<string>']}}
})
};
fetch('https://api.coreweave.com/v1beta1/networking/vpcs/{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.coreweave.com/v1beta1/networking/vpcs/{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([
'id' => '<string>',
'updateMask' => '<string>',
'vpcPrefixes' => [
[
'name' => '<string>',
'value' => '<string>'
]
],
'ingress' => [
'disablePublicServices' => true
],
'egress' => [
'disablePublicAccess' => true
],
'dhcp' => [
'dns' => [
'servers' => [
'<string>'
]
]
]
]),
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://api.coreweave.com/v1beta1/networking/vpcs/{id}"
payload := strings.NewReader("{\n \"id\": \"<string>\",\n \"updateMask\": \"<string>\",\n \"vpcPrefixes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"ingress\": {\n \"disablePublicServices\": true\n },\n \"egress\": {\n \"disablePublicAccess\": true\n },\n \"dhcp\": {\n \"dns\": {\n \"servers\": [\n \"<string>\"\n ]\n }\n }\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://api.coreweave.com/v1beta1/networking/vpcs/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"id\": \"<string>\",\n \"updateMask\": \"<string>\",\n \"vpcPrefixes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"ingress\": {\n \"disablePublicServices\": true\n },\n \"egress\": {\n \"disablePublicAccess\": true\n },\n \"dhcp\": {\n \"dns\": {\n \"servers\": [\n \"<string>\"\n ]\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.coreweave.com/v1beta1/networking/vpcs/{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 \"id\": \"<string>\",\n \"updateMask\": \"<string>\",\n \"vpcPrefixes\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\"\n }\n ],\n \"ingress\": {\n \"disablePublicServices\": true\n },\n \"egress\": {\n \"disablePublicAccess\": true\n },\n \"dhcp\": {\n \"dns\": {\n \"servers\": [\n \"<string>\"\n ]\n }\n }\n}"
response = http.request(request)
puts response.read_body{
"vpc": {
"name": "<string>",
"zone": "<string>",
"id": "<string>",
"status": "STATUS_UNSPECIFIED",
"vpcPrefixes": [
{
"name": "<string>",
"value": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"status": "STATUS_UNSPECIFIED"
}
],
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"hostPrefix": "<string>",
"hostPrefixes": [
{
"name": "<string>",
"type": "UNSPECIFIED",
"prefixes": [
"<string>"
],
"ipam": {
"prefixLength": 123,
"gatewayAddressPolicy": "UNSPECIFIED"
}
}
],
"ingress": {
"disablePublicServices": true
},
"egress": {
"disablePublicAccess": true
},
"dhcp": {
"dns": {
"servers": [
"<string>"
]
}
}
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}- The API server is
https://api.coreweave.com. - Replace
{API_ACCESS_TOKEN}with your CoreWeave API access token. - For required permissions, see IAM Access Policies.
updateMask
field, to specify which fields to modify. When updateMask is
omitted, all fields in the request body are updated. For more
information on field masks, see the
Google AIP-157 guidance.
The valid updateMask field paths are:
vpcPrefixesingress.disablePublicServicesegress.disablePublicAccessdhcp.dns.servers
ingress
or dhcp, is invalid; the server silently ignores the
request and makes no changes.
curl -X PATCH https://api.coreweave.com/v1beta1/networking/vpcs/{id} \
-H "Content-Type: application/json" \
-H "Authorization: Bearer {API_ACCESS_TOKEN}" \
-d @data.json
Autorisations
CoreWeave API access token sent as a bearer token.
Paramètres de chemin
The unique identifier for the VPC.
Corps
The unique identifier for the VPC.
A field mask specifying which fields to update. Valid paths are vpcPrefixes, ingress.disablePublicServices, egress.disablePublicAccess, and dhcp.dns.servers. Any other path (including top-level paths like ingress or dhcp) is silently ignored. When omitted, all fields in the request body are updated. See Google AIP-157.
An array of additional prefixes associated with the VPC. Must be given in CIDR notation.
Show child attributes
Show child attributes
The ingress configuration of the VPC.
Show child attributes
Show child attributes
The egress configuration of the VPC.
Show child attributes
Show child attributes
The DHCP configuration of the VPC.
Show child attributes
Show child attributes
Réponse
OK
The VPC.
Show child attributes
Show child attributes
Cette page vous a-t-elle été utile ?