Skip to main content
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,
  "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

Authorization
string
header
required

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

app_id
integer<int64>
required

ID of the app

Body

application/json

App details

name
string

Unique application name (alphanumeric, hyphens allowed)

Required string length: 1 - 64
Pattern: ^[a-z0-9][a-z0-9-]*[a-z0-9]$
Example:

"my-edge-app"

binary
integer<int64>

ID of the WebAssembly binary to deploy

Required range: x >= 1
Example:

12345

template
integer<int64>

Template ID

status
integer

Status code:
0 - draft (inactive)
1 - enabled
2 - disabled
5 - suspended

Required range: 0 <= x <= 5
Example:

1

env
object

Environment variables

Example:
{ "var1": "value1", "var2": "value2" }
rsp_headers
object

Extra headers to add to the response

Example:
{ "header1": "value1", "header2": "value2" }
log
enum<string> | null
deprecated
Available options:
kafka,
none
debug
boolean
default:false
write-only

Enable verbose debug logging for 30 minutes. Automatically expires to prevent performance impact.

Example:

false

comment
string

Optional human-readable description of the application's purpose

Maximum string length: 1024
Example:

"Production API gateway for customer portal"

secrets
object

Application secrets

stores
object

Application edge stores

Response

Application partially updated, returns updated metadata

id
integer<int64>
required

App ID

Required range: x >= 1
name
string
required

App name

status
integer
required

Status code:
0 - draft (inactive)
1 - enabled
2 - disabled
3 - hourly call limit exceeded
4 - daily call limit exceeded
5 - suspended

binary
integer<int64>
required

Binary ID

api_type
string
required

Wasm API type

plan_id
integer<int64>
required

Application plan ID

url
string

App URL

comment
string

Description of the binary

debug_until
string<date-time>

When debugging finishes

template
integer<int64>

Template ID

template_name
string

Template name

networks
string[]

Networks

upgradeable_to
integer<int64>

ID of the binary the app can be upgraded to

plan
string

Application plan name