目录

1.10.2 API文档

优质
小牛编辑
129浏览
2023-12-01

简介

Xiaomi Cloud-ML项目暴露API访问接口,可以通过API、SDK或命令行工具访问Xiaomi Cloud-ML服务的完整功能。

Train Job API

查看所有训练任务(GET /cloud_ml/v1/train)

URL参数格式:无。

Header格式:

Header名称类型是否必需描述
X-Xiaomi-Timestampstring请求的时间戳
X-Xiaomi-Content-MD5stringPOST请求内容的MD5
X-Xiaomi-Secret-Key-Idstring用户Access key
Authorizationstring请求的签名

POST数据格式:无。

输入格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

成功返回结果:

{
    "data": [
        {
            "org_id": self.org_id,
            "org_name": self.org_name,
            "job_name": self.job_name,
            "module_name": self.module_name,
            "trainer_uri": self.trainer_uri,
            "job_args": self.job_args,
            "cpu_limit": self.cpu_limit,
            "memory_limit": self.memory_limit,
            "gpu_limit": self.gpu_limit,
            "cluster_name": self.cluster_name,
            "cluster_env_var": self.cluster_env_var,
            "service_port": str(self.service_port),
            "software": self.software,
            "version": self.version,
            "state": self.state,
            "create_time": str(self.create_time),
            "update_time": str(self.update_time),
            "volume_type": self.volume_type,
            "volume_path": self.volume_path,
            "mount_path": self.mount_path,
            "mount_read_only": str(self.mount_read_only),
            "prepare_command": self.prepare_command,
            "finish_command": self.finish_command
        }
    ]
}

创建训练任务(POST /cloud_ml/v1/train)

URL参数格式:同上。

Header格式:同上。

POST数据样例:

{
    "job_name": "linear1",
    "module_name": "tainer.task",
    "trainer_uri": "fds://cloud-ml-test/linear/trainer-1.0.0.tar.gz",
    "job_args": "--max_epochs=200 --optimizer ftrl",  (optional)
    "cpu_limit": 0.5, (optional)
    "memory_limit": "100M", (optional)
    "gpu_limit": 0, (optional)
    "ps_count": 2, (optional)
    "worker_count": 3 (optional)
}
描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Invalid argument: xxx."}
资源不足413{"error": True, "message": "xxx"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "job_name": self.job_name,
    "module_name": self.module_name,
    "trainer_uri": self.trainer_uri,
    "job_args": self.job_args,
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "gpu_limit": self.gpu_limit,
    "cluster_name": self.cluster_name,
    "cluster_env_var": self.cluster_env_var,
    "service_port": str(self.service_port),
    "software": self.software,
    "version": self.version,
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "volume_type": self.volume_type,
    "volume_path": self.volume_path,
    "mount_path": self.mount_path,
    "mount_read_only": str(self.mount_read_only),
    "prepare_command": self.prepare_command,
    "finish_command": self.finish_command
}

查看训练任务详情(GET /cloud_ml/v1/train/$job_name)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": “xxx”}
拒绝请求403{"error": True, "message": "Invalid argument: xxx."}
资源不存在404{ "error": True, "message": "TrainJob doesn't exist"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "job_name": self.job_name,
    "module_name": self.module_name,
    "trainer_uri": self.trainer_uri,
    "job_args": self.job_args,
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "gpu_limit": self.gpu_limit,
    "cluster_name": self.cluster_name,
    "cluster_env_var": self.cluster_env_var,
    "service_port": str(self.service_port),
    "software": self.software,
    "version": self.version,
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "volume_type": self.volume_type,
    "volume_path": self.volume_path,
    "mount_path": self.mount_path,
    "mount_read_only": str(self.mount_read_only),
    "prepare_command": self.prepare_command,
    "finish_command": self.finish_command
}

删除训练任务(DELETE /cloud_ml/v1/train/$job_name)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200{"message": "Successfully request to delete train job."}
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter"}
资源不存在404{"error": True, "message": "TrainJob doesn't exist"}
内部错误503{ "error": True, "message": "Exception: xxx"}

查看训练任务日志(GET /cloud_ml/v1/train/$job_name/logs)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200{"logs": "xxx"}
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

查看训练任务事件信息(GET /cloud_ml/v1/train/$job_name/events)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

输入格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

成功返回结果:

