• Workspace

workspace
  1. Help Center
  2. Workspace
  3. API Reference
  4. Desktops
  5. Restarting Desktops

Restarting Desktops

Function

This interface is used to restart a desktop.

URI

  • URI format

    POST /v1.0/{project_id}/desktops/{desktop_id}/action

  • URI parameter description

    Parameter

    Mandatory

    Type

    Description

    project_id

    Yes

    string

    Specifies the user ID.

    desktop_id

    Yes

    string

    Specifies the desktop ID.

Request

  • Request body parameter description

    Parameter

    Mandatory

    Type

    Description

    reboot

    Yes

    Dictionary data structure [1]

    Specifies the operation of restarting the desktop.

[1] reboot field data structure description

Name

Mandatory

Type

Description

type

Yes

string

Specifies the restart mode:

  • SOFT: soft restart
  • HARD: hard restart
  • Request example
    POST /v1.0/29dfe82ada564ac2b927e1ff036d9a9b/desktops/bae51750-0089-41a1-9b18-5c777978ff6d/action 
    Request Body: 
    { 
       "reboot": { 
          "type": "SOFT" 
       } 
    }

Response

No response body

Returned Values

  • Normal

    202

  • Abnormal

    Returned Value

    Description

    400 Bad Request

    The request syntax is incorrect and cannot be understood by the server.

    401 Unauthorized

    Authentication fails.

    403 Forbidden

    You are not authorized to perform the operation.

    404 Not Found

    The requested resource is not found.

    405 Method Not Allowed

    The method specified in the request is not allowed.

    500 Internal Server Error

    Internal service error. For details about error codes, see Error Code Description.

    503 Service Unavailable

    The service is unavailable.