-
-
Notifications
You must be signed in to change notification settings - Fork 95
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(Examples): Added example on how to add new dialup profile
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |