Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.cloud.inference.deployments.list(
project_id=1,
)
page = page.results[0]
print(page.project_id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Cloud.Inference.Deployments.List(context.TODO(), cloud.InferenceDeploymentListParams{
ProjectID: gcore.Int(1),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}curl --request GET \
--url https://api.gcore.com/cloud/v3/inference/{project_id}/deployments \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v3/inference/{project_id}/deployments', 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/v3/inference/{project_id}/deployments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v3/inference/{project_id}/deployments")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/inference/{project_id}/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 1,
"results": [
{
"address": "https://example.com",
"auth_enabled": false,
"command": [
"nginx",
"-g",
"daemon off;"
],
"containers": [
{
"deploy_status": {
"ready": 1,
"total": 3
},
"region_id": 1,
"scale": {
"cooldown_period": 60,
"max": 3,
"min": 1,
"triggers": {
"cpu": {
"threshold": 80
},
"memory": {
"threshold": 70
}
}
}
}
],
"created_at": "2023-08-22T11:21:00Z",
"credentials_name": "dockerhub",
"description": "My first instance",
"envs": {
"DEBUG_MODE": "False",
"KEY": "12345"
},
"flavor_name": "inference-16vcpu-232gib-1xh100-80gb",
"image": "nginx:latest",
"ingress_opts": {
"disable_response_buffering": true
},
"listening_port": 8080,
"logging": {
"destination_region_id": 1,
"enabled": true,
"retention_policy": {
"period": 45
},
"topic_name": "my-log-name"
},
"name": "my-instance",
"object_references": [
{
"kind": "AppDeployment",
"name": "my-inference-app"
}
],
"probes": {
"liveness_probe": {
"enabled": true,
"probe": {
"exec": {
"command": [
"ls",
"-l"
]
},
"failure_threshold": 3,
"http_get": {
"headers": {
"Authorization": "Bearer token 123"
},
"host": "127.0.0.1",
"path": "/healthz",
"port": 80,
"schema": "HTTP"
},
"initial_delay_seconds": 0,
"period_seconds": 5,
"success_threshold": 1,
"tcp_socket": {
"port": 80
},
"timeout_seconds": 1
}
},
"readiness_probe": {
"enabled": true,
"probe": {
"exec": {
"command": [
"ls",
"-l"
]
},
"failure_threshold": 3,
"http_get": {
"headers": {
"Authorization": "Bearer token 123"
},
"host": "127.0.0.1",
"path": "/healthz",
"port": 80,
"schema": "HTTP"
},
"initial_delay_seconds": 0,
"period_seconds": 5,
"success_threshold": 1,
"tcp_socket": {
"port": 80
},
"timeout_seconds": 1
}
},
"startup_probe": {
"enabled": true,
"probe": {
"exec": {
"command": [
"ls",
"-l"
]
},
"failure_threshold": 3,
"http_get": {
"headers": {
"Authorization": "Bearer token 123"
},
"host": "127.0.0.1",
"path": "/healthz",
"port": 80,
"schema": "HTTP"
},
"initial_delay_seconds": 0,
"period_seconds": 5,
"success_threshold": 1,
"tcp_socket": {
"port": 80
},
"timeout_seconds": 1
}
}
},
"project_id": 1,
"timeout": 120,
"api_keys": [
"key1",
"key2"
]
}
]
}Everywhere Inference
List inference deployments
GET
/
cloud
/
v3
/
inference
/
{project_id}
/
deployments
Python
import os
from gcore import Gcore
client = Gcore(
api_key=os.environ.get("GCORE_API_KEY"), # This is the default and can be omitted
)
page = client.cloud.inference.deployments.list(
project_id=1,
)
page = page.results[0]
print(page.project_id)package main
import (
"context"
"fmt"
"github.com/G-Core/gcore-go"
"github.com/G-Core/gcore-go/cloud"
"github.com/G-Core/gcore-go/option"
)
func main() {
client := gcore.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.Cloud.Inference.Deployments.List(context.TODO(), cloud.InferenceDeploymentListParams{
ProjectID: gcore.Int(1),
})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}curl --request GET \
--url https://api.gcore.com/cloud/v3/inference/{project_id}/deployments \
--header 'Authorization: <api-key>'const options = {method: 'GET', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v3/inference/{project_id}/deployments', 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/v3/inference/{project_id}/deployments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}HttpResponse<String> response = Unirest.get("https://api.gcore.com/cloud/v3/inference/{project_id}/deployments")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v3/inference/{project_id}/deployments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"count": 1,
"results": [
{
"address": "https://example.com",
"auth_enabled": false,
"command": [
"nginx",
"-g",
"daemon off;"
],
"containers": [
{
"deploy_status": {
"ready": 1,
"total": 3
},
"region_id": 1,
"scale": {
"cooldown_period": 60,
"max": 3,
"min": 1,
"triggers": {
"cpu": {
"threshold": 80
},
"memory": {
"threshold": 70
}
}
}
}
],
"created_at": "2023-08-22T11:21:00Z",
"credentials_name": "dockerhub",
"description": "My first instance",
"envs": {
"DEBUG_MODE": "False",
"KEY": "12345"
},
"flavor_name": "inference-16vcpu-232gib-1xh100-80gb",
"image": "nginx:latest",
"ingress_opts": {
"disable_response_buffering": true
},
"listening_port": 8080,
"logging": {
"destination_region_id": 1,
"enabled": true,
"retention_policy": {
"period": 45
},
"topic_name": "my-log-name"
},
"name": "my-instance",
"object_references": [
{
"kind": "AppDeployment",
"name": "my-inference-app"
}
],
"probes": {
"liveness_probe": {
"enabled": true,
"probe": {
"exec": {
"command": [
"ls",
"-l"
]
},
"failure_threshold": 3,
"http_get": {
"headers": {
"Authorization": "Bearer token 123"
},
"host": "127.0.0.1",
"path": "/healthz",
"port": 80,
"schema": "HTTP"
},
"initial_delay_seconds": 0,
"period_seconds": 5,
"success_threshold": 1,
"tcp_socket": {
"port": 80
},
"timeout_seconds": 1
}
},
"readiness_probe": {
"enabled": true,
"probe": {
"exec": {
"command": [
"ls",
"-l"
]
},
"failure_threshold": 3,
"http_get": {
"headers": {
"Authorization": "Bearer token 123"
},
"host": "127.0.0.1",
"path": "/healthz",
"port": 80,
"schema": "HTTP"
},
"initial_delay_seconds": 0,
"period_seconds": 5,
"success_threshold": 1,
"tcp_socket": {
"port": 80
},
"timeout_seconds": 1
}
},
"startup_probe": {
"enabled": true,
"probe": {
"exec": {
"command": [
"ls",
"-l"
]
},
"failure_threshold": 3,
"http_get": {
"headers": {
"Authorization": "Bearer token 123"
},
"host": "127.0.0.1",
"path": "/healthz",
"port": 80,
"schema": "HTTP"
},
"initial_delay_seconds": 0,
"period_seconds": 5,
"success_threshold": 1,
"tcp_socket": {
"port": 80
},
"timeout_seconds": 1
}
}
},
"project_id": 1,
"timeout": 120,
"api_keys": [
"key1",
"key2"
]
}
]
}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
Example:
1
Query Parameters
Optional. Limit the number of returned items
Required range:
x <= 1000Example:
1000
Optional. Offset value is used to exclude the first set of records from the result
Required range:
x >= 0Example:
0
Was this page helpful?
⌘I