文档

项目管理API

更新时间:
一键部署

1. 概述

应用服务平台项目的创建和查询API。

2. 接口定义

2.1 新建项目

路径

/open/project/univisal/create

版本号

1.0.0

协议

HTTPS

请求方法

POST

授权类型

app签名

超时时间

10000

请求参数

名称

类型

是否必选

描述

name

String

项目名称

clientName

String

客户名称

description

String

描述

startTime

Long

开始时间

endTime

Long

结束

solutionUuid

String

解决方案uuid,智慧社区为98b4181b749f4de9aaef6e9f20cea702

solutionVersionUuid

String

解决方案版本uuid,可以填null

coverUrl

List<String>

封面URL

contractUrl

List<String>

协议URL

返回数据

名称

类型

描述

code

Int

接口返回码。200表示成功。

message

String

调用失败时,返回的出错信息。

localizedMsg

String

本地语言的错误消息。

data

String

项目ID

示例

请求示例:

// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();

ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");

SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);

IoTApiRequest request = new IoTApiRequest();

// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.0");
// 设置参数
request.putParam("name","value1");
request.putParam("clientName","value2");
request.putParam("description","value3");
request.putParam("startTime","value4");
request.putParam("endTime","value5");
request.putParam("solutionUuid","value6");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");

// 设置请求参数域名、path、request , isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/open/project/univisal/create", request, true, headers);

System.out.println(
    "response code = " + response.getCode()
        + " response = " + new String(response.getBody(), "UTF-8")
        + " headers = " + response.getHeaders().toString()
);

正常返回示例:

{
    "id": "4de2c367-c1db-417c-aa15-8c585e595d92",
    "code": 200,
    "message": null,
    "localizedMsg": null,
    "data": "projectId"
}

异常返回示例:

{
    "id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
    "code": 403,
    "message": "request forbidden.",
    "localizedMsg": "请求被禁止",
    "data": null
}

2.2 分页查询项目列表

路径

/open/project/univisal/query

版本号

1.0.0

协议

HTTPS

请求方法

POST

授权类型

app签名

超时时间

8000

请求参数

名称

类型

是否必选

描述

pageNo

Integer

页号

pageSize

Integer

每页数量

返回数据

名称

类型

描述

code

Int

接口返回码。200表示成功。

message

String

调用失败时,返回的出错信息。

localizedMsg

String

本地语言的错误消息。

data

JSONArray

项目列表

项目列表:data

名称

类型

描述

pageNo

Integer

页号

pageSize

Integer

每页数量

total

Integer

总数

dataList

List<ProjectDetail>

项目列表

项目列表:dataList:

名称

类型

描述

projectId

String

项目ID

name

String

项目名称

clientName

String

客户名称

description

String

描述

startTime

Long

开始时间

endTime

Long

结束时间

defaultAppUuid

String

默认应用uuid

defaultAppKey

String

默认应用appKey

rootSpaceId

String

根空间ID

coverUrl

List<String>

封面

contractUrl

List<String>

协议

示例

请求示例:

// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();

ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");

SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);

IoTApiRequest request = new IoTApiRequest();

// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.0");
// 设置参数
request.putParam("pageNo","value1");
request.putParam("pageSize","value2");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");

// 设置请求参数域名、path、request , isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/open/project/univisal/query", request, true, headers);

System.out.println(
    "response code = " + response.getCode()
        + " response = " + new String(response.getBody(), "UTF-8")
        + " headers = " + response.getHeaders().toString()
);

正常返回示例:

{
    "id": "4de2c367-c1db-417c-aa15-8c585e595d92",
    "code": 200,
    "message": null,
    "localizedMsg": null,
    "data": {
        "pageNo":1,
        "pageSize":10,
        "dataList":[
            {
                "projectId":"项目id",
                "name":"项目名称",
                "clientName":"客户名称",
                "description":"描述",
                "startTime":1581075936000,
                "endTime":1581075936000,
                "coverUrl":["url","url"],
                "contractUrl":["contractUrl","contractUrl"],
                "rootSpaceId":"rootSpaceId"
            }
            ]
    }
}

异常返回示例:

{
    "id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
    "code": 403,
    "message": "request forbidden.",
    "localizedMsg": "请求被禁止",
    "data": null
}

2.3 查询项目详情

路径

/open/project/univisal/get

版本号

1.0.0

协议

HTTPS

请求方法

POST

授权类型

app签名

超时时间

3000

请求参数

名称

类型

是否必选

描述

projectId

String

页号

返回数据

名称

类型

描述

code

Int

接口返回码。200表示成功。

message

String

调用失败时,返回的出错信息。

localizedMsg

String

本地语言的错误消息。

data

JSONObject

响应结果

响应结果 data:

名称

类型

描述

projectId

String

项目ID

name

String

项目名称

clientName

String

客户名称

description

String

描述

startTime

Long

开始时间

endTime

Long

结束时间

defaultAppUuid

String

默认应用uuid

defaultAppKey

String

默认应用appKey

rootSpaceId

String

根空间ID

clusterIdList

List<String>

边缘集群idList

coverUrl

List<String>

封面

contractUrl

List<String>

协议

示例

请求示例:

// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();

ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");

SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);

IoTApiRequest request = new IoTApiRequest();

// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.0");
// 设置参数
request.putParam("projectId","value1");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");

// 设置请求参数域名、path、request , isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/open/project/univisal/get", request, true, headers);

