curl --request POST \
--url https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"autoscaling": {
"max_instances": 2,
"min_instances": 1
},
"flavor": "64m-64MB"
}
'import requests
url = "https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions"
payload = {
"autoscaling": {
"max_instances": 2,
"min_instances": 1
},
"flavor": "64m-64MB"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({autoscaling: {max_instances: 2, min_instances: 1}, flavor: '64m-64MB'})
};
fetch('https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions', 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/cloud/v1/pricing/{project_id}/{region_id}/faas/functions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'autoscaling' => [
'max_instances' => 2,
'min_instances' => 1
],
'flavor' => '64m-64MB'
]),
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/cloud/v1/pricing/{project_id}/{region_id}/faas/functions"
payload := strings.NewReader("{\n \"autoscaling\": {\n \"max_instances\": 2,\n \"min_instances\": 1\n },\n \"flavor\": \"64m-64MB\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"autoscaling\": {\n \"max_instances\": 2,\n \"min_instances\": 1\n },\n \"flavor\": \"64m-64MB\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"autoscaling\": {\n \"max_instances\": 2,\n \"min_instances\": 1\n },\n \"flavor\": \"64m-64MB\"\n}"
response = http.request(request)
puts response.read_body{
"currency_code": "USD",
"discount_percent": 0.16,
"price_per_hour": 1,
"price_per_month": 720,
"price_status": "show",
"price_without_discount_per_month": 604.8,
"tax_percent": 17
}Preview function price
Preview the billing price for the FaaS function.
curl --request POST \
--url https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"autoscaling": {
"max_instances": 2,
"min_instances": 1
},
"flavor": "64m-64MB"
}
'import requests
url = "https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions"
payload = {
"autoscaling": {
"max_instances": 2,
"min_instances": 1
},
"flavor": "64m-64MB"
}
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({autoscaling: {max_instances: 2, min_instances: 1}, flavor: '64m-64MB'})
};
fetch('https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions', 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/cloud/v1/pricing/{project_id}/{region_id}/faas/functions",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'autoscaling' => [
'max_instances' => 2,
'min_instances' => 1
],
'flavor' => '64m-64MB'
]),
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/cloud/v1/pricing/{project_id}/{region_id}/faas/functions"
payload := strings.NewReader("{\n \"autoscaling\": {\n \"max_instances\": 2,\n \"min_instances\": 1\n },\n \"flavor\": \"64m-64MB\"\n}")
req, _ := http.NewRequest("POST", 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.post("https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"autoscaling\": {\n \"max_instances\": 2,\n \"min_instances\": 1\n },\n \"flavor\": \"64m-64MB\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/pricing/{project_id}/{region_id}/faas/functions")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"autoscaling\": {\n \"max_instances\": 2,\n \"min_instances\": 1\n },\n \"flavor\": \"64m-64MB\"\n}"
response = http.request(request)
puts response.read_body{
"currency_code": "USD",
"discount_percent": 0.16,
"price_per_hour": 1,
"price_per_month": 720,
"price_status": "show",
"price_without_discount_per_month": 604.8,
"tax_percent": 17
}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
Project ID
1
Region ID
1
Body
Autoscaling configuration for the function. Keys must be 'min_instances' or 'max_instances', and values must be integers between 0 and 50.
Show child attributes
Show child attributes
{ "max_instances": 2, "min_instances": 1 }
The name of the flavor associated with the function.
"64m-64MB"
Response
OK
Response with prices per hour and per month
Currency code (3 letter code per ISO 4217)
AZN, EUR, USD Actual discount relative value
0.16
Price of the item charged per hour
1
Price of the item charged per month
720
Price status for the UI
error, hide, show "show"
Total price VAT inclusive per month without discount
604.8
Tax rate applied to the subtotal, represented as a percentage
0
17
12
Was this page helpful?