Create Command
This endpoint allows you to create a new command.
NOTE: the system property in the command is not used. Use a POST to /api/v2/commands/{id}/associations to bind a command to a system.
Sample Request
curl -X POST https://console.jumpcloud.com/api/commands/ \
-H 'Accept: application/json' \
-H 'Content-Type: application/json'
-H 'x-api-key: {API_KEY}'
-d '{"name":"Test API Command", "command":"String", "user":"{UserID}", "schedule":"", "timeout":"100"}'
Basic Parameters
Parameter | Description |
---|---|
Command | The command to execute on the server. |
Command Runners | An array of IDs of the Command Runner Users that can execute this command. |
Command Type | The Command OS. |
Name | Display name of the command. |
Sudo | Enable as Global Administrator/Sudo on all device associations. |
User | The ID of the system user to run the command as. This field is required when creating a command with a commandType of "mac" or "linux". |
Advanced Parameters
Parameter | Description |
---|---|
Files | An array of file IDs to include with the command. |
Launch Type | How the command will execute. |
Listens To | - |
Organization | The ID of the organization. |
Organization ID | Organization identifier that can be obtained from console settings. |
Schedule | A crontab that consists of: [ (seconds) (minutes) (hours) (days of month) (months) (weekdays) ] or [ immediate ]. If you send this as an empty string, it will run immediately. |
Schedule Repeat Type | When the command will repeat. |
Schedule Year | The year that a scheduled command will launch in. |
Shell | The shell used to run the command. |
Systems | Not used. Use /api/v2/commands/{id}/associations to bind commands to systems. |
Template | The template this command was created from. |
Time To Live Seconds | Time in seconds a command can wait in the queue to be run before timing out. |
Timeout | The time in seconds to allow the command to run for. |
Trigger | The name of the command trigger. |
Example Output
{
"command": "string",
"commandRunners": [
"string"
],
"commandType": "linux",
"files": [
"string"
],
"launchType": "string",
"listensTo": "string",
"name": "string",
"organization": "string",
"schedule": "string",
"scheduleRepeatType": "string",
"scheduleYear": 0,
"shell": "string",
"sudo": true,
"systems": [
"string"
],
"template": "string",
"timeToLiveSeconds": 0,
"timeout": "string",
"trigger": "string",
"user": "string"
}
Workflow Library Example
Create Command with Jumpcloud and Send Results Via Email