System.out.println(
    "response code = " + response.getCode()
        + " response = " + new String(response.getBody(), "UTF-8")
        + " headers = " + response.getHeaders().toString()
);

正常返回示例:

{
    "id": "4de2c367-c1db-417c-aa15-8c585e595d92",
    "code": 200,
    "message": null,
    "localizedMsg": null,
    "data": {
        "projectId":"项目id",
        "name":"项目名称",
        "clientName":"客户名称",
        "description":"项目描述",
        "startTime":1581075936000,
        "endTime":1581075936000,
        "coverUrl":["url","url"],
        "contractUrl":["url","url"],
        "rootSpaceId":"rootSpaceId",
        "clusterIdList":"clusterIdList"
    }
}

异常返回示例:

{
    "id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
    "code": 403,
    "message": "request forbidden.",
    "localizedMsg": "请求被禁止",
    "data": null
}

2.4 分页查询解决方案

路径

/open/solution/basicinfo/query

版本号

1.0.0

协议

HTTPS

请求方法

POST

授权类型

app签名

超时时间

3000

请求参数

名称

类型

是否必选

描述

pageNo

Integer

页号

pageSize

Integer

每页数量

返回数据

名称

类型

描述

code

Int

接口返回码。200表示成功。

message

String

调用失败时,返回的出错信息。

localizedMsg

String

本地语言的错误消息。

data

JSONObject

响应结果

响应结果 data:

名称

类型

描述

pageNo

Integer

页号

pageSize

Integer

每页数量

total

Integer

总数

dataList

List<SolutionMetaInfo>

解决方案列表

解决方案列表 dataList:

名称

类型

描述

solutionUuid

String

解决方案uuid

solutionCode

String

解决方案code

solutionName

String

解决方案名称

solutionDesc

String

描述

solutionStatus

String

状态

versionCode

String

版本code

versionUuid

String

版本uuid

示例

请求示例:

// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();

ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");

SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);

IoTApiRequest request = new IoTApiRequest();

// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.0");
// 设置参数
request.putParam("pageNo","value1");
request.putParam("pageSize","value2");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");

// 设置请求参数域名、path、request , isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/open/solution/basicinfo/query", request, true, headers);

System.out.println(
    "response code = " + response.getCode()
        + " response = " + new String(response.getBody(), "UTF-8")
        + " headers = " + response.getHeaders().toString()
);

正常返回示例:

{
    "id": "4de2c367-c1db-417c-aa15-8c585e595d92",
    "code": 200,
    "message": null,
    "localizedMsg": null,
    "data": 
    {
        "total":100,
        "pageNo":1,
        "pageSize":1,
        "dataList":
        [
            {
                "solutionUuid":"947957393830278589375982947****",
                "solutionCode":"testCode",
                "solutionName":"解决方案名称",
                "solutionDesc":"解决方案描述",
                "solutionStatus":"CREATE",
                "versionCode":"1.0.0",
                "versionUuid":"8793894927464093728394726510****"
            }
        ]
    }
}

异常返回示例:

{
    "id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
    "code": 403,
    "message": "request forbidden.",
    "localizedMsg": "请求被禁止",
    "data": null
}

2.5 查询项目默认应用appSecret

路径

/open/project/defaultapp/get

版本号

1.0.0

协议

HTTPS

请求方法

POST

授权类型

app签名

超时时间

3000

请求参数

名称

类型

是否必选

描述

projectId

String

项目id

返回数据

名称

类型

描述

code

Int

接口返回码。200表示成功。

message

String

调用失败时,返回的出错信息。

localizedMsg

String

本地语言的错误消息。

data

JSONObject

响应结果

响应结果 data:

名称

类型

描述

defaultAppSecret

String

默认应用appSecret

defaultAppKey

String

默认应用appKey

示例

请求示例:

// https://github.com/aliyun/iotx-api-gateway-client
IoTApiClientBuilderParams ioTApiClientBuilderParams = new IoTApiClientBuilderParams();

ioTApiClientBuilderParams.setAppKey("你的<AppKey>");
ioTApiClientBuilderParams.setAppSecret("你的<AppSecret>");

SyncApiClient syncApiClient = new SyncApiClient(ioTApiClientBuilderParams);

IoTApiRequest request = new IoTApiRequest();

// 设置请求ID
String uuid = UUID.randomUUID().toString();
String id = uuid.replace("-", "");
request.setId(id);
// 设置API版本号
request.setApiVer("1.0.0");
// 设置参数
request.putParam("projectId","value1");
// 如果需要,设置headers
Map<String, String> headers = new HashMap<String, String>(8);
// headers.put("你的<header", "你的<value>");

// 设置请求参数域名、path、request , isHttps, headers
ApiResponse response = syncApiClient.postBody("api.link.aliyun.com", "/open/project/defaultapp/get", request, true, headers);

System.out.println(
    "response code = " + response.getCode()
        + " response = " + new String(response.getBody(), "UTF-8")
        + " headers = " + response.getHeaders().toString()
);

正常返回示例:

{
    "id": "4de2c367-c1db-417c-aa15-8c585e595d92",
    "code": 200,
    "message": null,
    "localizedMsg": null,
    "data": {
        "defaultAppKey":"默认应用appKey",
        "defaultAppSecret":"默认应用appSecret"
    }
}

异常返回示例:

{
    "id": "37f7e5fa-d6a5-4efe-8abf-5bf23dca6284",
    "code": 403,
    "message": "request forbidden.",
    "localizedMsg": "请求被禁止",
    "data": null
}

  • 本页导读 (0)
文档反馈