Prolonging a Notebook Instance¶
Function¶
This API is used to prolong the running time of a running notebook instance.
Constraints¶
None
URI¶
PATCH /v1/{project_id}/notebooks/{id}/lease
Parameter | Mandatory | Type | Description |
---|---|---|---|
id | Yes | String | Notebook instance ID, which can be obtained by calling the API for querying the notebook instance list. |
project_id | Yes | String | Project ID. For details, see Obtaining a Project ID and Name. |
Parameter | Mandatory | Type | Description |
---|---|---|---|
duration | No | Long | Renewal duration. You are advised to set this parameter in leaseReq. If the request parameter contains duration, the value of leaseReq is ignored and the automatic instance stop type is scheduled stop. (Unit: ms) |
Request Parameters¶
Parameter | Mandatory | Type | Description |
---|---|---|---|
duration | No | Long | Indicates the running duration starting from the current time. After the running duration expires, the system automatically stops. Unit: ms. |
type | No | String | Automatic stop type. The default value is timing. |
Response Parameters¶
Status code: 200
Parameter | Type | Description |
---|---|---|
create_at | Long | Time (UTC) when the instance is created, accurate to millisecond. |
duration | Long | Instance running duration, which is calculated based on the instance creation time. If the instance creation time plus the duration is greater than the current time, the system automatically stops the instance. |
enable | Boolean | Whether to enable auto stop of the instance. |
type | String | Indicates the automatic stop type.
|
update_at | Long | Time when the instance is last updated (excluding the heartbeat detection time), in UTC milliseconds. |
Example Requests¶
Prolong the duration of a running notebook instance.
https://{endpoint}/v1/{project_id}/notebooks/{id}/lease
{
"duration" : 3600000,
"type" : "timing"
}
Example Responses¶
Status code: 200
OK
{
"create_at" : 1638841744515,
"duration" : 3600000,
"enable" : true,
"type" : "TIMING",
"update_at" : 1638843018759
}
Status Codes¶
Status Code | Description |
---|---|
200 | OK |
204 | No Content |
401 | Unauthorized |
403 | Forbidden |
Error Codes¶
See Error Codes.