Replace VIP connected ports
curl --request PUT \
--url https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"port_ids": [
"351b0dd7-ca09-431c-be53-935db3785067",
"bc688791-f1b0-44eb-97d4-07697294b1e1"
]
}
'import requests
url = "https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices"
payload = { "port_ids": ["351b0dd7-ca09-431c-be53-935db3785067", "bc688791-f1b0-44eb-97d4-07697294b1e1"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
port_ids: ['351b0dd7-ca09-431c-be53-935db3785067', 'bc688791-f1b0-44eb-97d4-07697294b1e1']
})
};
fetch('https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices', 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/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'port_ids' => [
'351b0dd7-ca09-431c-be53-935db3785067',
'bc688791-f1b0-44eb-97d4-07697294b1e1'
]
]),
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/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices"
payload := strings.NewReader("{\n \"port_ids\": [\n \"351b0dd7-ca09-431c-be53-935db3785067\",\n \"bc688791-f1b0-44eb-97d4-07697294b1e1\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"port_ids\": [\n \"351b0dd7-ca09-431c-be53-935db3785067\",\n \"bc688791-f1b0-44eb-97d4-07697294b1e1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"port_ids\": [\n \"351b0dd7-ca09-431c-be53-935db3785067\",\n \"bc688791-f1b0-44eb-97d4-07697294b1e1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"results": [
{
"instance_id": "bc688791-f1b0-44eb-97d4-07697294b1e1",
"instance_name": "Virtual Machine 1",
"ip_assignments": [
{
"ip_address": "192.168.123.20",
"subnet": {
"cidr": "192.168.13.0/24",
"created_at": "2019-06-13T13:58:12+0000",
"enable_dhcp": true,
"id": "b39792c3-3160-4356-912e-ba396c95cdcf",
"name": "subnet_3",
"network_id": "b30d0de7-bca2-4c83-9c57-9e645bd2cc92",
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"updated_at": "2019-06-13T13:58:12+0000",
"available_ips": 250,
"creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"gateway_ip": "192.168.13.1",
"has_router": false,
"host_routes": [],
"task_id": null,
"total_ips": 253
},
"subnet_id": "b39792c3-3160-4356-912e-ba396c95cdcf"
}
],
"network": {
"created_at": "2019-06-18T11:56:16+0000",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"mtu": 1500,
"name": "public",
"port_security_enabled": true,
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"segmentation_id": 9,
"shared": false,
"subnets": [
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
},
"port_id": "351b0dd7-ca09-431c-be53-935db3785067"
}
]
}Reserved IPs
Replace VIP connected ports
Replace the list of instance ports that share a VIP.
PUT
/
cloud
/
v1
/
reserved_fixed_ips
/
{project_id}
/
{region_id}
/
{port_id}
/
connected_devices
Replace VIP connected ports
curl --request PUT \
--url https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"port_ids": [
"351b0dd7-ca09-431c-be53-935db3785067",
"bc688791-f1b0-44eb-97d4-07697294b1e1"
]
}
'import requests
url = "https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices"
payload = { "port_ids": ["351b0dd7-ca09-431c-be53-935db3785067", "bc688791-f1b0-44eb-97d4-07697294b1e1"] }
headers = {
"Authorization": "<api-key>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
port_ids: ['351b0dd7-ca09-431c-be53-935db3785067', 'bc688791-f1b0-44eb-97d4-07697294b1e1']
})
};
fetch('https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices', 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/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'port_ids' => [
'351b0dd7-ca09-431c-be53-935db3785067',
'bc688791-f1b0-44eb-97d4-07697294b1e1'
]
]),
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/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices"
payload := strings.NewReader("{\n \"port_ids\": [\n \"351b0dd7-ca09-431c-be53-935db3785067\",\n \"bc688791-f1b0-44eb-97d4-07697294b1e1\"\n ]\n}")
req, _ := http.NewRequest("PUT", 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.put("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"port_ids\": [\n \"351b0dd7-ca09-431c-be53-935db3785067\",\n \"bc688791-f1b0-44eb-97d4-07697294b1e1\"\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/cloud/v1/reserved_fixed_ips/{project_id}/{region_id}/{port_id}/connected_devices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"port_ids\": [\n \"351b0dd7-ca09-431c-be53-935db3785067\",\n \"bc688791-f1b0-44eb-97d4-07697294b1e1\"\n ]\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"results": [
{
"instance_id": "bc688791-f1b0-44eb-97d4-07697294b1e1",
"instance_name": "Virtual Machine 1",
"ip_assignments": [
{
"ip_address": "192.168.123.20",
"subnet": {
"cidr": "192.168.13.0/24",
"created_at": "2019-06-13T13:58:12+0000",
"enable_dhcp": true,
"id": "b39792c3-3160-4356-912e-ba396c95cdcf",
"name": "subnet_3",
"network_id": "b30d0de7-bca2-4c83-9c57-9e645bd2cc92",
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"updated_at": "2019-06-13T13:58:12+0000",
"available_ips": 250,
"creator_task_id": "5cc890da-d031-4a23-ac31-625edfa22812",
"dns_nameservers": [
"8.8.8.8",
"8.8.4.4"
],
"gateway_ip": "192.168.13.1",
"has_router": false,
"host_routes": [],
"task_id": null,
"total_ips": 253
},
"subnet_id": "b39792c3-3160-4356-912e-ba396c95cdcf"
}
],
"network": {
"created_at": "2019-06-18T11:56:16+0000",
"creator_task_id": "fd50fdd1-0482-4c9b-b847-fc9924665af6",
"default": true,
"external": true,
"id": "eed97610-708d-43a5-a9a5-caebd2b7b4ee",
"mtu": 1500,
"name": "public",
"port_security_enabled": true,
"project_id": 1337,
"region": "Luxembourg 1",
"region_id": 7,
"segmentation_id": 9,
"shared": false,
"subnets": [
"f00624ab-41bc-4d54-a723-1673ce32d997",
"41e0f698-4d39-483b-b77a-18eb070e4c09"
],
"tags": [
{
"key": "my-tag",
"read_only": false,
"value": "my-tag-value"
}
],
"task_id": null,
"type": "vlan",
"updated_at": "2019-06-18T11:57:00+0000"
},
"port_id": "351b0dd7-ca09-431c-be53-935db3785067"
}
]
}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
Region ID
Example:
4
Port ID
Example:
"ac177f1f-eb04-42c4-9864-e7d6486813af"
Body
application/json
List of port IDs that will share one VIP
Example:
[
"351b0dd7-ca09-431c-be53-935db3785067",
"bc688791-f1b0-44eb-97d4-07697294b1e1"
]
Was this page helpful?
⌘I