Skip to content

Commit 99b8770

Browse files
committed
Merge branch 'release/5.1.0'
2 parents daa6761 + 31e6faa commit 99b8770

File tree

8 files changed

+412
-119
lines changed

8 files changed

+412
-119
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: mattermost-ziti-webhook
2+
on:
3+
create:
4+
delete:
5+
issues:
6+
issue_comment:
7+
pull_request_review:
8+
pull_request_review_comment:
9+
pull_request:
10+
push:
11+
fork:
12+
release:
13+
14+
jobs:
15+
mattermost-ziti-webhook:
16+
runs-on: macos-latest
17+
name: POST Webhook
18+
steps:
19+
- uses: openziti/ziti-webhook-action@main
20+
with:
21+
ziti-id: ${{ secrets.ZITI_MATTERMOST_IDENTITY }}
22+
webhook-url: ${{ secrets.ZITI_MATTERMOST_WEBHOOK_URL }}
23+
webhook-secret: ${{ secrets.ZITI_MATTERMOSTI_WEBHOOK_SECRET }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
3+
4+
# This workflow uses actions that are not certified by GitHub.
5+
# They are provided by a third-party and are governed by
6+
# separate terms of service, privacy policy, and support
7+
# documentation.
8+
9+
name: Upload Python Package
10+
11+
on:
12+
release:
13+
types: [published]
14+
15+
jobs:
16+
deploy:
17+
18+
runs-on: ubuntu-latest
19+
20+
steps:
21+
- uses: actions/checkout@v2
22+
- name: Set up Python
23+
uses: actions/setup-python@v2
24+
with:
25+
python-version: '3.x'
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install build
30+
- name: Build package
31+
run: python -m build
32+
- name: Publish package
33+
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
34+
with:
35+
user: __token__
36+
password: ${{ secrets.PYPI_API_TOKEN }}

README.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ This creates a demo network named "BibbidiBobbidiBoo" with your API account stor
1010
Learn about getting an API account by reading the [Authentication Guide](https://developer.netfoundry.io/v2/guides/authentication/)
1111

1212
```bash
13-
$ python3 -m netfoundry.demo BibbidiBobbidiBoo
14-
INFO: running demo script in /home/alice/.pyenv/versions/3.9.0/lib/python3.9/site-packages/netfoundry/demo.py
13+
python3 -m netfoundry.demo --network=BibbidiBobbidiBoo
1514
```
1615

1716
## Create network snippet from demo.py
@@ -20,15 +19,15 @@ INFO: running demo script in /home/alice/.pyenv/versions/3.9.0/lib/python3.9/sit
2019
#!/usr/bin/env python3
2120
import netfoundry
2221

23-
# default API account credential file is ~/.netfoundry/credentials.json
24-
Organization = netfoundry.Organization(credentials="credentials.json")
22+
# user-default path is ~/.netfoundry/
23+
organization = netfoundry.Organization(credentials="credentials.json")
2524

2625
# use some Network Group, default is to use the first and there's typically only one
27-
network_group = netfoundry.NetworkGroup(Organization)
26+
network_group = netfoundry.NetworkGroup(organization)
2827

2928
# create a Network
3029
network_name = "BibbidiBobbidiBoo"
31-
if network_name in network_group.networks_by_name.keys():
30+
if network_name in network_group.networks_by_name().keys():
3231
# use the Network
3332
network = netfoundry.Network(network_group, network_name=network_name)
3433
network.wait_for_status("PROVISIONED",wait=999,progress=True)

netfoundry/demo.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
#!/usr/bin/env python3
2-
r"""Example script to create a NetFoundry Network
2+
r"""Use this script to create a network with functioning services and demonstrate the NetFoundry Python module.
3+
34
Usage::
4-
$ python3 -m netfoundry.demo BibbidiBobbidiBoo
5+
$ python3 -m netfoundry.demo --network BibbidiBobbidiBoo
56
"""
67

78
import argparse
@@ -14,7 +15,7 @@
1415

1516

1617
def main():
17-
18+
"""Run the demo script."""
1819
print("DEBUG: running demo script in \"{:s}\"".format(sys.argv[0]))
1920

2021
parser = argparse.ArgumentParser()
@@ -31,7 +32,7 @@ def main():
3132
)
3233
parser.add_argument(
3334
"-o", "--organization",
34-
help="The label of an alternative Organization (default is Org of caller)"
35+
help="The label of an alternative organization (default is Org of caller)"
3536
)
3637
parser.add_argument(
3738
"-g", "--network-group",
@@ -96,16 +97,16 @@ def main():
9697

9798
network_name = args.network
9899

99-
# use the session with some Organization, default is to use the first and there's typically only one
100-
Organization = netfoundry.Organization(
100+
# use the session with some organization, default is to use the first and there's typically only one
101+
organization = netfoundry.Organization(
101102
credentials=args.credentials if 'credentials' in args else None,
102103
organization_label=args.organization if 'organization' in args else None,
103104
proxy=args.proxy
104105
)
105106

106107
# use some Network Group, default is to use the first and there's typically only one
107108
network_group = netfoundry.NetworkGroup(
108-
Organization,
109+
organization,
109110
network_group_name=args.network_group if 'network_group' in args else None
110111
)
111112

0 commit comments

Comments
 (0)