Create a Screen Capture Request

post

/console/screencapture/

Requests a screen capture to be taken on the specified instance. You can take screen captures only on instances which are in the running state. To check the current state of an instance, send the GET /instance/{name} request.

When a screen capture is taken successfully, the state field changes from queued to pending, to in-progress, to uploading, and then finally to complete. You can track the current state of screen capture request by sending the GET /console/screencapture/{name} request.

When the state field changes to complete, you can access the screen capture from the location specified in the media_uri field. For information about retrieving the screen capture from your Oracle Cloud Infrastructure Object Storage Classic instance, see Downloading an Object in Using Oracle Cloud Infrastructure Object Storage Classic. You can take only one screen capture of an instance per minute.

Required Role: To complete this task, you must have the Compute_Operations role. If this role isn't assigned to you or you're not sure, then ask your system administrator to ensure that the role is assigned to you in Oracle Cloud My Services. See Modifying User Roles in Managing and Monitoring Oracle Cloud.

Request

Supported Media Types
Header Parameters
Body ()
The request body contains details of the screen capture request that you want to create.
Root Schema : ScreenCapture-post-request
Type: object
The request body contains details of the screen capture request that you want to create.
Show Source
  • Two-part name of the account (/Compute-identity_domain/cloud_storage) that contains the credentials and access details of the associated Oracle Cloud Infrastructure Object Storage Classic instance.
  • Updated to true to cancel a request or stop a capture.
  • Specify the multipart name of the instance for which you want to create a screen capture.

Response

Supported Media Types

201 Response

Created. See Status Codes for information about other possible HTTP status codes.
Headers
Body ()
Root Schema : ScreenCapture-response
Type: object
Show Source
Nested Schema : cancellation
Type: object
Set of attributes describing the state of cancellation of the screen shot when the cancel parameter is set to true.

Examples

cURL Command

The following example shows how to create a screen capture request by submitting a POST request on the REST resource using cURL. For more information about cURL, see Use cURL.

Enter the command on a single line. Line breaks are used in this example for readability.

curl -i -X POST
     -H "Cookie: $COMPUTE_COOKIE"
     -H "Content-Type: application/oracle-compute-v3+json"
     -H "Accept: application/oracle-compute-v3+json"
     -d "@screencapture.json"
        https://api-z999.compute.us0.oraclecloud.com/console/screencapture/
  • COMPUTE_COOKIE is the name of the variable in which you stored the authentication cookie earlier. For information about retrieving the authentication cookie and storing it in a variable, see Authentication.

  • api-z999.compute.us0.oraclecloud.com is an example REST endpoint URL. Change this value to the REST endpoint URL of your Compute Classic site. For information about finding out REST endpoint URL for your site, see Send Requests.

Example of Request Body

The following shows an example of the request body content in the screencapture.json file.

{
   "account": "/Compute-acme/cloud_storage", 
   "instance": "/Compute-acme/jack.jones@example.com/webserver1/d2ae862d-69be-43e0-bbc6-06d679b7fcdc"
}

Example of Response Body

The following example shows the response body in JSON format.

{
  "account": "/Compute-acme/cloud_storage",
  "name": "/Compute-acme/jack.jones@example.com/webserver1/d2ae862d-69be-43e0-bbc6-06d679b7fcdc/20170216-053718",
  "creation_time": "2017-02-16T05:37:18Z",
  "uri": "http://10.252.131.5/console/screencapture/Compute-acme/jack.jones@example.com/webserver1/d2ae862d-69be-43e0-bbc6-06d679b7fcdc/20170216-053718",
  "instance": "/Compute-acme/jack.jones@example.com/webserver1/d2ae862d-69be-43e0-bbc6-06d679b7fcdc",
  "state": "queued",
  "request_id": "170216d541112a6f8a60aeeabb628d5996c50f",
  "cancel": false,
  "error_reason": null,
  "media_uri": "http://acme.devpool0.opcstorage.com:7820/v1/Storage-acme/compute_images/Compute-acme/jack.jones@example.com/webserver1/d2ae862d-69be-43e0-bbc6-06d679b7fcdc/20170216-053718.png",
  "cancellation": {
    "error_reason": null,
    "state": "not_requested"
  }
}

The state field changes from queued to pending, to in-progress, to uploading, and then finally to complete. You can track the current state of screen capture request by sending the GET /console/screencapture/{name} request. When the state field changes to complete, you can access the screen capture from the location specified in the media_uri field. For information about retrieving the screen capture from your Oracle Cloud Infrastructure Object Storage Classic instance, see Downloading an Object in Using Oracle Cloud Infrastructure Object Storage Classic.