Wapt API

Share your tips or issues concerning the WAPT Console or WAPT Agent here
Forum Rules
Community Forum Rules
* English support on www.reddit.com/r/wapt
* French community support is available on this forum
* Please prefix the topic title with [RESOLVED] if it is resolved.
* Please do not edit a topic that is tagged [RESOLVED]. Open a new topic referencing the old one.
* Specify the installed WAPT version, full version, and build number (2.2.1.11957 / 2.2.2.12337 / etc.) as well as the Enterprise/Discovery edition.
* Versions 1.8.2 and earlier are no longer supported. The only questions accepted regarding version 1.8.2 are related to upgrading to a supported version (2.1, 2.2, etc.).
* Specify the server OS (Linux/Windows) and version (Debian Buster/Bullseye - CentOS 7 - Windows Server 2012/2016/2019).
* Specify the OS of the administration/package creation machine and the machine with the problematic agent, if applicable (Windows 7/10/11/Debian 11/etc.).
* Avoid asking multiple questions when opening a topic, otherwise it may be ignored. If there are multiple topics, open separate topics, preferably one after the other and not all at the same time (i.e., do not spam the forum).
* Include code snippets, screenshots, and other images directly in the post. Links to Pastebin, Bitly, and other third-party sites will be systematically removed.
* As with any community forum, support is provided voluntarily by members. If you require commercial support, you can contact Tranquil IT's sales department at 02.40.97.57.55
Locked
guestben321
Messages: 23
Registration: Nov 30, 2021 - 4:38 p.m.

November 30, 2021 - 4:54 PM

Good morning,

I did some research on Google and saw that there is a API for WAPTBut at my level, she lacks quite a few examples.
For example, this query returns 10,000 workstations with the status of the machines:

Code: Select all

https://admin:MYPASSWORD@srvwapt.mydomain.lan/api/v1/hosts?columns=reachable,computer_fqdn,connected_ips,mac_addresses&limit=10000
The API does not allow, for example, returning the result only from a machine called, for example, TOTO01?
For example, to retrieve its uuid.
Using a machine's UUID, I saw that you could retrieve all sorts of information, for example, which packages are installed on the machine.
Is there a way to launch the installation of a package using the API?

THANKS


For your information:
My Wapt is version 2.2.1, enterprise edition and installed on a 64-bit Linux system.
WAPT Server Enterprise edition, version: 2.6.0.16552
User avatar
sfonteneau
WAPT Expert
Messages: 2318
Registered: July 10, 2014 - 11:52 PM
Contact :

November 30, 2021 - 8:00 PM

guestben321 wrote: Nov 30, 2021 - 4:54 PM The API doesn't allow, for example, returning the result only from a machine called, for example, TOTO01?
Like this?

Code: Select all

/api/v3/hosts?filter=computer_fqdn:TOTO&reachable=1&columns=computer_fqdn,uuid,computer_name&limit=2000
guestben321 wrote: Nov 30, 2021 - 4:54 PM Is there a way using the API to launch the installation of a package?
The server can relay an installation request, but the request must be signed with the private key

Code: Select all

/api/v3/trigger_host_action
The server receives the request and forwards it, so if it is not signed, it will be refused by the client.

The server alone cannot do anything because it does not have the private key (first principle of Wapt security)
Locked