API Documentation

Introduction

The Xiaomi Cloud-ML project exposes the API access interface. The full functionality of the Xiaomi Cloud-ML service can be accessed via the APIs, SDKs, or command-line tools.

Training Job API

View all training tasks (Get/cloud_ml/v1/train)

URL Parameter Format: None.

Header Format:

Header Name Type is It Required Description
X-Xiaomi-Timestamp String Yes Requested timestamp
X-Xiaomi-Content-MD5 String Yes POST content request from MD5
X-Xiaomi-Secret-Key-Id String Yes User access key
Authorization String Yes Requested signature

Post Data Format: None.

Input Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{
    "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
        }
    ]
}

Create Training Task(POST /cloud_ml/v1/train)

URL Parameter Format: Ibid.

Header Format:Ibid.

Sample of Data 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)
}
Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Invalid argument: xxx."}
Lack of resources 413 {"error": True, "message": "xxx"}

Results Returned Successfully:

{
    "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
}

View Training Task Details(GET /cloud_ml/v1/train/$job_name)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": “xxx”}
Request rejected 403 {"error": True, "message": "Invalid argument: xxx."}
Resources do not exist 404 { "error": True, "message": "TrainJob doesn't exist"}

Results Returned Successfully:

{
    "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 Training Task(DELETE /cloud_ml/v1/train/$job_name)

URL Parameter Format: Ibid.

Header format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 {"message": "Successfully request to delete train job."}
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter"}
Resources do not exist 404 {"error": True, "message": "TrainJob doesn't exist"}
Internal error 503 { "error": True, "message": "Exception: xxx"}

View Training Task log(GET /cloud_ml/v1/train/$job_name/logs)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 {"logs": "xxx"}
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

View Training Task Event Information(GET /cloud_ml/v1/train/$job_name/events)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Input Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{' Data ': [{' Count ': 1, ' firsttimestamp ': ' 2017-02-20t06:16:39z ', ' Lastt Imestamp ': ' 2017-02-20t06:16:39z ', ' source ':
                {
                    'component': 'default-scheduler'
                }, ' reason ': ' Schedul  Ed ', ' 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-f7 34-11e6-9702-02601838e5ba ', ' namespace ': ' Default ', ' resourceversion ': ' 41 9563 ', ' creationtimestamp ': ' 2017-02-20t06:16:39z ', ' selflink ': '/api/v1/n amespaces/default/events/de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045 ', ' name ': ' De-999-de v4-061636-4150936070-5tgzu.14a4ea4e5db78045 '}}]}

Tensorboard Service API

See All Model Services(GET /cloud_ml/v1/model)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{
    "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
        }
    ]
}

Create Model Service(POST /cloud_ml/v1/model)

URL Parameter Format: Ibid.

Header Format: Ibid.

Sample of Data Post

{    "job_name": "linear1",    "module_name": "",
    "trainer_uri": "fds://cloud-ml-test/linear/trainer-1.1",
    "job_args": "--max_epochs=0.5 --optimizer ftrl",  (optional)
    "cpu_limit": 100, (optional)
    "memory_limit": "0,M", (optional)
    "gpu_limit": 3, (optional)
    "ps_count":  (optional)
    "worker_count":  (optional)
}

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Invalid argument: xxx."}
Lack of resources 413 {"error": True, "message": "xxx"}
Internal error 503 {"error": True, "message": "Failed to create model or consume quota in XX"}

Results Returned Successfully:

{
    "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
        }
    ]
}

See model service details(GET /cloud_ml/v1/model/$model_name/$model_version)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 { "error": True, "message": "Need org_id parameter."}
Resources do not exist 404 {"error": True, "message": "ModelService doesn't exist"}

Results Returned Successfully:

{
    "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
        }
    ]
}

Delete Model Service(DELETE /cloud_ml/v1/model/$model_name/$model_version)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 {"message": "Successfully request to delete model service."}
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 {"error": True, "message": "ModelService doesn't exist"}
Internal error 503 {"error": True, "message": "Fail to delete model service: xxx, exception: xxx"}

See model log service details(GET /cloud_ml/v1/model/$model_name/$model_version/logs)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 {"Data": [{}]
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

View Model Service event information(GET /cloud_ml/v1/model/$model_name/$model_version/events)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Input Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{' Data ': [{' Count ': 1, ' firsttimestamp ': ' 2017-02-20t06:16:39z ', ' Lastt Imestamp ': ' 2017-02-20t06:16:39z ', ' source ':
                {
                    'component': 'default-scheduler'
                }, ' reason ': ' Schedul  Ed ', ' 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-f7 34-11e6-9702-02601838e5ba ', ' namespace ': ' Default ', ' resourceversion ': ' 41 9563 ', ' creationtimestamp ': ' 2017-02-20t06:16:39z ', ' selflink ': '/api/v1/n amespaces/default/events/de-999-dev4-061636-4150936070-5tgzu.14a4ea4e5db78045 ', ' name ': ' De-999-de v4-061636-4150936070-5tgzu.14a4ea4e5db78045 '}}]}

Dev Environment API

View All Development Environments(GET /cloud_ml/v1/dev)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Output Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 {"error": True, "message": "DevEnv doesn't exist"}

Results Returned Successfully:

{
    "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
        }
    ]
}

Create Development Environment(POST /cloud_ml/v1/dev)

URL Parameter Format: Ibid.

Header Format: Ibid.

Sample of Data Post

{    "job_name": "linear1",    "module_name": "",
    "trainer_uri": "fds://cloud-ml-test/linear/trainer-1.1",
    "job_args": "--max_epochs=0.5 --optimizer ftrl",  (optional)
    "cpu_limit": 100, (optional)
    "memory_limit": "0,M", (optional)
    "gpu_limit": 3, (optional)
    "ps_count":  (optional)
    "worker_count":  (optional)
}

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "DevEnv doesn't exist"}
Lack of resources 413 {"error": True, "message": "Quota not enough"}
Internal error 503 {"error": True, "message": "Failed to create dev or consume quota in XX, Except: XX"}

Results Returned Successfully:

{
    "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
        }
    ]
}

View Development Environment Details(GET /cloud_ml/v1/dev/$dev_name)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 {"error": True, "message": "DevEnv doesn't exist"}

Results Returned Successfully:

{
    "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
        }
    ]
}

Delete Development Environment(DELETE /cloud_ml/v1/dev/$dev_name)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 {"message": "Successfully request to delete train job."}
Authentication failed 401 {"error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 {"error": True, "message": "DevEnv doesn't exist"}
Internal error 503 { "error": True, "message": "Fail to delete dev env: xxx, exception: xxx"}

View Development Environment Event Information(GET /cloud_ml/v1/dev/$dev_name/events)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{
    "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

See All Model Services(GET /cloud_ml/v1/tensorboard)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{
    "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
        }
    ]
}

Create Model Service(POST /cloud_ml/v1/tensorboard)

URL Parameter Format: Ibid.

Header Format: Ibid.

Sample of Data Post

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

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Invalid argument: xxx."}
Resources do not exist 404 {"error": True, "message": "TensorboardService doesn't exist"}
Lack of resources 413 {"error": True, "message": "Quota not enough"}
Internal error 503 { "error": True, "message": "Failed to create tensorboard or consume quota in XX"}

Results Returned Successfully:

{
    "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)
}

See Model Service Details(GET /cloud_ml/v1/tensorboard/$tensorboard_name)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 { "error": True, "message": "TensorboardService doesn't exist"}

Results Returned Successfully:

{
    "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 Model Service(DELETE /cloud_ml/v1/tensorboard/$tensorboard_name)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 {"message": "Successfully request to delete tensorboard service."}
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Resources do not exist 404 { "error": True, "message": "TensorboardService doesn't exist"}
Internal error 503 { "error": True, "message": "Fail to delete tensorboard service: xxx, exception: xxx"}

View Tensorboard Service Event Information(GET /cloud_ml/v1/tensorboard/$tensorboard_name/events)

URL Parameter Format: None.

Header Format: Ibid.

Post Data Format: None.

Input Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Refused to execute 403 {"error": True, "message": "xxx"}
Resources do not exist 404 {"error": True, "message": "Train job doesn't exist"}

Results Returned Successfully:

{
    "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

View All Quota Information(GET /cloud_ml/v1/quota)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Authentication failed 401 { "error": True, "message": "Unauthorized: signature is wrong"}
Request rejected 403 {"error": True, "message": "Need org_id parameter."}
Resources do not exist 404 { "error": True, "message": "Quota of 999 doesn't exist!"}
Request error 405 { "error": True, "Support POST/GET only"}

Results Returned Successfully:

[
    {
        '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

View All Framework Information(GET /cloud_ml/v1/framework)

URL Parameter Format: Ibid.

Header Format: Ibid.

Post Data Format: None.

Returned Format:

Description Returned Code Returned Data
Succeeded 200 See below
Request error 405 { "error": True, "Support POST/GET only"}

Results Returned Successfully:

{
    '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']
}