Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

The place for development of / with / for opsi.
Post your API questions here!
Antworten
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von n.wenselowski »

Hello everyone,

For opsi 4.2 I want to replace the methods backend_searchIdents, getClients_listOfHashes, getClientIds_list by specialized methods.

Based on initial feedback collected from our team at uib I suggest the following methods as replacements:
  • getClients (no parameters): returns a list of client hashes. These hashes do not include the attributes "type" and "ident" so they can act as an replacement for getClients_listOfHashes.
  • getClientIDs (no parameters): returns a list of client IDs and can replace getClientIds_list
  • getClientsOnDepot (parameter: depotIds (list of depot IDs)): returns a list of client IDs that can be found on the given depots. Can act as an replacement for getClientIds_list.
  • getClientsWithProducts (parameter: productIds (list of product IDs), optional parameter installationStatus (string)): Returns a list of IDs of all clients with the product independent from installationStatus. If the optional parameter installationStatus is given then only clients with a matching status are returned. Can act as a replacement for getClientIds_list
Do you use any of the methods to be deprecated?
Are your use cases covered by the suggested replacements?
What are your thoughts on this?


Kind regards

Niko

Code: Alles auswählen

import OPSI
r4tzeblitz
Beiträge: 66
Registriert: 17 Sep 2015, 17:55

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von r4tzeblitz »

Hi Niko,

currently we use the method "getClientIds_list to get a list of all clients with outstanding actions (Setup, update, uninstall).

Code: Alles auswählen

getClientIds_list null null null null null '["uninstall","setup","update"]
this is important for our WakeOnLAN handling.
Is there an equal way to get the same output?

Regards

Stefan
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von n.wenselowski »

Hi Stefan,
r4tzeblitz hat geschrieben:currently we use the method "getClientIds_list to get a list of all clients with outstanding actions (Setup, update, uninstall).

Code: Alles auswählen

getClientIds_list null null null null null '["uninstall","setup","update"]
this is important for our WakeOnLAN handling.
Is there an equal way to get the same output?
There isn't an easy replacement for this yet.

I think I would like to handle this with a new function:
getClientsWithActionRequest (parameter: actionRequests (list of action requests)): Returns a list of client IDs that have the given actionRequests set. Each client will only be present once in the list of one of the given action requests match.

What do you think about this?


Kind regards

Niko

Code: Alles auswählen

import OPSI
r4tzeblitz
Beiträge: 66
Registriert: 17 Sep 2015, 17:55

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von r4tzeblitz »

This should be a good alternative method. I think we can use it for our purposes.
Benutzeravatar
n.wenselowski
Ex-uib-Team
Beiträge: 3194
Registriert: 04 Apr 2013, 12:15

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von n.wenselowski »

Hi,

all proposed methods are available since python-opsi 4.1.1.69-1.
This version can currently be found in the experimental branch.

Looking forward to your feedback!


Kind regards

Niko

Code: Alles auswählen

import OPSI
leonardo
Beiträge: 30
Registriert: 03 Mai 2016, 22:51

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von leonardo »

Hi,

I am missing the function to get a List of all clients in a group.

With opsi 4.1 I use the following mehod:

Code: Alles auswählen

opsi-admin -dS method getClientIds_list null null "test"
I get a List of all clients in the group "test". With version 4.2 this doesn't work anymore.

Is there another alternatie to get this list?

Best regards
Leonardo
stroetgen
Beiträge: 41
Registriert: 22 Mai 2017, 10:55

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von stroetgen »

Hi!

I also miss the previous function to read all ClientIDs for a group. I did not find any hints in the documentation how this can be solved now.

Is there a solution?

Thanks
Robert
leonardo hat geschrieben: 06 Jun 2021, 14:18 Hi,

I am missing the function to get a List of all clients in a group.

With opsi 4.1 I use the following mehod:

Code: Alles auswählen

opsi-admin -dS method getClientIds_list null null "test"
I get a List of all clients in the group "test". With version 4.2 this doesn't work anymore.

Is there another alternatie to get this list?

Best regards
Leonardo
Benutzeravatar
fkalweit
uib-Team
Beiträge: 173
Registriert: 23 Okt 2020, 16:14

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Beitrag von fkalweit »

Hi,

you can get all clients in a group with:

Code: Alles auswählen

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "objectToGroup_getObjects",
  "params": [
    [],
    {
      "groupId": "clients",
      "groupType": "HostGroup"
    }
  ]
}
hope this helps
Antworten