curl --request PATCH \
--url https://api.gcore.com/iam/clients/{clientId}/services/{serviceId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "paused",
"previous_status": "active",
"enabled": true,
"options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"status_transition_options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
]
}
'import requests
url = "https://api.gcore.com/iam/clients/{clientId}/services/{serviceId}"
payload = {
"status": "paused",
"previous_status": "active",
"enabled": True,
"options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"status_transition_options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
]
}
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({
status: 'paused',
previous_status: 'active',
enabled: true,
options: [
{
id: 123,
value: '<string>',
name: '<string>',
category: '<string>',
description: '<string>',
title: '<string>'
}
],
status_transition_options: [
{
id: 123,
value: '<string>',
name: '<string>',
category: '<string>',
description: '<string>',
title: '<string>'
}
]
})
};
fetch('https://api.gcore.com/iam/clients/{clientId}/services/{serviceId}', 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/iam/clients/{clientId}/services/{serviceId}",
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([
'status' => 'paused',
'previous_status' => 'active',
'enabled' => true,
'options' => [
[
'id' => 123,
'value' => '<string>',
'name' => '<string>',
'category' => '<string>',
'description' => '<string>',
'title' => '<string>'
]
],
'status_transition_options' => [
[
'id' => 123,
'value' => '<string>',
'name' => '<string>',
'category' => '<string>',
'description' => '<string>',
'title' => '<string>'
]
]
]),
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/iam/clients/{clientId}/services/{serviceId}"
payload := strings.NewReader("{\n \"status\": \"paused\",\n \"previous_status\": \"active\",\n \"enabled\": true,\n \"options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"status_transition_options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\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/iam/clients/{clientId}/services/{serviceId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"paused\",\n \"previous_status\": \"active\",\n \"enabled\": true,\n \"options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"status_transition_options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/iam/clients/{clientId}/services/{serviceId}")
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 \"status\": \"paused\",\n \"previous_status\": \"active\",\n \"enabled\": true,\n \"options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"status_transition_options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"client": 123,
"status": "paused",
"previous_status": "active",
"status_changed_at": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z",
"enabled": true,
"options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"status_transition_options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"deleted_date": "2023-11-07T05:31:56Z"
}Update service's details (Deprecated)
With this method you can change status or options for service. Deprecated, use the PUT method instead.
curl --request PATCH \
--url https://api.gcore.com/iam/clients/{clientId}/services/{serviceId} \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"status": "paused",
"previous_status": "active",
"enabled": true,
"options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"status_transition_options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
]
}
'import requests
url = "https://api.gcore.com/iam/clients/{clientId}/services/{serviceId}"
payload = {
"status": "paused",
"previous_status": "active",
"enabled": True,
"options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"status_transition_options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
]
}
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({
status: 'paused',
previous_status: 'active',
enabled: true,
options: [
{
id: 123,
value: '<string>',
name: '<string>',
category: '<string>',
description: '<string>',
title: '<string>'
}
],
status_transition_options: [
{
id: 123,
value: '<string>',
name: '<string>',
category: '<string>',
description: '<string>',
title: '<string>'
}
]
})
};
fetch('https://api.gcore.com/iam/clients/{clientId}/services/{serviceId}', 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/iam/clients/{clientId}/services/{serviceId}",
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([
'status' => 'paused',
'previous_status' => 'active',
'enabled' => true,
'options' => [
[
'id' => 123,
'value' => '<string>',
'name' => '<string>',
'category' => '<string>',
'description' => '<string>',
'title' => '<string>'
]
],
'status_transition_options' => [
[
'id' => 123,
'value' => '<string>',
'name' => '<string>',
'category' => '<string>',
'description' => '<string>',
'title' => '<string>'
]
]
]),
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/iam/clients/{clientId}/services/{serviceId}"
payload := strings.NewReader("{\n \"status\": \"paused\",\n \"previous_status\": \"active\",\n \"enabled\": true,\n \"options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"status_transition_options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\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/iam/clients/{clientId}/services/{serviceId}")
.header("Authorization", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"status\": \"paused\",\n \"previous_status\": \"active\",\n \"enabled\": true,\n \"options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"status_transition_options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.gcore.com/iam/clients/{clientId}/services/{serviceId}")
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 \"status\": \"paused\",\n \"previous_status\": \"active\",\n \"enabled\": true,\n \"options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ],\n \"status_transition_options\": [\n {\n \"id\": 123,\n \"value\": \"<string>\",\n \"name\": \"<string>\",\n \"category\": \"<string>\",\n \"description\": \"<string>\",\n \"title\": \"<string>\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"id": 123,
"client": 123,
"status": "paused",
"previous_status": "active",
"status_changed_at": "2023-11-07T05:31:56Z",
"start": "2023-11-07T05:31:56Z",
"enabled": true,
"options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"status_transition_options": [
{
"id": 123,
"value": "<string>",
"name": "<string>",
"category": "<string>",
"description": "<string>",
"title": "<string>"
}
],
"deleted_date": "2023-11-07T05:31:56Z"
}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
Body
Service's name.
CDN, STORAGE, STREAMING, DNS, DDOS, CLOUD Status of the service.
new, trial, trialend, active, paused, activating, deleted "paused"
Status of the service.
new, trial, trialend, active, paused, activating, deleted "active"
Shows if a service is enabled or disabled.
List of service options.
Show child attributes
Show child attributes
List of status transition options.
Show child attributes
Show child attributes
Response
OK.
Service's ID.
Service's name.
CDN, STORAGE, STREAMING, DNS, DDOS, CLOUD Client's ID.
Status of the service.
new, trial, trialend, active, paused, activating, deleted "paused"
Status of the service.
new, trial, trialend, active, paused, activating, deleted "active"
When status was changed.
Trial start date.
Shows if a service is enabled or disabled.
List of service options.
Show child attributes
Show child attributes
List of status transition options.
Show child attributes
Show child attributes
Date and time when service's status will be changed to deleted.
Applicable only if current service's status is trialend or paused.
Was this page helpful?