/v3/spark/analytics/context/


操作

  • 支持操作:

    • GET: 创建/列出环境
    • DELETE: 删除环境
  • 支持参数:

    • cpu: (非必需)用的CPU核数量
    • memory: (非必需)最大的每个节点内存使用量, ###M的格式, 如: 1024m.
    • 如果需要传Spark-相关参数,可以通过 spark.xxxxx的格式传。

生成环境

HTTP

GET /analytics/v1/context/mycontext?cpu=4&memory=2048m HTTP/1.1
Host: api.exceeddata.com
Content-Type: application/json; charset=utf-8

BASH

curl 'api.exceeddata.com/analytics/v1/context/mycontext?cpu=2&memory=1024m'
{
  "result": 0
}

列出环境

HTTP

GET /analytics/v1/context/mycontext HTTP/1.1
Host: api.exceeddata.com
Content-Type: application/json; charset=utf-8

BASH

curl 'api.exceeddata.com/analytics/v1/context/mycontext'
{
   "result": 0
}

BASH

curl 'api.exceeddata.com/analytics/v1/context/bad'
{
   "result": -1
}

删除环境

HTTP

DELETE /analytics/v1/context/mycontext HTTP/1.1
Host: api.exceeddata.com
Content-Type: application/json; charset=utf-8

BASH

curl –X DELETE 'api.exceeddata.com/analytics/v1/context/mycontext'
{
  "result": 0
}