Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing documentation on running commands #47

Open
h-betz opened this issue Jul 24, 2020 · 2 comments
Open

Missing documentation on running commands #47

h-betz opened this issue Jul 24, 2020 · 2 comments

Comments

@h-betz
Copy link

h-betz commented Jul 24, 2020

There appears to be a lack of information regarding how to run a command on your documentation https://docs.jumpcloud.com/1.0/commands/QhvaHddE3MvJpE55i

I presume you need to specify the command ID though I tried passing it in through the URL and through the POST data with no success. This doesn't appear to be a feature in V2 of the API https://docs.jumpcloud.com/2.0/commands.

What I'm trying to do is, given a specific command ID, I want to run that command.

@kkirklandjc
Copy link

kkirklandjc commented Jul 24, 2020

Hi Hunter,

Kyle here from the JumpCloud Support team. Hopefully I can provide clarification for a sample command for the /runCommand/ endpoint in the v1 api.

In the initial GET request from https://console.jumpcloud.com/api/commands/ \, you'll be sent several data values for your organization's commands. All of these data values need to be present in your next request for the /runCommand/ endpoint. Below is a sample request. Of course, you'll need to plug in your data values from your /commands/ result into the following request:

curl -X POST https://console.jumpcloud.com/api/runCommand/ \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'x-api-key: api_key' \
  -d '{
    "objectId": "command ID",
    "name": "command name",
    "command": "command input values",
    "commandType": "os",
    "launchType": "manual/scheduled/repeating/etc",
    "listensTo": "",
    "schedule": "",
    "trigger": "",
    "scheduleRepeatType": "",
    "organization": "orgid",
    "_id": "command id"
}'

A valid response will contain a blank value (not great - we're aware) or a "queueId" value, indicating a successful request.

Please respond to this thread if you have any questions!

@h-betz
Copy link
Author

h-betz commented Jul 25, 2020

Great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants