Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Workflow for Python Client #19

Merged
merged 3 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
@@ -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/
59 changes: 59 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"]
},
Expand Down
65 changes: 64 additions & 1 deletion src/infra_mgmt/README.md
Original file line number Diff line number Diff line change
@@ -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:

Expand Down