Create custom runtime API
You can use this API to create a custom runtime.
HTTP method and URI path
POST /v4/runtimes
Standard headers
Use the following standard HTTP header with this request:
Content-Type: application/json
Authorization: <Bearer token>
Required authorizations
The user ID associated with the token which is specified in the request header needs to be granted with one of the following roles:
- sysadm
- mladm
- apiuser
- devuser
- appuser
Request body
| Parameter | Type | Required or optional | Description |
|---|---|---|---|
| tags | Array | Optional |
An array of tags for the runtime. Each tag includes following two fields.
|
| name | String | Required | The name of the custom runtime. |
| description | String | Optional | The description of the runtime. |
| platform | JSON object | Required |
|
| custom_libraries | Array | Optional |
An array of the libraries in the runtime. Each element includes:
|
| system_defined | Boolean | Optional | Indicates if this runtime is pre-defined in the system (true if it is). If missing (default is false), it indicates that this is a user defined runtime. |
| services | String | Optional |
The services by which this custom runtime is used. For example, [“training”, “scoring”]. It indicates the custom runtime can be used as training or scoring. |
{
"name": "runtimes_0413",
"description": "runtime spec created for custom libraries",
"platform": {
"name": "spark",
"version": "4.0"
},
"tags": [
{
"value": "ProjectA",
"description": "ProjectA description"
}
],
"custom_libraries": [
{
"href": "/v4/libraries/64a7e2c8-3cb0-4d18-bf65-b66ea32dd39f"
}
] ,
"system_difined": false,
"services": ["training", "scoring"]
}
Expected response
On completion, the service returns an HTTP response, which includes a status code that indicates whether your request is completed. Status code 201 indicates a successful completion. A status code of 4nn or 5nn indicates an error.
| Parameter | Value | Description |
|---|---|---|
| location | /v4/runtime/<runtime_id> | Location of the newly created runtime. |
| Content-type | application/json | The type of the response body. |
| Field | Subfield | Description |
|---|---|---|
| Entity | name | The name of the runtime. |
| platform | The platform of the runtime, including:
|
|
| custom_libraries |
An array of the libraries in the runtime. Each element includes:
|
|
| description | The description of the runtime. | |
| space | Internal library space. It can’t be changed in system. We use a static space ID.
|
|
| system_defined | Indicates if this runtime is pre-defined in the system (true if it is). If missing (default is false), it indicates that this is a user defined runtime. |
|
| tags | An array of tags for the library. Each tag includes following two fields.
|
|
| services |
The services by which this custom runtime is used. For example, [“training”, “scoring”]. It indicates the custom runtime can be used as training or scoring. |
|
| metadata | guid | The unique ID of the runtime. |
| id | The unique ID of the runtime. Same as guid. | |
| href | The URI of the runtime. | |
| owner | The ID of the user that created this runtime. | |
| created_at | The creation timestamp of the runtime. | |
| modified_at | The timestamp of the last modification of the runtime. |
{
"entity": {
"custom_libraries": [
{
"href": "/v4/libraries/64a7e2c8-3cb0-4d18-bf65-b66ea32dd39f",
"id": "64a7e2c8-3cb0-4d18-bf65-b66ea32dd39f"
}
],
"description": "runtime spec created for custom libraries",
"name": "runtimes_0413",
"platform": {
"name": "spark",
"version": "4.0"
},
"services": [
"training",
"scoring"
],
"space": {
"href": "/v4/spaces/017cbc6c-7a49-4c44-956c-8a0c26a3f76d",
"id": "017cbc6c-7a49-4c44-956c-8a0c26a3f76d"
},
"system_defined": false,
"tags": [
{
"description": "ProjectA description",
"value": "ProjectA"
}
]
},
"metadata": {
"created_at": "2022-11-29T02:06:45.648Z",
"guid": "1f7588d1-ed17-4bde-b611-ca8e4eba7e1c",
"href": "/v4/runtimes/1f7588d1-ed17-4bde-b611-ca8e4eba7e1c",
"id": "1f7588d1-ed17-4bde-b611-ca8e4eba7e1c",
"modified_at": "2022-11-29T02:06:45.648Z",
"owner": "wmlz01"
}
}