diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml new file mode 100644 index 0000000..f8a8adf --- /dev/null +++ b/.github/workflows/release-test.yml @@ -0,0 +1,57 @@ +# Universal DDI Python Client release workflow. +name: Test Release + +# This GitHub action is triggered on a manual workflow_dispatch event. +on: + workflow_dispatch: + +# Releases need permissions to read and write the repository contents. +# GitHub considers creating releases and uploading assets as writing contents. +permissions: + contents: write + id-token: write + + +jobs: + build-package-test: + name: Create and Store Python 🐍 distribution 📦 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Install pypa/build + run: python -m pip install build --user + - name: Build a package + run: python -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-testpypi: + name: Publish Python 🐍 distribution 📦 to TestPyPI + needs: + - build-package-test + runs-on: ubuntu-latest + environment: + name: testpypi-python-client + url: https://test.pypi.org/p/universal-ddi-python-client + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to TestPyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true + repository-url: https://test.pypi.org/legacy/ diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..9ee2907 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,59 @@ +# Universal DDI Python Client release workflow. +name: Release + +# This GitHub action creates a release when a tag that matches the pattern +# "v*" (e.g. v0.1.0) is created. +on: + push: + tags: + - 'v*' + +# Releases need permissions to read and write the repository contents. +# GitHub considers creating releases and uploading assets as writing contents. +permissions: + contents: write + id-token: write + + +jobs: + build-package: + name: Create and Store Python 🐍 distribution 📦 + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Install pypa/build + run: python -m pip install build --user + - name: Build a package + run: python -m build + - name: Store the distribution packages + uses: actions/upload-artifact@v4 + with: + name: python-package-distributions + path: dist/ + + publish-to-pypi: + name: Publish Python 🐍 distribution 📦 to PyPI + needs: + - build-package + runs-on: ubuntu-latest + environment: + name: pypi-python-client + url: https://pypi.org/p/universal-ddi-python-client + steps: + - name: Download all the dists + uses: actions/download-artifact@v4 + with: + name: python-package-distributions + path: dist/ + - name: Publish distribution 📦 to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + verbose: true diff --git a/README.md b/README.md index f687058..0b623a5 100644 --- a/README.md +++ b/README.md @@ -5,30 +5,30 @@ This repository provides a Python Client library for interacting with Infoblox A The following Infoblox APIs are supported: ## Infoblox Cloud -- [Infrastructure Management](src/infra_mgmt/README.md) -- [Infrastructure Provision (HostActivation API)](src/infra_provision/README.md) -- [Anycast Configuration Manager](src/anycast/README.md) -- [Upgrade Policy](upgradePolicy/README.md) +- [Infrastructure Management](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_mgmt/README.md) +- [Infrastructure Provision (HostActivation API)](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/infra_provision/README.md) +- [Anycast Configuration Manager](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/anycast/README.md) +- [Upgrade Policy](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/upgrade_policy/README.md) ## Infoblox Threat Defense -- [Threat Defense Cloud (FW API)](src/fw/README.md) -- [DNS Forwarding Proxy (DFP API)](src/dfp/README.md) -- [Redirect](src/redirect/README.md) +- [Threat Defense Cloud (FW API)](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/fw/README.md) +- [DNS Forwarding Proxy (DFP API)](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dfp/README.md) +- [Redirect](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/redirect/README.md) ## Universal DDI -- [IP Address Management](src/ipam/README.md) -- [DNS Configuration](src/dns_config/README.md) -- [DNS Data](src/dns_data/README.md) -- [Keys](src/keys/README.md) -- [Cloud Discovery Providers](src/cloud_discovery/README.md) -- [IPAM Federation](src/ipam_federation/README.md) +- [IP Address Management](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam/README.md) +- [DNS Configuration](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dns_config/README.md) +- [DNS Data](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/dns_data/README.md) +- [Keys](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/keys/README.md) +- [Cloud Discovery Providers](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/cloud_discovery/README.md) +- [IPAM Federation](https://github.com/infobloxopen/universal-ddi-python-client/blob/main/src/ipam_federation/README.md) ## Installation To install the Universal DDI Python Client, use the following command: ```bash -pip install git+https://github.com/infobloxopen/universal-ddi-python-client +pip install universal-ddi-python-client ``` ## Usage diff --git a/setup.py b/setup.py index 0943904..c474500 100644 --- a/setup.py +++ b/setup.py @@ -2,6 +2,11 @@ from setuptools import setup, find_packages # noqa: H301 +# read the contents of your README file +from pathlib import Path +this_directory = Path(__file__).parent +long_description = (this_directory / "README.md").read_text() + # To install the library, run the following # # python setup.py install @@ -31,6 +36,8 @@ packages=find_packages('src', exclude=["test", "tests"]), package_dir={'': 'src'}, include_package_data=True, + long_description=long_description, + long_description_content_type='text/markdown', package_data={ "*": ["py.typed"] }, diff --git a/src/infra_mgmt/README.md b/src/infra_mgmt/README.md index fb643d2..897508a 100644 --- a/src/infra_mgmt/README.md +++ b/src/infra_mgmt/README.md @@ -1,5 +1,68 @@ # infra-mgmt -The **Infrastructure Management API** provides a RESTful interface to manage Infrastructure Hosts and Services objects. The following is a list of the different Services and their string types (the string types are to be used with the APIs for the `service_type` field): | Service name | Service type | | ------ | ------ | | Access Authentication | authn | | Anycast | anycast | | Data Connector | cdc | | DHCP | dhcp | | DNS | dns | | DNS Forwarding Proxy | dfp | | NIOS Grid Connector | orpheus | | MS AD Sync | msad | | NTP | ntp | | BGP | bgp | | RIP | rip | | OSPF | ospf | --- ### Hosts API The Hosts API is used to manage the Infrastructure Host resources. These include various operations related to hosts such as viewing, creating, updating, replacing, disconnecting, and deleting Hosts. Management of Hosts is done from the Cloud Services Portal (CSP) by navigating to the Manage -> Infrastructure -> Hosts tab. --- ### Services API The Services API is used to manage the Infrastructure Service resources (a.k.a. NIOS-X applications). These include various operations related to hosts such as viewing, creating, updating, starting/stopping, configuring, and deleting Services. Management of Services is done from the Cloud Services Portal (CSP) by navigating to the Manage -> Infrastructure -> Services tab. --- ### Detail APIs The Detail APIs are read-only APIs used to list all the Infrastructure resources (Hosts and Services). Each resource record returned also contains information about its other associated resources and the status information for itself and the associated resource(s) (i.e., Host/Service status). --- + +The **Infrastructure Management API** provides a RESTful interface to manage Infrastructure Hosts and Services objects. + +The following is a list of the different **Services** and their string types (used with the APIs for the `service_type` field): + +| **Service Name** | **Service Type** | +|-----------------------------|------------------| +| Access Authentication | `authn` | +| Anycast | `anycast` | +| Data Connector | `cdc` | +| DHCP | `dhcp` | +| DNS | `dns` | +| DNS Forwarding Proxy | `dfp` | +| NIOS Grid Connector | `orpheus` | +| MS AD Sync | `msad` | +| NTP | `ntp` | +| BGP | `bgp` | +| RIP | `rip` | +| OSPF | `ospf` | + +--- + +## Hosts API + +The **Hosts API** is used to manage the **Infrastructure Host** resources. These include various operations related to hosts, such as: + +- Viewing +- Creating +- Updating +- Replacing +- Disconnecting +- Deleting + +Management of Hosts is done from the **Cloud Services Portal (CSP)** by navigating to: +**Manage → Infrastructure → Hosts** tab. + +--- + +## Services API + +The **Services API** is used to manage **Infrastructure Service** resources (a.k.a. **NIOS-X applications**). These include various operations related to services, such as: + +- Viewing +- Creating +- Updating +- Starting/Stopping +- Configuring +- Deleting + +Management of Services is done from the **Cloud Services Portal (CSP)** by navigating to: +**Manage → Infrastructure → Services** tab. + +--- + +## Detail APIs + +The **Detail APIs** are **read-only APIs** used to list all the **Infrastructure resources** (Hosts and Services). + +Each resource record returned also contains information about: +- Its associated resources +- Status information for itself +- The status of associated resource(s) (**Host/Service status**) + +--- The `infra_mgmt` package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: