Skip to content

ProProgrammer/digitalocean_helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

The code here requires:

Sample usage:

  • Clone the repository where you want to run the commands
  • Navigate to digitalocean_helper directory
import os
import only_file

API_TOKEN = os.environ["DO_API_TOKEN"]

manager = only_file.get_digitalocean_manager(api_token=API_TOKEN)

# list all active droplets
all_droplets = only_file.list_active_droplets(manager)

# get a droplet instance
droplet = all_droplets[0]

# Check if a droplet is shutdown
only_file.is_droplet_shutdown(droplet)

# Turn off a droplet
only_file.shutdown_droplet(droplet)

# Destroy all turned off droplets
only_file.destroy_turnedoff_droplets(manager)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages