Skip to main content
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>",
    "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>"
    },
    "modifiedAt": "2023-11-07T05:31:56Z",
    "orgId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "outboundIP": {
      "ipAddress": "<string>"
    },
    "publicIP": {
      "ipAddress": "<string>"
    },
    "args": [],
    "command": "",
    "envs": [
      {
        "name": "access_token",
        "value": "kalsk113=="
      }
    ],
    "ports": [],
    "sshKeyIdList": [
      "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    ]
  }
]

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Response

successful

reason
string
required

reason of container status

status
enum<string>
required
Available options:
unknown,
creating,
running,
terminating,
stopped,
error,
zombie
storages
object[]
required
Example:
[
{
"containerPath": "/workspace",
"id": "550e8400-e29b-41d4-a716-446655440000"
}
]
idc
string
required
Maximum string length: 50
Pattern: ^[a-zA-Z0-9._-]+$
product
string
required
Maximum string length: 256
Pattern: ^[a-zA-Z0-9._-]+$
name
string
required
Maximum string length: 255
Pattern: ^([A-Za-z0-9][A-Za-z0-9_\-. ]*)?[A-Za-z0-9]$
Example:

"LLM training"

templateId
string<uuid>
required

template id

createdAt
string<date-time>
eipAddress
string
eipId
string<uuid>
firewalls
string<uuid>[]
id
string<uuid>
inboundIP
object
modifiedAt
string<date-time>
orgId
string<uuid>
outboundIP
object
publicIP
object
args
string[]

Optional container command arguments

command
string
default:""

Optional container start command

envs
object[]
Example:
[
{
"name": "access_token",
"value": "kalsk113=="
}
]
ports
object[]
sshKeyIdList
string<uuid>[]

The list of SSH key IDs to use in the container