Modifying the Description of a Development Environment Instance
Function
This API is used to modify the description of a development environment instance or information about the auto stop function.
URI
PUT /v1/{project_id}/demanager/instances/{instance_id}
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
project_id |
Yes |
String |
Project ID. For details about how to obtain a project ID, see Obtaining a Project ID and Name. |
instance_id |
Yes |
String |
Instance ID |
Request Body
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
description |
No |
String |
Configuration description. The value contains a maximum of 512 characters and cannot contain the following special characters: &<>"'/. |
spec |
No |
Object |
Instance definition. For details, see Table 3. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
auto_stop |
No |
Object |
Auto stop parameter. For details, see Table 4. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
enable |
No |
Boolean |
Whether to enable the auto stop function. The value true indicates that the function is enabled and the instance will automatically stop when the running duration is reached. The value false indicates that the function is disabled. The default value is false. |
duration |
No |
Integer |
Running duration, in seconds. The value ranges from 3,600 to 86,400. After this parameter is set, it is valid for each startup. This parameter is mandatory when enable is set to true. If the current instance status is Running, the modifications of this parameter take effect only after the next startup. |
prompt |
No |
Boolean |
Whether to display a prompt again. This parameter is provided for the console to determine whether to display a prompt again. The default value is true. |
Response Body
Parameter |
Type |
Description |
---|---|---|
id |
String |
Instance ID |
name |
String |
Instance name |
description |
String |
Instance description |
status |
String |
Instance status |
creation_timestamp |
String |
Time when an instance is created |
latest_update_timestamp |
String |
Time when an instance is modified |
profile |
Object |
Configurations. For details, see Table 12. |
flavor |
String |
Instance flavor |
flavor_details |
Object |
Flavor details. For details, see Table 16. |
pool |
Object |
Dedicated resource pool. For details, see Table 17. |
spec |
Object |
Instance specifications. For details about notebook, see Table 14. |
workspace |
Object |
Workspace. For details, see Table 7. |
ai_project |
Object |
AI project. For details, see Table 12. |
error_code |
String |
Error code. For details, see Error Codes. |
queuing_info |
Object |
Queuing information. For details, see Table 26. |
user |
Object |
User information. For details, see Table 27. |
repository |
Object |
Git repository. For details, see Table 28. This parameter cannot be used. It is automatically returned when the API is called. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Configuration ID |
name |
String |
Configuration name |
description |
String |
Configuration description |
de_type |
String |
Development environment type. Only Notebook is supported. |
provision |
Object |
Deployment information. For details, see Table 4. |
labels |
Map<String,String> |
Labels |
flavor_type |
String |
Hardware, which can be CPU,, Ascend, or GPU |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Deployment type. Only Docker is supported. |
spec |
Object |
Deployment details. For details, see Table 8. |
Parameter |
Type |
Description |
---|---|---|
engine |
String |
Deployment engine. Only CCE is supported. |
params |
Object |
Deployment parameters. Only Docker is supported. For details, see Table 9. |
Parameter |
Type |
Description |
---|---|---|
name |
String |
Flavor name |
status |
String |
Flavor sales status. Options:
|
queuing_num |
Integer |
Mandatory when promo_type is set to Free and status is set to soldOut |
queue_left_time |
Integer |
Remaining time for being queued, in seconds Mandatory when promo_type is set to Free and status is set to soldOut |
storage_list |
Array< storageType > |
Supported storage types, which default to all
|
is_permitted |
Boolean |
Whether the current user has the permission to use this flavor |
type |
String |
Flavor type. Options:
|
params |
Dict |
Parameters that describe flavors |
promo_type |
String |
Promotion type. Options:
|
instance_num |
Integer |
Number of instances of this flavor created by the current user |
duration |
Integer |
Auto stop time after startup, in seconds |
store_time |
Integer |
Maximum retention period of an inactive instance of this flavor in the database, in hours The default value is -1, indicating that the instance can be permanently saved. |
billing_flavor |
String |
Billing specifications. If this field is left blank, the specification name is used for billing. |
billing_params |
Integer |
Billing ratio. This parameter is mandatory if billing_flavor is specified. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
ID of a resource pool |
name |
String |
Name of a resource pool |
type |
String |
Type of a resource pool. USER_DEFINED indicates a dedicated resource pool. |
owner |
Object |
This parameter is mandatory when type is set to USER_DEFINED. For details, see Table 13. |
Parameter |
Type |
Description |
---|---|---|
log_path |
String |
Path for storing custom image logs |
custom_script_path |
String |
Path for storing custom initialization scripts used when a notebook instance is started |
extend_storage |
Array<Storage> |
Extended storage list. For details, see Table 4. Extended storage supports only obsfs and is available only for certain dedicated resource pools. |
storage |
Object |
Storage path. For details, see Table 4. |
credential |
Object |
AK and SK for accessing OBS. For details, see Table 30. |
repository |
Object |
Git repository information. For details, see Table 28. This parameter cannot be used. It is automatically returned when the API is called. |
resource_reserved_timestamp |
Integer |
Time when the resource is reserved |
auto_stop |
Object |
Auto stop parameter. For details, see Table 6. |
failed_reasons |
Object |
Cause for a creation or startup failure. For details, see Table 22. |
annotations |
Map<String,String> |
Annotations The generated URL cannot be directly accessed. |
extend_params |
Map<String,String> |
Extended parameters |
Parameter |
Type |
Description |
---|---|---|
type |
String |
Storage type. Only obs, obsfs, and evs are supported. Additionally, obsfs can only be used in certain dedicated resource pools. To mount an OBS parallel file system, submit a service ticket. |
location |
Object |
Storage location. If type is set to obs, this parameter is mandatory. See Table 16. By default, this parameter is left blank. |
Parameter |
Mandatory |
Type |
Description |
---|---|---|---|
path |
No |
String |
Storage path
|
volume_size |
No |
Integer |
EVS disk size. The minimum size is 5 GB and the maximum size is 4096 GB. The default value is 5 GB. If type is set to obs, this parameter does not need to be set. |
mount_path |
No |
String |
Mount path in a notebook instance. This parameter is valid only when type is set to obsfs. The default value is /home/ma-user/work. To mount the file system to a specified path, set the value to the subdirectory of /home/ma-user/work. Otherwise, the mounting may fail or read/write exceptions may occur due to permission issues. |
access_modes |
No |
String |
Access permission for the mounted file or folder. The permission can be read/write or read-only. This parameter is valid only when type is set to obsfs. Options:
|
Parameter |
Type |
Description |
---|---|---|
enable |
Boolean |
Whether to enable the auto stop function |
duration |
Integer |
Running duration, in seconds |
prompt |
Boolean |
Whether to display a prompt again. This parameter is provided for the console to use. |
stop_timestamp |
Integer |
Time when the instance stops. The value is a 13-digit timestamp. |
remain_time |
Integer |
Remaining time before actual stop, in seconds |
Parameter |
Type |
Description |
---|---|---|
code |
String |
Error code |
message |
String |
Error message |
detail |
Map<String,String> |
Error details |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Workspace ID If no workspace is created, the default value is 0. If a workspace is created and used, use the actual value. |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Instance ID |
name |
String |
Instance name |
de_type |
String |
Development environment type. By default, all types are returned. Only Notebook is supported. |
flavor |
String |
Instance flavor. By default, all types are returned. Options:
|
flavor_details |
Object |
Flavor details, which display the flavor information and whether the flavor is sold out. For details, see Table 16. |
status |
String |
Instance status. By default, all statuses are returned. Options:
|
begin_timestamp |
Integer |
Time when an instance starts queuing, which is a 13-digit timestamp |
remain_time |
Integer |
Remaining time for being queued, in seconds |
end_timestamp |
Integer |
Time when an instance completes queuing, which is a 13-digit timestamp |
rank |
Integer |
Ranking of an instance in a queue |
Parameter |
Type |
Description |
---|---|---|
id |
String |
User ID |
name |
String |
Username |
Parameter |
Type |
Description |
---|---|---|
id |
String |
Repository ID |
branch |
String |
Repository branch |
user_name |
String |
Repository username |
user_email |
String |
Repository user mailbox |
type |
String |
Repository type, which can be CodeClub or GitHub |
connection_info |
Object |
Repository connection. For details, see Table 29. |
Parameter |
Type |
Description |
---|---|---|
protocol |
String |
Repository link protocol, which can be ssh or https |
url |
String |
Repository link address |
credential |
Object |
Certificate information. For details, see Table 30. |
Parameter |
Type |
Description |
---|---|---|
ssh_private_key |
String |
SSH private certificate |
access_token |
String |
OAuth token of GitHub |
Sample Request
The following shows how to modify the details about instance 6fa459ea-ee8a-3ca4-894e-db77e160355e.
{ "description": "machine learning python2.7 notebook" }
Sample Response
- Successful response
{ "ai_project": { "id": "default-ai-project" }, "creation_timestamp": "1594887749962", "description": "update notebook", "flavor": "modelarts.bm.gpu.v100NV32", "flavor_details": { "name": "modelarts.bm.gpu.v100NV32", "params": { "CPU": 8, "GPU": 1, "gpu_type": "v100NV32", "memory": "64GiB" }, "status": "onSale", "type": "GPU" }, "id": "DE-7d558ef8-c73d-11ea-964c-0255ac100033", "latest_update_timestamp": "1594888143062", "name": "notebook-c6fd", "profile": { "de_type": "Notebook", "description": "multi engine, gpu, python 3.6 for notebook", "flavor_type": "GPU", "id": "Python3-gpu", "name": "Python3", "provision": { "spec": { "engine": "CCE", "params": { "annotations": null, "image_name": "mul-kernel-gpu-cuda-cp36", "image_tag": "2.0.5-B003", "namespace": "atelier" } }, "type": "Docker" } }, "status": "RUNNING", "user": { "id": "15dda26361214ca2a5953917d2f48ffb", "name": "ops_dev_env" }, "workspace": { "id": "0" } }
- Failed response
{ "error_message": "The instance does not exist.", "error_code": "ModelArts.6309" }
Status Code
For details about the status code, see Status Code.
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