Update a secret
curl --request PATCH \
--url https://api.gcore.com/fastedge/v1/secrets/{secret_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"comment": "<string>",
"secret_slots": [
{
"slot": 1704067200,
"value": "P@ssw0rd123!"
}
]
}
'import requests
url = "https://api.gcore.com/fastedge/v1/secrets/{secret_id}"
payload = {
"name": "<string>",
"comment": "<string>",
"secret_slots": [
{
"slot": 1704067200,
"value": "P@ssw0rd123!"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
comment: '<string>',
secret_slots: [{slot: 1704067200, value: 'P@ssw0rd123!'}]
})
};
fetch('https://api.gcore.com/fastedge/v1/secrets/{secret_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.gcore.com/fastedge/v1/secrets/{secret_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([
'name' => '<string>',
'comment' => '<string>',
'secret_slots' => [
[
'slot' => 1704067200,
'value' => 'P@ssw0rd123!'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.gcore.com/fastedge/v1/secrets/{secret_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\",\n \"secret_slots\": [\n {\n \"slot\": 1704067200,\n \"value\": \"P@ssw0rd123!\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.gcore.com/fastedge/v1/secrets/{secret_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\",\n \"secret_slots\": [\n {\n \"slot\": 1704067200,\n \"value\": \"P@ssw0rd123!\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/fastedge/v1/secrets/{secret_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"comment\": \"<string>\",\n \"secret_slots\": [\n {\n \"slot\": 1704067200,\n \"value\": \"P@ssw0rd123!\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"comment": "<string>",
"app_count": 123,
"secret_slots": [
{
"slot": 1704067200,
"checksum": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
}
]
}{
"error": "<string>"
}{
"error": "<string>",
"conflicting_ids": [
123
]
}{
"error": "<string>"
}Secrets
Update a secret
Partially updates secret metadata and/or modifies specific slots
PATCH
/
fastedge
/
v1
/
secrets
/
{secret_id}
Update a secret
curl --request PATCH \
--url https://api.gcore.com/fastedge/v1/secrets/{secret_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"comment": "<string>",
"secret_slots": [
{
"slot": 1704067200,
"value": "P@ssw0rd123!"
}
]
}
'import requests
url = "https://api.gcore.com/fastedge/v1/secrets/{secret_id}"
payload = {
"name": "<string>",
"comment": "<string>",
"secret_slots": [
{
"slot": 1704067200,
"value": "P@ssw0rd123!"
}
]
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
comment: '<string>',
secret_slots: [{slot: 1704067200, value: 'P@ssw0rd123!'}]
})
};
fetch('https://api.gcore.com/fastedge/v1/secrets/{secret_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.gcore.com/fastedge/v1/secrets/{secret_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([
'name' => '<string>',
'comment' => '<string>',
'secret_slots' => [
[
'slot' => 1704067200,
'value' => 'P@ssw0rd123!'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>",
"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.gcore.com/fastedge/v1/secrets/{secret_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\",\n \"secret_slots\": [\n {\n \"slot\": 1704067200,\n \"value\": \"P@ssw0rd123!\"\n }\n ]\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Authorization", "<api-key>")
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.gcore.com/fastedge/v1/secrets/{secret_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"comment\": \"<string>\",\n \"secret_slots\": [\n {\n \"slot\": 1704067200,\n \"value\": \"P@ssw0rd123!\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/fastedge/v1/secrets/{secret_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"comment\": \"<string>\",\n \"secret_slots\": [\n {\n \"slot\": 1704067200,\n \"value\": \"P@ssw0rd123!\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"name": "<string>",
"comment": "<string>",
"app_count": 123,
"secret_slots": [
{
"slot": 1704067200,
"checksum": "5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8"
}
]
}{
"error": "<string>"
}{
"error": "<string>",
"conflicting_ids": [
123
]
}{
"error": "<string>"
}Authorizations
API key for authentication. Make sure to include the word apikey, followed by a single space and then your token.
Example: apikey 1234$abcdef
Path Parameters
Unique identifier of the secret to update
Body
application/json
Secret details
Response
Secret updated successfully, returns updated configuration
The unique name of the secret.
Required string length:
1 - 128Pattern:
^[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]$A description or comment about the secret.
Maximum string length:
1024The number of applications that use this secret.
A list of secret slots associated with this secret.
Show child attributes
Show child attributes
Was this page helpful?
⌘I