Skip to content

Commit

Permalink
feat(Examples): Added example on how to add new dialup profile
Browse files Browse the repository at this point in the history
  • Loading branch information
Salamek committed Sep 21, 2021
1 parent 47a46b4 commit eb95c77
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions examples/create_dialup_profile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env python3

"""
Example code on how to create dialup profile, you can try it by running:
python3 connect_with_proxy.py http://admin:[email protected]/ name
"""
from argparse import ArgumentParser

import requests

from huawei_lte_api.Client import Client
from huawei_lte_api.Connection import Connection

parser = ArgumentParser()
parser.add_argument('url', type=str)
parser.add_argument('name', type=str)
parser.add_argument('--username', type=str)
parser.add_argument('--password', type=str)
args = parser.parse_args()

with Connection(
args.url,
username=args.username,
password=args.password,
) as connection:
client = Client(connection)
print(client.dial_up.create_profile(args.name))

0 comments on commit eb95c77

Please sign in to comment.