Patch an app
curl --request PATCH \
--url https://api.gcore.com/fastedge/v1/admin/apps/{app_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-edge-app",
"binary": 12345,
"template": 123,
"status": 1,
"env": {
"var1": "value1",
"var2": "value2"
},
"rsp_headers": {
"header1": "value1",
"header2": "value2"
},
"debug": false,
"comment": "Production API gateway for customer portal",
"secrets": {},
"stores": {}
}
'import requests
url = "https://api.gcore.com/fastedge/v1/admin/apps/{app_id}"
payload = {
"name": "my-edge-app",
"binary": 12345,
"template": 123,
"status": 1,
"env": {
"var1": "value1",
"var2": "value2"
},
"rsp_headers": {
"header1": "value1",
"header2": "value2"
},
"debug": False,
"comment": "Production API gateway for customer portal",
"secrets": {},
"stores": {}
}
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: 'my-edge-app',
binary: 12345,
template: 123,
status: 1,
env: {var1: 'value1', var2: 'value2'},
rsp_headers: {header1: 'value1', header2: 'value2'},
debug: false,
comment: 'Production API gateway for customer portal',
secrets: {},
stores: {}
})
};
fetch('https://api.gcore.com/fastedge/v1/admin/apps/{app_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/admin/apps/{app_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' => 'my-edge-app',
'binary' => 12345,
'template' => 123,
'status' => 1,
'env' => [
'var1' => 'value1',
'var2' => 'value2'
],
'rsp_headers' => [
'header1' => 'value1',
'header2' => 'value2'
],
'debug' => false,
'comment' => 'Production API gateway for customer portal',
'secrets' => [
],
'stores' => [
]
]),
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/admin/apps/{app_id}"
payload := strings.NewReader("{\n \"name\": \"my-edge-app\",\n \"binary\": 12345,\n \"template\": 123,\n \"status\": 1,\n \"env\": {\n \"var1\": \"value1\",\n \"var2\": \"value2\"\n },\n \"rsp_headers\": {\n \"header1\": \"value1\",\n \"header2\": \"value2\"\n },\n \"debug\": false,\n \"comment\": \"Production API gateway for customer portal\",\n \"secrets\": {},\n \"stores\": {}\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/admin/apps/{app_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-edge-app\",\n \"binary\": 12345,\n \"template\": 123,\n \"status\": 1,\n \"env\": {\n \"var1\": \"value1\",\n \"var2\": \"value2\"\n },\n \"rsp_headers\": {\n \"header1\": \"value1\",\n \"header2\": \"value2\"\n },\n \"debug\": false,\n \"comment\": \"Production API gateway for customer portal\",\n \"secrets\": {},\n \"stores\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/fastedge/v1/admin/apps/{app_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\": \"my-edge-app\",\n \"binary\": 12345,\n \"template\": 123,\n \"status\": 1,\n \"env\": {\n \"var1\": \"value1\",\n \"var2\": \"value2\"\n },\n \"rsp_headers\": {\n \"header1\": \"value1\",\n \"header2\": \"value2\"\n },\n \"debug\": false,\n \"comment\": \"Production API gateway for customer portal\",\n \"secrets\": {},\n \"stores\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"name": "<string>",
"status": 123,
"binary": 123,
"api_type": "<string>",
"plan_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"comment": "<string>",
"debug_until": "2023-11-07T05:31:56Z",
"template": 123,
"template_name": "<string>",
"networks": [
"<string>"
],
"upgradeable_to": 123,
"plan": "<string>"
}{
"error": "<string>"
}<string><string>Apps
Patch an app
Partially update application settings with admin privileges. Only provided fields are modified; others remain unchanged.
PATCH
/
fastedge
/
v1
/
admin
/
apps
/
{app_id}
Patch an app
curl --request PATCH \
--url https://api.gcore.com/fastedge/v1/admin/apps/{app_id} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "my-edge-app",
"binary": 12345,
"template": 123,
"status": 1,
"env": {
"var1": "value1",
"var2": "value2"
},
"rsp_headers": {
"header1": "value1",
"header2": "value2"
},
"debug": false,
"comment": "Production API gateway for customer portal",
"secrets": {},
"stores": {}
}
'import requests
url = "https://api.gcore.com/fastedge/v1/admin/apps/{app_id}"
payload = {
"name": "my-edge-app",
"binary": 12345,
"template": 123,
"status": 1,
"env": {
"var1": "value1",
"var2": "value2"
},
"rsp_headers": {
"header1": "value1",
"header2": "value2"
},
"debug": False,
"comment": "Production API gateway for customer portal",
"secrets": {},
"stores": {}
}
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: 'my-edge-app',
binary: 12345,
template: 123,
status: 1,
env: {var1: 'value1', var2: 'value2'},
rsp_headers: {header1: 'value1', header2: 'value2'},
debug: false,
comment: 'Production API gateway for customer portal',
secrets: {},
stores: {}
})
};
fetch('https://api.gcore.com/fastedge/v1/admin/apps/{app_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/admin/apps/{app_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' => 'my-edge-app',
'binary' => 12345,
'template' => 123,
'status' => 1,
'env' => [
'var1' => 'value1',
'var2' => 'value2'
],
'rsp_headers' => [
'header1' => 'value1',
'header2' => 'value2'
],
'debug' => false,
'comment' => 'Production API gateway for customer portal',
'secrets' => [
],
'stores' => [
]
]),
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/admin/apps/{app_id}"
payload := strings.NewReader("{\n \"name\": \"my-edge-app\",\n \"binary\": 12345,\n \"template\": 123,\n \"status\": 1,\n \"env\": {\n \"var1\": \"value1\",\n \"var2\": \"value2\"\n },\n \"rsp_headers\": {\n \"header1\": \"value1\",\n \"header2\": \"value2\"\n },\n \"debug\": false,\n \"comment\": \"Production API gateway for customer portal\",\n \"secrets\": {},\n \"stores\": {}\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/admin/apps/{app_id}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"my-edge-app\",\n \"binary\": 12345,\n \"template\": 123,\n \"status\": 1,\n \"env\": {\n \"var1\": \"value1\",\n \"var2\": \"value2\"\n },\n \"rsp_headers\": {\n \"header1\": \"value1\",\n \"header2\": \"value2\"\n },\n \"debug\": false,\n \"comment\": \"Production API gateway for customer portal\",\n \"secrets\": {},\n \"stores\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/fastedge/v1/admin/apps/{app_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\": \"my-edge-app\",\n \"binary\": 12345,\n \"template\": 123,\n \"status\": 1,\n \"env\": {\n \"var1\": \"value1\",\n \"var2\": \"value2\"\n },\n \"rsp_headers\": {\n \"header1\": \"value1\",\n \"header2\": \"value2\"\n },\n \"debug\": false,\n \"comment\": \"Production API gateway for customer portal\",\n \"secrets\": {},\n \"stores\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": 2,
"name": "<string>",
"status": 123,
"binary": 123,
"api_type": "<string>",
"plan_id": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"url": "<string>",
"comment": "<string>",
"debug_until": "2023-11-07T05:31:56Z",
"template": 123,
"template_name": "<string>",
"networks": [
"<string>"
],
"upgradeable_to": 123,
"plan": "<string>"
}{
"error": "<string>"
}<string><string>Authorizations
Body
application/json
App details
Response
Application partially updated, returns updated metadata
Was this page helpful?