Module that determines a host's cloud provider
Project description
cloud-detect
About
cloud-detect is a Python module that determines a host's cloud provider. Highly inspired by the Go based Satellite, cloud-detect uses the same techniques (file systems and provider metadata) to properly identify cloud providers.
Features
- Supports identification of Alibaba, AWS, Azure, Digital Ocean, GCP, Oracle Cloud and Vultr hosts.
- Fast and supports asyncio
- Logging integration.
- Small and extensible.
Usage
>>> from cloud_detect import provider
>>> provider()
'aws'
>>> provider() # when tested in local/non-supported cloud env
'unknown'
Right now the only possible responses are: 'alibaba', 'aws', 'azure', 'do', 'gcp', 'oci', 'vultr' or 'unknown'
You can get the list of supported providers using
>>> from cloud_detect import SUPPORTED_PROVIDERS
Installation
Via pip:
pip install cloud-detect
Examples
Termination-handler uses cloud-detect to keep the handling of termination notices on spot/preemptible instances cloud-agnostic, making easier to operate the same tooling in various distinct environments.
How to contribute
- Check for open issues or open a fresh issue to start a discussion around a feature idea or a bug.
- Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
- Write a test which shows that the bug was fixed or that the feature works as expected.
- Send a pull request and bug me until it gets merged and published.
Some things that would be great to have:
- Add more cloud providers
- Add codecov
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cloud-detect-0.0.13.tar.gz.
File metadata
- Download URL: cloud-detect-0.0.13.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
05b5bf007ed8332a26158717fe61b38bf3581e4a6eff8d35f1d03f50a6ee9822
|
|
| MD5 |
40752758a4d9da77336d4155427eeaba
|
|
| BLAKE2b-256 |
bf6224bed800541c4312b5bc73d528408c3ce7577b5f295e55630c5b7ba99841
|
File details
Details for the file cloud_detect-0.0.13-py3-none-any.whl.
File metadata
- Download URL: cloud_detect-0.0.13-py3-none-any.whl
- Upload date:
- Size: 11.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.8.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c85f6d808f8ec6c6770fb3ef7d8b3250643e64e39e8b23b06f03dc8773eb51a
|
|
| MD5 |
6d5e4cc8d8579372fcb7cc5a8a73ba1d
|
|
| BLAKE2b-256 |
515605c2aea92e2d9f6f174848230a847027adb18cdf140a9f699fe0d1e2bfa1
|