{
    "data": [
        {
            'count': 1,
            'firstTimestamp': '2017-02-20T06:16:39Z',
            'lastTimestamp': '2017-02-20T06:16:39Z',
            'source':
                {
                    'component': 'default-scheduler'
                },
                    'reason': 'Scheduled',
                    'involvedObject':
                {
                    'kind': 'Pod',
                    'uid': '23cbc120-f734-11e6-9702-02601838e5ba',
                    'namespace': 'default',
                    'apiVersion': 'v1',
                    'resourceVersion': '419556',
                    'name': 'de-999-dev4-061636-4150936070-5tgzu'
                },
                'message': 'Successfully assigned de-999-dev4-061636-4150936070-5tgzu to minikubevm',
                'type': 'Normal',
                'metadata':
                    {
                        'uid': '23cd70e3-f734-11e6-9702-02601838e5ba',
                        'namespace': 'default',
                        'resourceVersion': '419563',
                        'creationTimestamp': '2017-02-20T06:16:39Z',
                        'selfLink': '/api/v1/namespaces/default/events/de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045',
                        'name': 'de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045'
                    }
        }
    ]
}

Model Service API

查看所有模型服务(GET /cloud_ml/v1/model)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{"error": True, "message": "ModelService doesn't exist"}

成功返回结果:

{
    "data": [
        {
            "org_id": self.org_id,
            "org_name": self.org_name,
            "model_name": self.model_name,
            "model_version": self.model_version,
            "model_uri": self.model_uri,
            "service_port": str(self.service_port),
            "cpu_limit": self.cpu_limit,
            "memory_limit": self.memory_limit,
            "replicas": self.replicas
            "state": self.state,
            "create_time": str(self.create_time),
            "update_time": str(self.update_time),
            "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.service_port),
            "prepare_command": self.prepare_command,
            "finish_command": self.finish_command
        }
    ]
}

创建模型服务(POST /cloud_ml/v1/model)

URL参数格式:同上。

Header格式:同上。

POST数据样例:

{
    "model_name": "linear1",
    "model_version": "v1",
    "model_uri": "fds://cloud-ml-test/linear_model1/",
    "cpu_limit": 0.5, (optional)
    "memory_limit": "100M", (optional)
    "gpu_limit": 0, (optional)
    "replicas": 3, (optional)
}

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Invalid argument: xxx."}
资源不足413{"error": True, "message": "xxx"}
内部错误503{"error": True, "message": "Failed to create model or consume quota in XX"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "model_name": self.model_name,
    "model_version": self.model_version,
    "model_uri": self.model_uri,
    "service_port": str(self.service_port),
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "replicas": self.replicas
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.service_port),
    "prepare_command": self.prepare_command,
    "finish_command": self.finish_command
}

查看模型服务详情(GET /cloud_ml/v1/model/$model_name/$model_version)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{ "error": True, "message": "Need org_id parameter."}
资源不存在404{"error": True, "message": "ModelService doesn't exist"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "model_name": self.model_name,
    "model_version": self.model_version,
    "model_uri": self.model_uri,
    "service_port": str(self.service_port),
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "replicas": self.replicas
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.service_port),
    "prepare_command": self.prepare_command,
    "finish_command": self.finish_command
}

删除模型服务(DELETE /cloud_ml/v1/model/$model_name/$model_version)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200{"message": "Successfully request to delete model service."}
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{"error": True, "message": "ModelService doesn't exist"}
内部错误503{"error": True, "message": "Fail to delete model service: xxx, exception: xxx"}

查看模型服务日志(GET /cloud_ml/v1/model/$model_name/$model_version/logs)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200{"data": [{}]
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

查看模型服务事件信息(GET /cloud_ml/v1/model/$model_name/$model_version/events)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

输入格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

成功返回结果:

{
    "data": [
        {
            'count': 1,
            'firstTimestamp': '2017-02-20T06:16:39Z',
            'lastTimestamp': '2017-02-20T06:16:39Z',
            'source':
                {
                    'component': 'default-scheduler'
                },
                'reason': 'Scheduled',
                'involvedObject':
                {
                    'kind': 'Pod',
                    'uid': '23cbc120-f734-11e6-9702-02601838e5ba',
                    'namespace': 'default',
                    'apiVersion': 'v1',
                    'resourceVersion': '419556',
                    'name': 'de-999-dev4-061636-4150936070-5tgzu'
                },
                'message': 'Successfully assigned de-999-dev4-061636-4150936070-5tgzu to minikubevm',
                'type': 'Normal',
                'metadata':
                    {
                        'uid': '23cd70e3-f734-11e6-9702-02601838e5ba',
                        'namespace': 'default',
                        'resourceVersion': '419563',
                        'creationTimestamp': '2017-02-20T06:16:39Z',
                        'selfLink': '/api/v1/namespaces/default/events/de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045',
                        'name': 'de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045'
                    }
        }
    ]
}

Dev environment API

查看所有开发环境(GET /cloud_ml/v1/dev)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

输出格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{"error": True, "message": "DevEnv doesn't exist"}

成功返回结果:

{
    "data": [
    {
    "org_id": self.org_id,
    "org_name": self.org_name,
    "dev_name": self.dev_name,
    "password": self.password,
    "notebook_port": str(self.notebook_port),
    "ssh_port": str(self.ssh_port),
    "tensorboard_port": str(self.tensorboard_port),
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.notebook_port)},
    "ssh_address": settings.K8S_NODEPORT_SERVER + ":" + str(self.ssh_port)
    }
    ]
}

