全部产品
云市场

创建应用

更新时间:2018-08-09 11:40:12

使用 Open API 创建一个应用。

请求 URI

  1. /app/create_app

参数列表

参数名 参数类型 描述
AppName string 应用名
BuildPackId string 容器版本(参见 build_pack_list 获取容器列表)
RegionId string 应用所在的地域
EcuList string 应用的部署机器列表
HealthCheckUrl string 应用健康检查 URL
Desc string 应用描述

响应数据

  1. {
  2. "code":200,
  3. "data":{
  4. "owner":"xxxxxxxx",
  5. "desiredState":"RUNNING",
  6. "buildpackId":11,
  7. "instances":1,
  8. "runnings":0,
  9. "description":"样例应用",
  10. "userId":"xxxxxxxx@aliyun.com",
  11. "launchTime":1466647411805,
  12. "prevState":"RUNNING",
  13. "hcUrl":"http://localhost:8080/appname/check.html",
  14. "createTime":1466578207327,
  15. "phone":"150xxxxxxxx",
  16. "regionId":"cn-beijing",
  17. "appId":"08208d49-f8c8-454a-99b6-98d4c63d262e",
  18. "name":"SampleApp",
  19. "id":"08208d49-f8c8-454a-99b6-98d4c63d262e",
  20. "state":"RUNNING",
  21. "targetBuildpackId":0,
  22. "email":"xxxxxx@aliyun.com"
  23. }
  24. }

示例

  1. Map<String,String> params = new HashMap<String,String>();
  2. params.put("AppName", "SampleApp");
  3. params.put("BuildPackId", "11");
  4. params.put("RegionId", "cn-beijing");
  5. params.put("EcuList", "f38bcf51-dd97-455d-b641-45250f094707,f38bcf51-dd97-455d-b641-45250f094707");
  6. params.put("HealthCheckUrl", "http://localhost:8080/appname/check.html");
  7. params.put("Desc", "样例应用");
  8. String resp = edasApiClient.callApi(EdasApiAction.App.create_app.path(), params);
  9. System.out.println(resp);