The Gateway Clients CLI provides functionalities to manage gateway clients. It interacts with a database to perform CRU (Create, Read, Update) operations on client data.
Ensure the following environment variables are set:
MYSQL_HOST: The hostname or IP address of the MySQL server.MYSQL_USER: The MySQL user with appropriate privileges to access the database.MYSQL_PASSWORD: The password for the MySQL user.MYSQL_DATABASE: The name of the MySQL database where the gateway client records will be stored.
-
Set up Virtual Environment:
Create and activate a virtual environment to manage project dependencies:
python -m venv venv source venv/bin/activate # On macOS and Linux venv\Scripts\activate # On Windows
-
Install Dependencies:
Install required Python dependencies using
pip:pip install -r requirements.txt
To create a new gateway client, use the following command:
python gc_cli.py create --msisdn MSISDN --protocols PROTOCOLS--msisdn MSISDN: Specify the MSISDN (Mobile Station International Subscriber Directory Number) of the client.--protocols PROTOCOLS: Specify the protocol(s) of the client, separated by commas.
To view details of existing gateway client(s), use the following command:
python gc_cli.py view [--msisdn MSISDN]--msisdn MSISDN: (Optional) Specify the MSISDN of the client to view. If not provided, details of all clients will be displayed.
To update details of an existing gateway client, use the following command:
python gc_cli.py update --msisdn MSISDN [--country COUNTRY] [--operator OPERATOR] [--protocols PROTOCOLS]--msisdn MSISDN: Specify the MSISDN of the client to update.--country COUNTRY: (Optional) Specify the new country value for the client.--operator OPERATOR: (Optional) Specify the new operator value for the client.--protocols PROTOCOLS: (Optional) Specify the new protocol(s) value for the client, separated by commas.