Skip to content

Commit

Permalink
Add contributing.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Starttoaster authored Mar 26, 2024
1 parent fe6f9b7 commit 3cef053
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
18 changes: 18 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -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)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 3cef053

Please sign in to comment.