pyinfra icon indicating copy to clipboard operation
pyinfra copied to clipboard

Using REST APIs

Open an-ky opened this issue 1 year ago • 1 comments

Is your feature request related to a problem? Please describe

Pyinfra seems to be based around the sole idea of SSH accessible hosts. I have some devices which are most convenient to configure using the provided REST API. Redfish stands out here IMHO as it allows to provision a system without having a OS installed, thus no or just rather primitive SSH access. Currently I'm using Ansible to send the according API commands but I'd like to move my whole IaC repo to pyinfra.

Describe the solution you'd like

Would it be sufficient to implement a Connector which establishes the connection to the REST API and a bunch of Commands for every task to accomplish. I'd like to contribute but need some starting point/tips as I'm rather new to pyinfra.

an-ky avatar Jan 08 '24 14:01 an-ky

Hi @an-ky

There are other connectors than ssh: https://docs.pyinfra.com/en/2.x/connectors.html

I think you can't use connector but python operations to meet your need: https://docs.pyinfra.com/en/2.x/operations/python.html

Greetings,

maisim avatar Jan 08 '24 14:01 maisim