Seite 1 von 1

Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 20 Mai 2019, 15:42
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

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 07 Jun 2019, 10:25
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

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 17 Jun 2019, 12:44
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

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 02 Jul 2019, 17:04
von r4tzeblitz
This should be a good alternative method. I think we can use it for our purposes.

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 08 Jul 2019, 14:06
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

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 06 Jun 2021, 14:18
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

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 14 Sep 2021, 14:41
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

Re: Feedback wanted: Replacing backend_searchIdents, getClients_listOfHashes and getClientIds_list

Verfasst: 14 Sep 2021, 17:02
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