Update volume
curl --request PATCH \
--url https://api.cwsandbox.com/v1/volumes/{volumeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"readOnly": true,
"description": "<string>"
},
"volumeId": "<string>"
}
'import requests
url = "https://api.cwsandbox.com/v1/volumes/{volumeId}"
payload = {
"spec": {
"readOnly": True,
"description": "<string>"
},
"volumeId": "<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({spec: {readOnly: true, description: '<string>'}, volumeId: '<string>'})
};
fetch('https://api.cwsandbox.com/v1/volumes/{volumeId}', 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.cwsandbox.com/v1/volumes/{volumeId}",
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([
'spec' => [
'readOnly' => true,
'description' => '<string>'
],
'volumeId' => '<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.cwsandbox.com/v1/volumes/{volumeId}"
payload := strings.NewReader("{\n \"spec\": {\n \"readOnly\": true,\n \"description\": \"<string>\"\n },\n \"volumeId\": \"<string>\"\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.cwsandbox.com/v1/volumes/{volumeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {\n \"readOnly\": true,\n \"description\": \"<string>\"\n },\n \"volumeId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cwsandbox.com/v1/volumes/{volumeId}")
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 \"spec\": {\n \"readOnly\": true,\n \"description\": \"<string>\"\n },\n \"volumeId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"spec": {
"pvc": {
"runnerId": "<string>",
"namespace": "<string>",
"claimName": "<string>",
"subPath": "<string>"
},
"readOnly": true,
"description": "<string>"
},
"volumeId": "<string>",
"status": {
"state": "VOLUME_STATE_UNSPECIFIED",
"stateReason": "<string>",
"locality": "VOLUME_LOCALITY_UNSPECIFIED",
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"lastValidatedTime": "2023-11-07T05:31:56Z",
"accessModes": [
"<string>"
],
"capacity": "<string>",
"attachedSandboxCount": 123
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Update volume
Patch a volume’s mutable fields. In practice, only the description is updatable.
PATCH
/
v1
/
volumes
/
{volumeId}
Update volume
curl --request PATCH \
--url https://api.cwsandbox.com/v1/volumes/{volumeId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"spec": {
"readOnly": true,
"description": "<string>"
},
"volumeId": "<string>"
}
'import requests
url = "https://api.cwsandbox.com/v1/volumes/{volumeId}"
payload = {
"spec": {
"readOnly": True,
"description": "<string>"
},
"volumeId": "<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({spec: {readOnly: true, description: '<string>'}, volumeId: '<string>'})
};
fetch('https://api.cwsandbox.com/v1/volumes/{volumeId}', 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.cwsandbox.com/v1/volumes/{volumeId}",
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([
'spec' => [
'readOnly' => true,
'description' => '<string>'
],
'volumeId' => '<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.cwsandbox.com/v1/volumes/{volumeId}"
payload := strings.NewReader("{\n \"spec\": {\n \"readOnly\": true,\n \"description\": \"<string>\"\n },\n \"volumeId\": \"<string>\"\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.cwsandbox.com/v1/volumes/{volumeId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"spec\": {\n \"readOnly\": true,\n \"description\": \"<string>\"\n },\n \"volumeId\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.cwsandbox.com/v1/volumes/{volumeId}")
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 \"spec\": {\n \"readOnly\": true,\n \"description\": \"<string>\"\n },\n \"volumeId\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"spec": {
"pvc": {
"runnerId": "<string>",
"namespace": "<string>",
"claimName": "<string>",
"subPath": "<string>"
},
"readOnly": true,
"description": "<string>"
},
"volumeId": "<string>",
"status": {
"state": "VOLUME_STATE_UNSPECIFIED",
"stateReason": "<string>",
"locality": "VOLUME_LOCALITY_UNSPECIFIED",
"createTime": "2023-11-07T05:31:56Z",
"updateTime": "2023-11-07T05:31:56Z",
"lastValidatedTime": "2023-11-07T05:31:56Z",
"accessModes": [
"<string>"
],
"capacity": "<string>",
"attachedSandboxCount": 123
}
}{
"code": 123,
"message": "<string>",
"details": [
{
"@type": "<string>"
}
]
}Authorizations
CoreWeave API access token sent as a bearer token.
Path Parameters
Query Parameters
Comma-separated JSON paths to update. Only spec.description is mutable. An omitted or empty mask selects full replacement and requires immutable fields to be resent unchanged. The wildcard * is supported only over binary protobuf (gRPC or Connect protobuf), not JSON Connect or the REST updateMask query value.
Body
application/json
Was this page helpful?