Skip to content

An example of deactivating a license's machines in bulk using Keygen's API

License

Notifications You must be signed in to change notification settings

keygen-sh/example-python-bulk-machine-deactivation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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:

# 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:

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 [email protected] if you have any questions or concerns!

About

An example of deactivating a license's machines in bulk using Keygen's API

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages