Modify data in store
curl --request PUT \
--url https://api.gcore.com/fastedge/v1/kv/{store_id}/data \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"key": "<string>",
"payload": {
"value": "John Doe",
"encoding": "plain",
"expiry": "2024-12-31T23:59:59Z"
}
}
]
'import requests
url = "https://api.gcore.com/fastedge/v1/kv/{store_id}/data"
payload = [
{
"key": "<string>",
"payload": {
"value": "John Doe",
"encoding": "plain",
"expiry": "2024-12-31T23:59:59Z"
}
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
key: '<string>',
payload: {value: 'John Doe', encoding: 'plain', expiry: '2024-12-31T23:59:59Z'}
}
])
};
fetch('https://api.gcore.com/fastedge/v1/kv/{store_id}/data', 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/kv/{store_id}/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'key' => '<string>',
'payload' => [
'value' => 'John Doe',
'encoding' => 'plain',
'expiry' => '2024-12-31T23:59:59Z'
]
]
]),
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/kv/{store_id}/data"
payload := strings.NewReader("[\n {\n \"key\": \"<string>\",\n \"payload\": {\n \"value\": \"John Doe\",\n \"encoding\": \"plain\",\n \"expiry\": \"2024-12-31T23:59:59Z\"\n }\n }\n]")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/fastedge/v1/kv/{store_id}/data")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"key\": \"<string>\",\n \"payload\": {\n \"value\": \"John Doe\",\n \"encoding\": \"plain\",\n \"expiry\": \"2024-12-31T23:59:59Z\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/fastedge/v1/kv/{store_id}/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"key\": \"<string>\",\n \"payload\": {\n \"value\": \"John Doe\",\n \"encoding\": \"plain\",\n \"expiry\": \"2024-12-31T23:59:59Z\"\n }\n }\n]"
response = http.request(request)
puts response.read_body{
"del_count": 123,
"revision": 123,
"store_size": 123,
"write_count": 123,
"write_size": 123
}{
"error": "<string>"
}{
"error": "<string>"
}Edge Storage
Modify data in store
PUT
/
fastedge
/
v1
/
kv
/
{store_id}
/
data
Modify data in store
curl --request PUT \
--url https://api.gcore.com/fastedge/v1/kv/{store_id}/data \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
[
{
"key": "<string>",
"payload": {
"value": "John Doe",
"encoding": "plain",
"expiry": "2024-12-31T23:59:59Z"
}
}
]
'import requests
url = "https://api.gcore.com/fastedge/v1/kv/{store_id}/data"
payload = [
{
"key": "<string>",
"payload": {
"value": "John Doe",
"encoding": "plain",
"expiry": "2024-12-31T23:59:59Z"
}
}
]
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify([
{
key: '<string>',
payload: {value: 'John Doe', encoding: 'plain', expiry: '2024-12-31T23:59:59Z'}
}
])
};
fetch('https://api.gcore.com/fastedge/v1/kv/{store_id}/data', 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/kv/{store_id}/data",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
[
'key' => '<string>',
'payload' => [
'value' => 'John Doe',
'encoding' => 'plain',
'expiry' => '2024-12-31T23:59:59Z'
]
]
]),
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/kv/{store_id}/data"
payload := strings.NewReader("[\n {\n \"key\": \"<string>\",\n \"payload\": {\n \"value\": \"John Doe\",\n \"encoding\": \"plain\",\n \"expiry\": \"2024-12-31T23:59:59Z\"\n }\n }\n]")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/fastedge/v1/kv/{store_id}/data")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("[\n {\n \"key\": \"<string>\",\n \"payload\": {\n \"value\": \"John Doe\",\n \"encoding\": \"plain\",\n \"expiry\": \"2024-12-31T23:59:59Z\"\n }\n }\n]")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/fastedge/v1/kv/{store_id}/data")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "[\n {\n \"key\": \"<string>\",\n \"payload\": {\n \"value\": \"John Doe\",\n \"encoding\": \"plain\",\n \"expiry\": \"2024-12-31T23:59:59Z\"\n }\n }\n]"
response = http.request(request)
puts response.read_body{
"del_count": 123,
"revision": 123,
"store_size": 123,
"write_count": 123,
"write_size": 123
}{
"error": "<string>"
}{
"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
Id of the store
Query Parameters
Force data type change
Body
application/json
Key-value pair details
Key of the item
Required string length:
1 - 256Data type of the item
Available options:
kv, sorted_set, bloom_filter Data operation
Available options:
add, del_key, del_entries KV pair value
- Option 1 · object
- Option 2 · object[]
- Option 3 · object[]
Show child attributes
Show child attributes
Response
Store modifications applied successfully, returns operation statistics
Was this page helpful?
⌘I