Api-Log funktioniert nicht
-
Ich versuche derzeit die PI einzurichten und bekomme Fehler.
" This is not a JSON-RPC. The content-type should be application\/json, request method should be "post" and the http body should be a valid json-rpc 2.0 package"Aber das Grundproblem ist, dass die API trotz Debug nichts ins Log schreibt.
Was kann die Ursache dafür sein ?
-
Die Fehlermeldung gab's kürzlich schon mal hier im Forum. Schau mal dort.
-
@MartinV
Ja, ich versuche es allerdings über ansible.
Bin jetzt aber einen Schritt weiter.Fehler ist jetzt: message": "Invalid request: Invalid JSON-RPC Version. Use version 2.0"
Playbook:
-
name: API-Call
hosts: all
connection: local
gather_facts: novars:
ido_it_api_endpoint: XXX
ido_it_api_key: YYY
tasks:-
name: Send System Information to i-doit API
uri:
url: "{{ ido_it_api_endpoint }}"
method: POST
headers:
Content-Type: "application/json"
jsonrpc: "2.0"
body_format: json
body:
method: "idoit.version"
params:
api_key: "{{ ido_it_api_key }}"
language: "de"
return_content: yes
register: api_response -
name: Show response from API
debug:
var: api_response.content
-
-
-
Aber essentiell fehlt das Log für die API. Es wird kein Log geschrieben.
-
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login