Golang client for Equinix Metal
Experimental This is experimental. Don't use it in production. Examples demonstrate that this client is usable. Please submit patches and open issues with your experience. This repo contains Go code generated from a customized spec/oas3.combined/openapi.yaml based on the Equinix Metal API spec. The client is generated using the Go client support built into the OpenAPITools openapi-generator.
Contents
Makefile
includes tasks to fetch the API spec, apply patches, and generate a clientspec/oas3.fetched
a directory of the latest fetched OpenAPI specspec/oas3.patched
a directory of the latest patched OpenAPI specspec/oas3.combined/openapi.yaml
the patched OpenAPI spec combined into a single filepatches/spec.fetched.json/*.patch
patch files to apply against the fetched OpenAPI specpatches/post/*.patch
patch files to apply against the generated Go codeexamples/
hand crafted examples to demonstrate usagemetal/v1/
generated Go client
Generated Client
See API.md
Build
To build the client, run make
.
Examples
You can see usage of the generated code in the examples
directory. In order to try, export METAL_AUTH_TOKEN
token and execute the code, e.g.
Patches
- Make changes in
spec/oas3.patched/
dir. - Create a patch file in metal-go:
git diff spec/oas3.patched/ > ../patches/spec.fetched.json/<patchfilename> cd ..
patchfilename
should be in format:<patch_index>-<short_patch_decription_or_identifier>.patch
- Run
make
to reapply the changes to the fetched OpenAPI spec and confirm that the patched spec includes the expected changes