diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..226ead0 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,18 @@ +# Contributing + +## New API services + +This library uses a Service pattern for different paths in the PVE API, like `ClusterService` for `/api2/json/cluster`. + +It currently supports API methods contained under the following paths (assume an `/api2/json` prefix): + +* `/cluster` +* `/nodes` + + If you would like to add an API method from a different API path, you will need to add a new client Service, [like so.](https://github.com/Starttoaster/go-proxmox/blob/fe6f9b739155dcf713694320e790ab945dab6215/client.go#L31) Then you can create a new file for your service that contains your API method. + +## New API methods + +[For an example of how to add an API method.](https://github.com/Starttoaster/go-proxmox/blob/fe6f9b739155dcf713694320e790ab945dab6215/nodes.go#L37) Important to note the structs just above the method that contain the data the method returns to the user with appropriate types. This library currently does not make use of generics, so optional fields in the API response should be pointers. Also note the comments just above the structs and functions, please follow the same convention in yoru contribution. + +Please try to help keep up with this library's tests by contributing a test for your API method contributions. See [this test](https://github.com/Starttoaster/go-proxmox/blob/fe6f9b739155dcf713694320e790ab945dab6215/nodes_test.go#L11) for an example, and the [json text file that the mock API server's router returns.](https://github.com/Starttoaster/go-proxmox/blob/fe6f9b739155dcf713694320e790ab945dab6215/testdata/nodes/get_nodes.json) \ No newline at end of file diff --git a/README.md b/README.md index 5bc098f..f72ed2c 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,9 @@ This is an API client library for Proxmox VE servers. It aims to be simple to use and consume in your own Go programs, make very little assumptions about how the user would consume it, and use as few non-stdlib dependencies to do so as possible. -This library is in its early development phase. Minor changes may be made in its usage, and only a portion of API methods are currently supported. Stand by for contributing guidelines for assisting with adding new endpoints, but the ones that exist have likely been added on a need to have basis at the moment. +This is currently tested against Proxmox VE 8.1.4 systems. + +This library is in its early development phase. Minor changes may be made in its usage, and only a portion of API methods are currently supported. See the CONTRIBUTING.md for details on contributing new methods to this library. Or make an Issue to discuss it. ## Usage