Run command in shell session
Runs a command in an active shell session and waits for it to finish. The exit code and output will be returned in the response. Note that a variety of different errors can occur when executing the command. If the command finishes, even with an error code, a normal HTTP 200 response will be returned. However, if any other error occurs like the shell not responding or exiting unexpectedly, an HTTP 500 response will be returned.
Authorization
bearerAuth The bearer token used is the session token that you receive from the handshake exchange.
In: header
Request Body
application/json
The store uuid
The command to execute
Response Body
application/json
application/json
application/json
curl -X POST "http://localhost:21721/shell/exec" \ -H "Content-Type: application/json" \ -d '{ "store": "f0ec68aa-63f5-405c-b178-9a4454556d6b", "command": "echo $USER" }'{
"exitCode": 0,
"stdout": "root",
"stderr": ""
}{
"message": "string"
}{
"error": {
"cause": {},
"stackTrace": [
"string"
],
"suppressed": [
{}
],
"localizedMessage": "string",
"message": "string"
}
}Encrypts a secret POST
For stores, the secrets are encrypted in json form. When creating stores in an automated fashion, secrets have to be first converted into the proper representation. To obtain the representation of a secret of an existing store, use the /secret/decrypt endpoint. The secret encryption method depends on your vault setup. Without any vault user and passphrase, the secret will be encrypted with a generic vault key. If you have a vault user with custom passphrase or a team set up, the secret can be encrypted with that key. You can also control the access scope of a secret by passing a custom principal. A principal is a vault user or role that has access to the secret. You can pass this principal to this endpoint to control who has access to this secret.
Start shell connection POST
Starts a new shell session for a connection. If an existing shell session is already running for that connection, this operation will do nothing. Note that there are a variety of possible errors that can occur here when establishing the shell connection. These errors will be returned with the HTTP return code 500.