curl --request POST \
--url https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop', 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/instances/{project_id}/{region_id}/{instance_id}/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
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/instances/{project_id}/{region_id}/{instance_id}/stop")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"addresses": {},
"blackhole_ports": [
{
"AlarmEnd": "2025-02-05 12:04:30",
"AlarmStart": "2025-02-05 12:04:11",
"AlarmState": "alarm",
"AlertDuration": "2 hours",
"DestinationIP": "80.240.114.116",
"ID": 123
}
],
"created_at": "2023-11-29T10:56:49Z",
"creator_task_id": "<string>",
"ddos_profile": {
"fields": [
{
"base_field": 10,
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"field_value": 45046,
"id": 11,
"name": "ARK Ports",
"required": true,
"validation_schema": {
"items": {
"maximum": 65535,
"minimum": 1000,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
}
],
"id": 0,
"options": {
"active": true,
"bgp": true
},
"profile_template": {
"description": "description",
"fields": [
{
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"id": 11,
"name": "ARK Ports",
"required": true,
"validation_schema": {
"items": {
"maximum": 65535,
"minimum": 1000,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
}
],
"id": 123,
"name": "ICMP port"
},
"profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
"protocols": [
{
"port": "80",
"protocols": [
"TCP",
"HTTP"
]
},
{
"port": "53",
"protocols": [
"UDP"
]
}
],
"site": "ED",
"status": {
"error_description": "",
"status": "Updated"
}
},
"fixed_ip_assignments": [
{
"external": true,
"ip_address": "123.123.123.1",
"subnet_id": "eaafdc3c-f48b-4eb4-826f-057dfc7d6476"
}
],
"flavor": {
"architecture": "x86_64",
"flavor_id": "g2-standard-32-64",
"flavor_name": "g2-standard-32-64",
"hardware_description": {
"ram": "16384",
"vcpus": "16"
},
"os_type": "linux",
"ram": 2048,
"vcpus": 1
},
"id": "6c6aa80f-7836-4dc2-a2ae-125e248be476",
"instance_description": "Instance description",
"instance_isolation": {
"reason": "Suspicious activities"
},
"name": "my-instance-1",
"project_id": 111,
"region": "Luxembourg",
"region_id": 4,
"security_groups": [
{
"name": "some_name"
}
],
"ssh_key_name": "<string>",
"status": "ACTIVE",
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"task_state": "<string>",
"vm_state": "active",
"volumes": [
{
"delete_on_termination": true,
"id": "<string>"
}
]
}Stop instance
Power off the server. Required VM state: Active, Shutoff, Rescued
Use POST /v2/instances////action with action=“stop” instead
curl --request POST \
--url https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop \
--header 'Authorization: <api-key>'import requests
url = "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop"
headers = {"Authorization": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: '<api-key>'}};
fetch('https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop', 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/instances/{project_id}/{region_id}/{instance_id}/stop",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
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;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "<api-key>")
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/instances/{project_id}/{region_id}/{instance_id}/stop")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/instances/{project_id}/{region_id}/{instance_id}/stop")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"addresses": {},
"blackhole_ports": [
{
"AlarmEnd": "2025-02-05 12:04:30",
"AlarmStart": "2025-02-05 12:04:11",
"AlarmState": "alarm",
"AlertDuration": "2 hours",
"DestinationIP": "80.240.114.116",
"ID": 123
}
],
"created_at": "2023-11-29T10:56:49Z",
"creator_task_id": "<string>",
"ddos_profile": {
"fields": [
{
"base_field": 10,
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"field_value": 45046,
"id": 11,
"name": "ARK Ports",
"required": true,
"validation_schema": {
"items": {
"maximum": 65535,
"minimum": 1000,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
}
],
"id": 0,
"options": {
"active": true,
"bgp": true
},
"profile_template": {
"description": "description",
"fields": [
{
"default": null,
"description": "ARK server ports. Valid port values are in range 1000-65535",
"field_type": null,
"id": 11,
"name": "ARK Ports",
"required": true,
"validation_schema": {
"items": {
"maximum": 65535,
"minimum": 1000,
"type": "integer"
},
"minItems": 1,
"type": "array"
}
}
],
"id": 123,
"name": "ICMP port"
},
"profile_template_description": "ARK server ports. Valid port values are in range 1000-65535",
"protocols": [
{
"port": "80",
"protocols": [
"TCP",
"HTTP"
]
},
{
"port": "53",
"protocols": [
"UDP"
]
}
],
"site": "ED",
"status": {
"error_description": "",
"status": "Updated"
}
},
"fixed_ip_assignments": [
{
"external": true,
"ip_address": "123.123.123.1",
"subnet_id": "eaafdc3c-f48b-4eb4-826f-057dfc7d6476"
}
],
"flavor": {
"architecture": "x86_64",
"flavor_id": "g2-standard-32-64",
"flavor_name": "g2-standard-32-64",
"hardware_description": {
"ram": "16384",
"vcpus": "16"
},
"os_type": "linux",
"ram": 2048,
"vcpus": 1
},
"id": "6c6aa80f-7836-4dc2-a2ae-125e248be476",
"instance_description": "Instance description",
"instance_isolation": {
"reason": "Suspicious activities"
},
"name": "my-instance-1",
"project_id": 111,
"region": "Luxembourg",
"region_id": 4,
"security_groups": [
{
"name": "some_name"
}
],
"ssh_key_name": "<string>",
"status": "ACTIVE",
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"task_state": "<string>",
"vm_state": "active",
"volumes": [
{
"delete_on_termination": true,
"id": "<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
Project ID
Region ID
Instance ID
Response
OK
Map of network_name to list of addresses in that network
Show child attributes
Show child attributes
IP addresses of the instances that are blackholed by DDoS mitigation system
Show child attributes
Show child attributes
Datetime when instance was created
"2023-11-29T10:56:49Z"
Task that created this entity
Advanced DDoS protection profile. It is always null if query parameter with_ddos=true is not set.
Show child attributes
Show child attributes
Fixed IP assigned to instance
Show child attributes
Show child attributes
Instances flavor schema embedded into instance schema
- Instance flavor
- Bare metal flavor
- GPU cluster flavor
Show child attributes
Show child attributes
Instance ID
"6c6aa80f-7836-4dc2-a2ae-125e248be476"
Instance description
"Instance description"
Instance isolation information
Show child attributes
Show child attributes
Instance name
"my-instance-1"
Project ID
111
Region name
"Luxembourg"
Region ID
4
Security groups
Show child attributes
Show child attributes
SSH key assigned to instance
Instance status
ACTIVE, BUILD, DELETED, ERROR, HARD_REBOOT, MIGRATING, PASSWORD, PAUSED, REBOOT, REBUILD, RESCUE, RESIZE, REVERT_RESIZE, SHELVED, SHELVED_OFFLOADED, SHUTOFF, SOFT_DELETED, SUSPENDED, UNKNOWN, VERIFY_RESIZE "ACTIVE"
List of key-value tags associated with the resource. A tag is a key-value pair that can be associated with a resource, enabling efficient filtering and grouping for better organization and management. Some tags are read-only and cannot be modified by the user. Tags are also integrated with cost reports, allowing cost data to be filtered based on tag keys or values.
Show child attributes
Show child attributes
[ { "key": "my-tag", "read_only": false, "value": "my-tag-value" } ]
The UUID of the active task that currently holds a lock on the resource. This lock prevents concurrent modifications to ensure consistency. If null, the resource is not locked.
null
Task state
Virtual machine state (active)
active, building, deleted, error, paused, rescued, resized, shelved, shelved_offloaded, soft-deleted, stopped, suspended "active"
List of volumes
Show child attributes
Show child attributes
Was this page helpful?