查询 AIDC 列表
查询当前企业的智算中心列表
GET
https://api.alayanew.com/api/aidc/v1/list鉴权(Authorizations)
| 参数 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
Authorization | String | Header | ✅ | 用户可通过已获取的 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
| 字段 | 类型 | 说明 |
|---|---|---|
code | Int | 返回值标识,0 表示成功,-1 表示失败 |
data | Array | 智算中心列表 |
data[].id | String | 智算中心 ID,例如:2 |
data[].code | String | 智算中心 Code,例如:dev01-2 |
data[].name | String | 智算中心名称 |
data[].nameEn | String | 智算中心英文名称 |
data[].country | String | 智算中心所属国家 |
data[].address | String | 智算中心地址 |
data[].endpoInt | String | 智算中心访问地址 |
msg | String | code 为 -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"
}最后更新于
这篇文档对你有帮助吗?
