#8147 Where to get machine consumable API documentation
Closed: fixed 4 years ago by schlitzered. Opened 4 years ago by schlitzered.

Issue

i would like to auto create a IPA/IdM client based on an machine consumable api definition.

AFAIK there is only https://ipa.example.com/ipa/ui/#/p/apibrowser/, which requires javascript, so there is no easy way to parse this.


The API browser page are auto-generated from JSON data. You can fetch the JSON blob from the API server with e.g. a cURL POST request:

$ kinit username
$ curl --negotiate -u : https://$(hostname)/ipa/session/json \
    -H "Content-Type: application/json" \
    -H "Referer: https://$(hostname)/ipa" \
    -d '{"method":"json_metadata","params":[[],{"command":"all"}]}'

awesome! is there also a documentation on what the different fields mean?

Yes, check ipalib/parameters.py

thanks!

i have seen that "takes_args" sometimes has more then one member. is the order important? if i post to ipa, do i have to keep the order of arguments, as found in "takes_args"?

Yes the order of arguments is important. The order of options (kwargs) is not.

thanks for the support,

i just created a first working API based on the API spec, which still needs some more polishing:

https://github.com/opennode/python-freeipa/pull/25

i also would like to add exception classes, is there a way to get a definition of all possible exceptions via the API?

Metadata Update from @schlitzered:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

4 years ago

The list of exceptions is not really available over API.

Login to comment on this ticket.

Metadata