九章智算云

查询 AIDC 列表

查询当前企业的智算中心列表

GEThttps://api.alayanew.com/api/aidc/v1/list

鉴权(Authorizations)

参数类型位置必填说明
AuthorizationStringHeader用户可通过已获取的 Open API Key 做验证。例如:plain Credential=[YOUR_AK],Signature=[YOUR_SK]

请求示例

curl -X GET 'https://api.alayanew.com/api/aidc/v1/list' \
  -H 'Authorization: plain Credential=YOUR_AK,Signature=YOUR_SK'
import requests

url = "https://api.alayanew.com/api/aidc/v1/list"
headers = {
    "Authorization": "plain Credential=YOUR_AK,Signature=YOUR_SK"
}

response = requests.get(url, headers=headers)
print(response.json())
fetch('https://api.alayanew.com/api/aidc/v1/list', {
  method: 'GET',
  headers: {
    'Authorization': 'plain Credential=YOUR_AK,Signature=YOUR_SK'
  }
})
  .then(res => res.json())
  .then(data => console.log(data));
package main

import (
    "fmt"
    "io"
    "net/http"
)

func main() {
    req, _ := http.NewRequest("GET", "https://api.alayanew.com/api/aidc/v1/list", nil)
    req.Header.Set("Authorization", "plain Credential=YOUR_AK,Signature=YOUR_SK")

    resp, _ := http.DefaultClient.Do(req)
    defer resp.Body.Close()

    body, _ := io.ReadAll(resp.Body)
    fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.alayanew.com/api/aidc/v1/list"))
    .header("Authorization", "plain Credential=YOUR_AK,Signature=YOUR_SK")
    .GET()
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());

响应(Response)

状态码200 · application/json

字段类型说明
codeInt返回值标识,0 表示成功,-1 表示失败
dataArray智算中心列表
data[].idString智算中心 ID,例如:2
data[].codeString智算中心 Code,例如:dev01-2
data[].nameString智算中心名称
data[].nameEnString智算中心英文名称
data[].countryString智算中心所属国家
data[].addressString智算中心地址
data[].endpoIntString智算中心访问地址
msgStringcode-1 时返回的异常信息

响应示例

{
  "code": 0,
  "data": [
    {
      "id": 1,
      "code": "cn-beijing-a",
      "name": "北京一区智算中心",
      "nameEn": "Bei Jing AI Data Center",
      "country": "中国",
      "address": "北京市",
      "osmEndpoInt": "https://osm.hd-01.alayanew.com:20443",
      "onlineDate": "2024-03-02 10:00:00",
      "createdTime": null
    },
    {
      "id": 2,
      "code": "dev01-2",
      "name": "北京一区",
      "nameEn": "Bei Jing AI Data Center",
      "country": "中国",
      "address": "北京市",
      "endpoInt": "https://osm.hd-01.alayanew.com:20443"
    }
  ]
}
{
  "code": -1,
  "msg": "Bad Request"
}
{
  "code": -1,
  "msg": "Unauthorized"
}
{
  "code": -1,
  "msg": "Forbidden"
}
{
  "code": -1,
  "msg": "Not Found"
}
{
  "code": -1,
  "msg": "Internal Server Error"
}

最后更新于

这篇文档对你有帮助吗?

目录