https://github.com/keygen-sh/example-python-bulk-machine-deactivation
An example of deactivating a license's machines in bulk using Keygen's API
https://github.com/keygen-sh/example-python-bulk-machine-deactivation
Last synced: 3 months ago
JSON representation
An example of deactivating a license's machines in bulk using Keygen's API
- Host: GitHub
- URL: https://github.com/keygen-sh/example-python-bulk-machine-deactivation
- Owner: keygen-sh
- License: mit
- Created: 2023-12-11T18:29:52.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2023-12-14T03:46:12.000Z (almost 2 years ago)
- Last Synced: 2025-06-30T00:38:31.758Z (3 months ago)
- Language: Python
- Size: 2.93 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Example Bulk Machine Deactivation
This is an example of how to deactivate a license's machines in bulk using
Keygen's API, written in Python. Depending on how many machines you're
deactivating, you may need to implement rate-limiting behavior.## Running the example
First up, configure a few environment variables:
```bash
# Your Keygen account ID. Find yours at https://app.keygen.sh/settings.
export KEYGEN_ACCOUNT_ID="YOUR_KEYGEN_ACCOUNT_ID"# A Keygen license ID. Used for deactivating the license's machines.
export KEYGEN_LICENSE_ID="A_KEYGEN_LICENSE_ID"# A Keygen license ID. Used for API authentication.
export KEYGEN_LICENSE_KEY="A_KEYGEN_LICENSE_KEY"
```You can either run each line above within your terminal session before
starting the app, or you can add the above contents to your `~/.bashrc`
file and then run `source ~/.bashrc` after saving the file.Next, install dependencies with [`pip`](https://packaging.python.org/):
```
python3 -m pip install -r requirements.txt
```To perform a bulk deactivation, run the script:
```
python3 main.py
```The script will paginate through the license's machines and deactivate each one.
## Questions?
Reach out at [support@keygen.sh](mailto:support@keygen.sh) if you have any
questions or concerns!