Prolonging a Notebook Instance
Function
This API is used to prolong the running time of a running notebook instance. This API applies to the following scenarios: When you need to prolong the running time of a notebook instance to complete long-time tasks, you can call this API to do so. Before using this API, ensure that you have logged in to the system and have the permission to perform operations on the target notebook instance. In addition, the notebook instance must be running. After this API is called, the system prolongs the running time of the specified notebook instance, so that you can continue to use it. If you do not have the permission to perform operations on the specified notebook instance or the notebook instance is not running, the API will return an error message.
Constraints
No constraints
Debugging
You can debug this API through automatic authentication in API Explorer or use the SDK sample code generated by API Explorer.
URI
PATCH /v1/{project_id}/notebooks/{id}/lease
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
id |
Yes |
String |
Definition: Notebook instance ID. The ID is in the format of a Universally Unique Identifier (UUID). For details about how to obtain the ID, see Querying Notebook Instances. Constraints: N/A Range: N/A Default Value: N/A |
project_id |
Yes |
String |
Definition: Project ID. For details, see Obtaining a Project ID and Name. Constraints: N/A Range: N/A Default Value: N/A |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
duration |
No |
Long |
Definition: Renewal duration (unit: ms). It is recommended that this parameter be set in leaseReq. If the query parameters include duration, the value set in leaseReq is ignored and the instance is stopped as scheduled. Constraints: N/A Range: 3600000 to 259200000 Default Value: 3600000 |
Request Parameters
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
duration |
No |
Long |
Definition: The instance stops as scheduled. Its runtime is measured in milliseconds starting now. Constraints: N/A Range: 3600000 to 259200000 Default Value: 3600000 |
type |
No |
String |
Definition: Auto stop type. Constraints: N/A Range:
Default Value: TIMING |
Response Parameters
Status code: 200
Parameter |
Type |
Description |
---|---|---|
create_at |
Long |
Definition: UTC time when the instance is created, accurate to millisecond. Range: N/A |
duration |
Long |
Definition: Instance runtime, which is calculated based on the instance creation time. If the instance creation time plus the runtime is greater than the current time, the system automatically stops the instance. Range: N/A |
enable |
Boolean |
Definition: Specifies whether to enable auto stop. Range: Boolean
|
type |
String |
Definition: Auto stop type. Range:
|
update_at |
Long |
Definition: Time (UTC) when the instance is last updated (excluding liveness check), accurate to millisecond. Range: N/A |
Status code: 204
No content
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.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot