method getClientIds_list - groupId

Antworten
rfrankow
Beiträge: 146
Registriert: 03 Jul 2008, 15:06

method getClientIds_list - groupId

Beitrag von rfrankow »

Egal welche Syntax ich bei groupId eingebe, ich bekomme kein Ergebnis. Habe ich die Doku falsch verstanden oder ist es ein Bug?

Code: Alles auswählen

opsiconfd = 4.2.0.305-1

Code: Alles auswählen

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "getClientIds_list",
  "params": [
    null,
    null,
    "test"
  ]
}

Code: Alles auswählen

{
  "jsonrpc": "2.0",
  "id": 1,
  "error": {
    "code": 0,
    "message": "Missing parameters for mapping getClientIds_list to replacing method.",
    "data": {
      "class": "RuntimeError",
      "details": "Traceback (most recent call last):\n  File \"opsiconfd/application/jsonrpc.py\", line 524, in process_rpcs\n  File \"opsiconfd/application/jsonrpc.py\", line 501, in process_rpc\n  File \"starlette/concurrency.py\", line 41, in run_in_threadpool\n  File \"anyio/to_thread.py\", line 31, in run_sync\n  File \"anyio/_backends/_asyncio.py\", line 937, in run_sync_in_worker_thread\n  File \"anyio/_backends/_asyncio.py\", line 867, in run\n  File \"opsiconfd/application/jsonrpc.py\", line 431, in execute_rpc\n  File \"<string>\", line 1, in getClientIds_list\n  File \"OPSI/Backend/Base/Extended.py\", line 122, in _executeMethod\n  File \"<string>\", line 104, in getClientIds_list\nRuntimeError: Missing parameters for mapping getClientIds_list to replacing method.\n"
    }
  }
}
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: method getClientIds_list - groupId

Beitrag von SisterOfMercy »

It looks like "getClientIds_list" is an older method?

Try this:

Code: Alles auswählen

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "host_getIdents",
  "params": []
}
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: method getClientIds_list - groupId

Beitrag von SisterOfMercy »

Or use the new opsi-cli:

Code: Alles auswählen

opsi-cli --output-format=csv jsonrpc execute host_getIdents []
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
rfrankow
Beiträge: 146
Registriert: 03 Jul 2008, 15:06

Re: method getClientIds_list - groupId

Beitrag von rfrankow »

The method getClientIds_list is deprecated :roll: Alternativ methode getClientIDs have no filters. Any ideas?

Code: Alles auswählen

╭─────────────────────────────────────────────────────┬─────────────────────────────────────────────────────────────────────┬────────────┬─────────────────────────────────────╮
│ name                                                │ params                                                              │ deprecated │ alternative_method                  │
├─────────────────────────────────────────────────────┼─────────────────────────────────────────────────────────────────────┼────────────┼─────────────────────────────────────┤
│ getClientIDs                                        │                                                                     │ false      │                                     │
│ getClientIds_list                                   │ *serverId, *depotIds, *groupId, *productId, *installationStatus,    │ true       │ getClientIDs                        │
│                                                     │ *actionRequest, *productVersion, *packageVersion, *hwFilter         │            │                                     │
╰─────────────────────────────────────────────────────┴─────────────────────────────────────────────────────────────────────┴────────────┴─────────────────────────────────────╯
Benutzeravatar
SisterOfMercy
Beiträge: 1556
Registriert: 22 Jun 2012, 19:18

Re: method getClientIds_list - groupId

Beitrag von SisterOfMercy »

What is exactly the thing that you want? Something that reports the installation status for every client, or do you only want one thing? I thought you only wanted a list of clients, that's why.

And if I run this getClientIds_list via the webinterface I only get a list of ids.
Bitte schreiben Sie Deutsch, when I'm responding in the German-speaking part of the forum!
rfrankow
Beiträge: 146
Registriert: 03 Jul 2008, 15:06

Re: method getClientIds_list - groupId

Beitrag von rfrankow »

thanks for the tipp. i found my new favorite method objectToGroup_getHashes 8-)

Code: Alles auswählen

opsi-cli --output-format=table --attributes objectId jsonrpc execute objectToGroup_getHashes [] '{"groupId":"test"}'
Antworten