I read the API guide and it seems that there is no way to copy / move a jump client (aka computer) to another jump group. There are only commands for users.
I want to move or copy a client (or a list of clients via Powershell) from one jump group to another one. I can do that in the console one by one, but I would love to do that automatically via API.
Is there a way?
Page 1 / 1
Hello @Tina_K - you can indeed copy a Jump Client via the on-appliance Configuration API, specifically the ‘/jump-client/{id}/copy’ name space. The Configuration API documentation is on the appliance itself and you can view it on /login > Management > API Configuration.
If you are using our BTCLI tool, the command is: ‘btapi add jump-client/{id}/copy’
Please let us know how you get on!
Hello @PhillC - thank you for your reply!
I am playing around with the btapi tool, but if I try the command you told me I get this:
I also wonder how to tell the tool where to put the new copied item…
Is this the input it is waiting for? Can you give me an example how to specify the input please?
Hello @Tina_K - if you run the btapi.exe without any commands or flags, you get the help menu, which at the bottom, outlines: Command input can take the form of valid JSON or Key=Value pairs See the echo command for detailed JSON to Key=Value conversion help
As for your query, I believe the API Configuration commands are broken down into the explict functins. For instance, this ONLY copies the Jump Item/Client in place, and as a result upon completing this command, you get a JSON reply with the new JumpItemID and such. From there, you can then run the ‘patch /jump-client/{id}’ to update it’s Jump Group, using the new JumpItemID from the copied Jump item.
Please let me know how you get on here, or log a case with our Support Team to have them check this out as well.
Hello @Tina_K - just a follow up from my previous comment, I have found that we actually need to input the required elements for the new Jump item, via a file through the -KI flag. For exmaple:
This is because the jump-client/*id*/copy command has a request body we need to complete. In the same directory a the BTAPI.exe, I have a JumpItem.txt file with just these lines in, which completes the request:
jump_group_id=4
jump_group_type=shared
name=Testing
Hello @PhillC ,
now I got it figured out!
I tried the “btapi update jump-client” command and I made a json file for data input (I did not get that this is the way the data is fed to the tool...).
Now I can move around jump clients in different groups. I think with a combination of the copy command and the update command and a loop via powershell I can build a tool that does what I need.
It would be so nice if this was easier… but this should work.
Is it true that you can modify only one value at a time per .json file…? (Like said in this thread
)
Hello @PhillC !
That worked!
There is no info about a -ki Parameter. ….
I will try some things with this, you helped me a lot! Thank you!
… I want to put that in a powershell script that should run automatically… can I trigger the btapi.exe from there or would a REST-API request be better? But I would need the https-command for this...
Hello @PhillC !
That worked!
There is no info about a -ki Parameter. ….
I will try some things with this, you helped me a lot! Thank you!
… I want to put that in a powershell script that should run automatically… can I trigger the btapi.exe from there or would a REST-API request be better? But I would need the https-command for this...
Hello @Tina_K - Since we have it working with the BTAPI, you can just place this on a server somewhere, and have it run automatically, like on a schedule. So long as the BTAPI is placed somewhere on that remote server, you can just referance it with these commands.
You can run a PowerShell script before hand to automagically create the input file if you need to, once per run. Or use PS or BAT scripting to create all the input files before hand, and have PS loop the command through each one of those created files.
Hello @PhillC !
Placing the tool on a server and calling it from there should be no problem.
I build things with this solution!
Thank you very much for your help!
Reply
Badge Earners
Nikhil Raohas earned the badge BCIE: Endpoint Privilege Management - Windows
Nikhil Raohas earned the badge BCIE: Password Safe