pydoautomator
The Digital Ocean python automation lib
Install
pip install pydoautomator
Simple as that
from pydoautomator import Automator, Droplet
digital_ocean_token = 'my-digital-ocean-api-token'
aut = Automator(digital_ocean_token)
droplet_data = {
"name" : "t1.techno24x7.com",
"region" : "nyc1",
"size" : "s-8vcpu-16gb",
"image" : 68259296, # snapshot id
"ssh_keys" : [27410347, 27608055, 27590881],
"private_networking" : True,
"vpc_uuid" : "47e5c00a-2b23-4dac-bed4-0e44659941f3",
"monitoring" : True
"tags" : ["tests"]
}
droplet = Droplet(**droplet_data)
aut.create_droplet_from_snapshot(droplet)
Assign floating ip to droplet
droplet_id = 152412424
floating_ip = '164.90.252.72'
action_status = aut.assign_floating_ip_to_droplet(floating_ip, droplet_id)
if action_status == 'completed':
print('floating_ip assigned to droplet!')
Create droplet and assign floating ip as soon as droplet created
digital_ocean_token = 'my-super-cool-digital-ocean-api-token'
aut = Automator(digital_ocean_token)
droplet_data = {
"name": "t1.techno24x7.com",
"region": "nyc1",
"size": "s-8vcpu-16gb",
"image": 70649304, # snapshot id
"ssh_keys": [27410347, 27608055, 27590881],
"private_networking": True,
"vpc_uuid": "47e5c00a-2b23-4dac-bed4-0e44659941f3",
"monitoring": True
}
droplet = Droplet(**droplet_data)
droplet_id = aut.create_droplet_from_snapshot(droplet)
floating_ip = '164.90.252.72'
action_status = aut.assign_floating_ip_to_droplet(floating_ip, droplet_id)
if action_status == 'completed':
print('floating_ip assigned to droplet!')
Shutdown / turnoff droplet
droplet_id = 123456
aut.turnoff_droplet(droplet_id)
Destroy droplet by id
droplet_id = 123456
aut.destroy_droplet(droplet_id)
Get all droplets
droplets_list = aut.get_all_droplets(droplet_id)
Metadata
Release files for pydoautomator 0.8.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pydoautomator-0.8.3.tar.gz | 8.4 kB | Without provenance | Details for pydoautomator-0.8.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pydoautomator-0.8.3-py3-none-any.whl | Python 3 | none | any | Details for pydoautomator-0.8.3-py3-none-any.whl |
Total release size: 17.6 kB
Release files / pydoautomator-0.8.3.tar.gz
| Download URL | pydoautomator-0.8.3.tar.gz |
|---|---|
| Size | 8.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5136a7d894115bfc2f6c8f182dc644af9ae0f584b9e89d163536dd4d30bccfbb
|
|
BLAKE2b-256 checksum How to use checksums |
1548a672c00be41ca062380528fa6ed2a9be3d6f36ee6c9d147884e0545e9bba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.6.12 Linux/5.4.0-1031-azure
|
Release files / pydoautomator-0.8.3-py3-none-any.whl
| Download URL | pydoautomator-0.8.3-py3-none-any.whl |
|---|---|
| Size | 9.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9be6358f88dbc90295fae78953bbb28b1765cd0797186da846d9a8c4ebf7a5df
|
|
BLAKE2b-256 checksum How to use checksums |
ee8db40eeb9c6f4b3eb6e5a180eae0f53781d1ba8baf3afd6d3775fcab72cd35
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.6.12 Linux/5.4.0-1031-azure
|
Security for pydoautomator 0.8.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.