ctreatma / metal-python

Generated Python SDK for Equinix Metal

Home Page:https://deploy.equinix.com/labs/metal-python/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metal-python

Experimental

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 Python code generated from a customized metal_openapi.fixed.yaml based on the Equinix Metal API spec. The client is generated using the python-nextgen generator built into the OpenAPITools openapi-generator.

Python SDK for Equinix Metal API , generated with openapi-generator. Pypi package name is equinix-metal.

Installation

python -m pip install --upgrade equinix-metal

Examples

See examples in examples directory.

Documentation

Full Equinix Metal API documenation is available here: https://metal.equinix.com/developers/api/.

Generated documentation is available here: equinix_metal/README.md.

Requirements

This project is using OpenAPITools openapi-generator Docker images to generate the code. You need to have Docker installed.

In order to limit dependencies, the Makefile uses Docker for most of the tasks. If you run the tasks for the first time, you will need to wait for Docker image download.

Get newest API spec

Run make fetch to download newest API spec from upstream.

Development

Clone this repo

git clone https://github.com/equinix-labs/metal-python

Everything in equinix_metal directory is generated. You can change code there to debug or experiment, but be aware that it will be rewritten on next make generate.

Development of this package mostly means editing:

Once you did your edits, run make generate and check how the generated code has changed.

To use the regenerated code, you can install the generated package from directory:

pip install ./equinix_metal

.. and then import equinix_metal in a Python script.

Release

If you want to do a new release:

  • make sure that make generate doesn't taint git status
  • change PACKAGE_VERSION in Makefile
  • run make generate
  • check git diff, the version number should be updated in
  M equinix_metal/README.md
  M equinix_metal/equinix_metal/__init__.py
  M equinix_metal/equinix_metal/api_client.py
  M equinix_metal/equinix_metal/configuration.py
  M equinix_metal/pyproject.toml
  M equinix_metal/setup.py

Then submit a PR with the changes. Once the PR is merged, go to https://github.com/equinix-labs/metal-python/releases/new and create a new release from main. Don't choose an existing tag, but create a new one called v{PACKAGE_VERSION}. For example, if PACKAGE_VERSION is "0.1.2", create tag "v0.1.2". Put the tag name also to the "Release title" field.

Add release notes in format of Terraform Provider Equinix, with at least one of the sections (NOTES, FEATURES, BUG FIXES, ENHANCEMENTS).

Click "Publish release", and the manual part should be over.

The release will create a tag, and we have a Github action in place that should create a PyPI release for version from PACKAGE_VERSION.

Verify that the releasing Github action succeeded.

Verify that new version of equinix-metal is avaiable on Pypi.

About

Generated Python SDK for Equinix Metal

https://deploy.equinix.com/labs/metal-python/


Languages

Language:Python 99.6%Language:Mustache 0.3%Language:Shell 0.0%Language:Makefile 0.0%