Reading files from the guest OS
GET /v2.1/servers/{server_id}/guest-agent/file-read?path={path}
Read a file from inside the guest OS.
The response body contains the file contents. The command UUID is returned in the X-Guest-Agent-Command-UUID response header.
Request
Parameters
| Name | In | Type | Description |
|---|---|---|---|
server_id
|
path | string | The UUID of the server. |
path
|
query | string | Absolute path to the file inside the guest OS. |
Example
# curl -ks -H 'Content-Type: application/json' -H 'X-Auth-Token: gAAAAA<...> \ https://<node_IP_addr>:8774/v2.1/servers/<server_id>/guest-agent/file-read?path='<path_inside_guest_os>'
Response
Status codes
Success
| Code | Reason |
|---|---|
200 - OK
|
Request was successful. |
Error
| Code | Reason |
|---|---|
400 - Bad Request
|
Some content in the request was invalid. |
401 - Unauthorized
|
User must authenticate before making a request. |
403 - Forbidden
|
Policy does not allow current user to do this operation. |
404 - Not Found
|
The requested resource could not be found. |
409 - Conflict
|
This operation conflicted with another operation on this resource. |