API overview
API standards and multilingual preset SDKs
The OpenAPI of this product (pai-dsw/2022-01-01) uses the ROA signature style. We have encapsulated SDKs for common programming languages for developers. Developers can download the SDK to directly call this product's OpenAPI without worrying about technical details. If the existing SDK does not meet your needs, you can use the signature mechanism for self-signing integration. Since the details of self-signing are very complex, it may take around 5 business days. Therefore, we recommend joining our DingTalk service group (147535001692) and conducting signature integration under expert guidance.
Before using the API, you need to prepare your identity account and access key (AccessKey) to effectively access the API through client tools (such as SDK and CLI). For details, see Obtain an AccessKey.
Custom signature scenarios
If your business scenario has special requirements and you need to integrate the API through self-signing, we recommend consulting our technical support team first (DingTalk service group: 147535001692) to obtain professional guidance and ensure efficient integration.
Account and security preparation
Alibaba Cloud accounts have full administrative permissions over all resources. Once an AccessKey is compromised, all associated resources will be at risk of unauthorized access. To ensure security, it is recommended to create a RAM user with only API access permissions and configure its AccessKey, while configuring RAM policies based on the principle of least privilege (PoLP). Use the Alibaba Cloud account only in specific scenarios where Alibaba Cloud account permissions are explicitly required.
Instances
|
API |
Title |
Description |
| CreateInstance | Create an instance | Creates a DSW instance. |
| DeleteInstance | DeleteInstance | Deletes a specific instance. |
| UpdateInstance | Update instance | Updates the attributes of a DSW instance. |
| StartInstance | Start an instance | Starts a DSW instance. |
| StopInstance | Stop an instance | Stops a DSW instance. |
| GetInstance | Query instance details | Queries the details of a DSW instance. |
| ListInstances | List instances | Queries a list of DSW instances. |
| GetInstanceEvents | Retrieve the event list for an instance | Retrieves the system events of a DSW instance. |
| UpdateInstanceLabels | UpdateInstanceLabels | Updates the tags of a Data Science Workshop (DSW) instance. If the tags do not exist, the system adds tags. |
| DeleteInstanceLabels | Delete instance tags | Deletes the tags of a DSW instance. |
| DeleteInstances | Delete multiple instances | Deletes multiple instances. |
| StopInstances | Stop multiple instances | Stops multiple instances. |
Lifecycle
|
API |
Title |
Description |
| GetLifecycle | Retrieve instance lifetime | Retrieves the lifecycle of an instance. |
Resource monitoring
|
API |
Title |
Description |
| GetInstanceMetrics | Retrieve instance metrics | Retrieves the resource metrics of a running instance. |
Instance snapshots
|
API |
Title |
Description |
| CreateInstanceSnapshot | Create an instance snapshot | Creates an instance snapshot. |
| DeleteInstanceSnapshot | Delete an instance snapshot | Deletes an instance snapshot. |
| GetInstanceSnapshot | Retrieve an instance snapshot | Retrieves an instance snapshot. |
| ListInstanceSnapshot | List instance snapshots | Queries a list of instance snapshots. |
Statistics
|
API |
Title |
Description |
| GetResourceGroupStatistics | Retrieve resource group statistics | Queries the statistics of Data Science Workshop (DSW) instances running in a specified resource group. A resource group is a set of dedicated machine resources purchased by a user before using Machine Learning Platform for AI (PAI). These resources are exclusive to the user and are not shared with others. Subsequent PAI computing tasks or algorithm development environments run on these machines. This operation retrieves the current and historical running statuses, such as success, failure, and stopped, of DSW instances in the specified resource group to help users understand task history and utilize machine resources more efficiently. |
| ListInstanceStatistics | Retrieve instance statistics information | Retrieves instance statistics information. |
Scheduled automatic shutdown
|
API |
Title |
Description |
| CreateInstanceShutdownTimer | Create a scheduled shutdown task for an instance | Creates a scheduled shutdown task for an instance. |
| DeleteInstanceShutdownTimer | Delete the scheduled shutdown task for an instance | Deletes the scheduled shutdown task for an instance. |
| GetInstanceShutdownTimer | Retrieve scheduled shutdown task details for an instance | Retrieves the details of a scheduled shutdown task for an instance. |
Automatic shutdown of idle instances
|
API |
Title |
Description |
| CreateIdleInstanceCuller | Create an automatic shutdown policy for idle instances | Creates an automatic shutdown policy for a specified instance to automatically stop the Data Science Workshop (DSW) instance when specific conditions are met. Only one idle automatic shutdown policy is supported per DSW instance. If an idle automatic shutdown policy is already configured for the specified instance, call DeleteIdleInstanceCuller to delete it first. |
| DeleteIdleInstanceCuller | Delete the idle shutdown policy for an instance | Deletes the idle shutdown policy for an instance. |
| GetIdleInstanceCuller | Retrieve idle instance auto-shutdown policy | Retrieves the idle auto-shutdown policy for a specified instance. |
ECS instance types
|
API |
Title |
Description |
| ListEcsSpecs | Retrieve the list of ECS instance types | Retrieves the list of ECS instance types. |
User configurations
|
API |
Title |
Description |
| GetUserConfig | Query user information | Queries user information by calling GetUserConfig. |
Others
|
API |
Title |
Description |
| CreateDiagnosis | Diagnose instance issues | Diagnoses instance issues. |
| GetToken | Retrieve temporary authentication information for an instance | Retrieves the temporary authentication information for a specified DSW instance. |
| GetMetrics | Retrieve metrics | Retrieves the metrics of an instance. |
| GetUserCommand | Retrieve user-defined commands | Retrieves user-defined commands. |
| CreateTempFile | Create a temporary file | Creates a temporary file. |
| UpdateTempFile | Update temporary file information | Updates a temporary file. |
| DeleteTempFile | Delete a temporary file | Deletes a temporary file. |
| GetTempFile | Retrieve temporary file information | Retrieves the details of a temporary file. |
| ListTempFiles | List temporary file information | Retrieves the list of temporary files. |
| DeleteTempFileTask | Delete temporary file task | Deletes a temporary file. |
| UpdateTempFileTask | Update temporary file task information | Updates a temporary file task. |
| CreateTempFileTask | Create a temporary file task | Creates a temporary file task. |
| GetTempFileTask | Retrieve temporary file task information | Retrieves a temporary file task. |
| QueryAutoShutdownPolicies | Query auto-shutdown policies | Retrieves the auto-shutdown policy information for specified running instances. |
| DeleteTempFileTasks | Batch delete temporary file tasks | Deletes temporary files. |
| GetSanityCheckTask | Query health check task status and results | Queries the current status and results of a specified health check task. By specifying the task ID and check type, you can obtain the execution progress of the task (such as Pending, Executing, Completed, or Failed), start and end times, and a list of identified issues. If verbose is set to true in the request, detailed analysis results for each checkpoint are also returned, including the checkpoint name, description, result, and failure reason to help accurately identify issues. |
| CreateSanityCheckTask | Submit an asynchronous health check task for a DSW instance | Submits an asynchronous health check task for a specified Data Science Workshop (DSW) instance. You must specify the check type, such as SSH, and the instance ID. The system immediately returns a unique task ID to indicate that the task is successfully queued. This operation is non-blocking and suitable for scenarios that require fast responses. You can use the task ID to query the execution status and detailed results later. |
| TerminateInstanceSnapshot | Abort instance snapshot task | Aborts a running image saving task. |