-
Notifications
You must be signed in to change notification settings - Fork 0
/
create_accounts.py
38 lines (33 loc) · 977 Bytes
/
create_accounts.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Sep 24 08:02:09 2023
@author: marcelo
"""
import warnings
from RWG_calls_Q323 import RWG_calls
warnings.filterwarnings("ignore", message="Unverified HTTPS request")
RWG = RWG_calls()
host = 'rwg-fqdn'
username = 'admin'
password = 'password'
apiKey = RWG.genApi_Key(host, username, password)
name = apiKey['name']
key = apiKey['api_key']
ID = RWG.getKeyID_ByName(host, name, key)
print('API KEY details:')
print(ID, name, key, '\n')
firstName = 'Sheldon'
lastName = 'Felino'
login = 'sheldon'
password = '1234'
email = 'marcelo.molinari@gmail.com'
account_group = 80
usage_plan = 86
pre_shared_key = '12345678ABCDEFGH'
account = RWG.createAccount(host, firstName, lastName, login, password,
email, account_group, usage_plan,
pre_shared_key, key)
print('Account ID and login:')
print(account['id'], account['login'])
RWG.destroyApi_Key(host, ID, key)