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 and Oracle Cloud 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' 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 cloud providers (Vultr)
- Add codecov
Metadata
Release files for cloud-detect 0.0.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| cloud-detect-0.0.10.tar.gz | 7.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| cloud_detect-0.0.10-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 17.3 kB
Release files / cloud-detect-0.0.10.tar.gz
| Download URL | cloud-detect-0.0.10.tar.gz |
|---|---|
| Size | 7.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89eaef1d1be89376d686dbdb779e14874b2e86bc3f0100776dddea5bb53c2664
|
|
BLAKE2b-256 checksum How to use checksums |
e9a458751f6a2adb737262d577a673cc266d319c32a0943e727bcb9d42a5b837
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3
|
Release files / cloud_detect-0.0.10-py3-none-any.whl
| Download URL | cloud_detect-0.0.10-py3-none-any.whl |
|---|---|
| Size | 10.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b1fabeb0262379eb94e56dde2cdcef2699b428bf4cd410e360204b31dd174f58
|
|
BLAKE2b-256 checksum How to use checksums |
ec75a2e7df26ede614341f325f5b873eeb5debec77a864873e27f423a9e21376
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.48.0 CPython/3.8.3
|