创建开发环境(POST /cloud_ml/v1/dev)

URL参数格式:同上。

Header格式:同上。

POST数据样例:

{
    "dev_name": "dev1",
    "password": "password1",
    "cpu_limit": 0.5, (optional)
    "memory_limit": "100M", (optional)
    "gpu_limit": 0, (optional)
}

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "xxxX"}
资源不存在404{"error": True, "message": "DevEnv doesn't exist"}
资源不足413{"error": True, "message": "Quota not enough"}
内部错误503{"error": True, "message": "Failed to create dev or consume quota in XX, Except: XX"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "dev_name": self.dev_name,
    "password": self.password,
    "notebook_port": str(self.notebook_port),
    "ssh_port": str(self.ssh_port),
    "tensorboard_port": str(self.tensorboard_port),
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.notebook_port),
    "ssh_address": settings.K8S_NODEPORT_SERVER + ":" + str(self.ssh_port)
}

查看开发环境详情(GET /cloud_ml/v1/dev/$dev_name)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{"error": True, "message": "DevEnv doesn't exist"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "dev_name": self.dev_name,
    "password": self.password,
    "notebook_port": str(self.notebook_port),
    "ssh_port": str(self.ssh_port),
    "tensorboard_port": str(self.tensorboard_port),
    "cpu_limit": self.cpu_limit,
    "memory_limit": self.memory_limit,
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.notebook_port),
    "ssh_address": settings.K8S_NODEPORT_SERVER + ":" + str(self.ssh_port)
}

删除开发环境(DELETE /cloud_ml/v1/dev/$dev_name)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200{"message": "Successfully request to delete train job."}
认证失败401{"error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{"error": True, "message": "DevEnv doesn't exist"}
内部错误503{ "error": True, "message": "Fail to delete dev env: xxx, exception: xxx"}

查看开发环境事件信息(GET /cloud_ml/v1/dev/$dev_name/events)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参考下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

成功返回结果:

{
    "data": [
        {
            'count': 1,
            'firstTimestamp': '2017-02-20T06:16:39Z',
            'lastTimestamp': '2017-02-20T06:16:39Z',
            'source':
            {
                'component': 'default-scheduler'
            },
            'reason': 'Scheduled',
            'involvedObject':
            {
                'kind': 'Pod',
                'uid': '23cbc120-f734-11e6-9702-02601838e5ba',
                'namespace': 'default',
                'apiVersion': 'v1',
                'resourceVersion': '419556',
                'name': 'de-999-dev4-061636-4150936070-5tgzu'
            },
            'message': 'Successfully assigned de-999-dev4-061636-4150936070-5tgzu to minikubevm',
            'type': 'Normal',
            'metadata':
                {
                    'uid': '23cd70e3-f734-11e6-9702-02601838e5ba',
                    'namespace': 'default',
                    'resourceVersion': '419563',
                    'creationTimestamp': '2017-02-20T06:16:39Z',
                    'selfLink': '/api/v1/namespaces/default/events/de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045',
                    'name': 'de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045'
                }
        }
    ]
}

Tensorboard Service API

查看所有模型服务(GET /cloud_ml/v1/tensorboard)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

成功返回结果:

{
    "data": [
        {
            "org_id": self.org_id,
            "org_name": self.org_name,
            "tensorboard_name": self.tensorboard_name,
            "logdir": self.logdir,
            "service_port": str(self.service_port),
            "state": self.state,
            "create_time": str(self.create_time),
            "update_time": str(self.update_time),
            "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.service_port)
        }
    ]
}

创建模型服务(POST /cloud_ml/v1/tensorboard)

URL参数格式:同上。

Header格式:同上。

POST数据样例:

{
    "tensorboard_name": "mnist",
    "logdir": "fds://cloudml-tensorboard-test/mnist_logs",
}

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Invalid argument: xxx."}
资源不存在404{"error": True, "message": "TensorboardService doesn't exist"}
资源不足413{"error": True, "message": "Quota not enough"}
内部错误503{ "error": True, "message": "Failed to create tensorboard or consume quota in XX"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "tensorboard_name": self.tensorboard_name,
    "logdir": self.logdir,
    "service_port": str(self.service_port),
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.service_port)
}

查看模型服务详情(GET /cloud_ml/v1/tensorboard/$tensorboard_name)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{ "error": True, "message": "TensorboardService doesn't exist"}

成功返回结果:

{
    "org_id": self.org_id,
    "org_name": self.org_name,
    "tensorboard_name": self.tensorboard_name,
    "logdir": self.logdir,
    "service_port": str(self.service_port),
    "state": self.state,
    "create_time": str(self.create_time),
    "update_time": str(self.update_time),
    "address": settings.K8S_NODEPORT_SERVER + ":" + str(self.service_port)
}

删除模型服务(DELETE /cloud_ml/v1/tensorboard/$tensorboard_name)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200{"message": "Successfully request to delete tensorboard service."}
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
资源不存在404{ "error": True, "message": "TensorboardService doesn't exist"}
内部错误503{ "error": True, "message": "Fail to delete tensorboard service: xxx, exception: xxx"}

查看Tensorboard服务事件信息(GET /cloud_ml/v1/tensorboard/$tensorboard_name/events)

URL参数格式:无。

Header格式:同上。

POST数据格式:无。

输入格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝执行403{"error": True, "message": "xxx"}
资源不存在404{"error": True, "message": "Train job doesn't exist"}

成功返回结果:

{
    "data": [
        {
            'count': 1,
            'firstTimestamp': '2017-02-20T06:16:39Z',
            'lastTimestamp': '2017-02-20T06:16:39Z',
            'source':
            {
                'component': 'default-scheduler'
            },
            'reason': 'Scheduled',
            'involvedObject':
            {
                'kind': 'Pod',
                'uid': '23cbc120-f734-11e6-9702-02601838e5ba',
                'namespace': 'default',
                'apiVersion': 'v1',
                'resourceVersion': '419556',
                'name': 'de-999-dev4-061636-4150936070-5tgzu'
            },
            'message': 'Successfully assigned de-999-dev4-061636-4150936070-5tgzu to minikubevm',
            'type': 'Normal',
            'metadata':
                {
                    'uid': '23cd70e3-f734-11e6-9702-02601838e5ba',
                    'namespace': 'default',
                    'resourceVersion': '419563',
                    'creationTimestamp': '2017-02-20T06:16:39Z',
                    'selfLink': '/api/v1/namespaces/default/events/de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045',
                    'name': 'de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045'
                }
        }
    ]
}

Quota API

查看所有Quota信息(GET /cloud_ml/v1/quota)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
认证失败401{ "error": True, "message": "Unauthorized: signature is wrong"}
拒绝请求403{"error": True, "message": "Need org_id parameter."}
资源不存在404{ "error": True, "message": "Quota of 999 doesn't exist!"}
请求错误405{ "error": True, "Support POST/GET only"}

成功返回结果:

[
    {
        'train_memory_quota': '10G 0M 0.0K',
        'train_memory_used': '2G 952M 0.0K',
        'train_cpu_quota': '2000.0',
        'train_cpu_used': '14.4',
        'train_gpu_quota': '0',
        'train_gpu_used': '0',

        'model_memory_quota': '1000G 0M 0.0K',
        'model_memory_used': '1G 500M 0.0K',
        'model_cpu_quota': '10.0',
        'model_cpu_used': '3.5'
        'model_gpu_quota': '0',
        'model_gpu_used': '0',

        'dev_memory_quota': '10G 0M 0.0K',
        'dev_memory_used': '900M 0.0K',
        'dev_cpu_quota': '10.0',
        'dev_cpu_used': '2.5',
        'dev_gpu_quota': '0',
        'dev_gpu_used': '0',
    }
]

Framework API

查看所有Framework信息(GET /cloud_ml/v1/framework)

URL参数格式:同上。

Header格式:同上。

POST数据格式:无。

返回格式:

描述返回码返回数据
成功200参见下面
请求错误405{ "error": True, "Support POST/GET only"}

成功返回结果:

{
    'torch': ['master'],
    'mxnet': ['0.9.0'],
    'keras': ['1.1.1'],
    'xgboost': ['0.60.0'],
    'cntk': ['2.0.0'],
    'caffe': ['0.9.0'],
    'tensorflow': ['0.11.0-xm1.0.0', '0.11.0'],
    'theano': ['0.8.2'],
    'scikitlearn': ['0.17.0']
}