List container information
curl --request GET \
--url https://console.gmicloud.ai/api/v1/containers \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.gmicloud.ai/api/v1/containers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.gmicloud.ai/api/v1/containers', 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://console.gmicloud.ai/api/v1/containers",
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: Bearer <token>"
],
]);
$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://console.gmicloud.ai/api/v1/containers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://console.gmicloud.ai/api/v1/containers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.gmicloud.ai/api/v1/containers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"reason": "<string>",
"status": "unknown",
"storages": [
{
"containerPath": "/workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"idc": "<string>",
"product": "<string>",
"name": "LLM training",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"eipAddress": "<string>",
"eipId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firewalls": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inboundIP": {
"ipAddress": "<string>",
"status": "ready"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outboundIP": {
"ipAddress": "<string>",
"status": "ready"
},
"publicIP": {
"ipAddress": "<string>",
"status": "ready"
},
"args": [],
"command": "",
"envs": [
{
"name": "access_token",
"value": "kalsk113=="
}
],
"ports": [],
"sshKeyIdList": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
containers
List container information
GET
/
v1
/
containers
List container information
curl --request GET \
--url https://console.gmicloud.ai/api/v1/containers \
--header 'Authorization: Bearer <token>'import requests
url = "https://console.gmicloud.ai/api/v1/containers"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://console.gmicloud.ai/api/v1/containers', 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://console.gmicloud.ai/api/v1/containers",
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: Bearer <token>"
],
]);
$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://console.gmicloud.ai/api/v1/containers"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://console.gmicloud.ai/api/v1/containers")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://console.gmicloud.ai/api/v1/containers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"reason": "<string>",
"status": "unknown",
"storages": [
{
"containerPath": "/workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
],
"idc": "<string>",
"product": "<string>",
"name": "LLM training",
"templateId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"createdAt": "2023-11-07T05:31:56Z",
"eipAddress": "<string>",
"eipId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"firewalls": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
],
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inboundIP": {
"ipAddress": "<string>",
"status": "ready"
},
"modifiedAt": "2023-11-07T05:31:56Z",
"orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outboundIP": {
"ipAddress": "<string>",
"status": "ready"
},
"publicIP": {
"ipAddress": "<string>",
"status": "ready"
},
"args": [],
"command": "",
"envs": [
{
"name": "access_token",
"value": "kalsk113=="
}
],
"ports": [],
"sshKeyIdList": [
"3c90c3cc-0d44-4b50-8888-8dd25736052a"
]
}
]
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
successful
reason of container status
Available options:
unknown, creating, running, terminating, stopped, error, zombie Show child attributes
Show child attributes
Example:
[ { "containerPath": "/workspace", "id": "550e8400-e29b-41d4-a716-446655440000" } ]
Maximum string length:
50Pattern:
^[a-zA-Z0-9._-]+$Maximum string length:
256Pattern:
^[a-zA-Z0-9._-]+$Maximum string length:
255Pattern:
^([A-Za-z0-9][A-Za-z0-9_\-. ]*)?[A-Za-z0-9]$Example:
"LLM training"
template id
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Optional container command arguments
Optional container start command
Show child attributes
Show child attributes
Example:
[ { "name": "access_token", "value": "kalsk113==" } ]
Show child attributes
Show child attributes
The list of SSH key IDs to use in the container