|
|
|
@ -4,44 +4,7 @@ import sys
|
|
|
|
|
import vultron.cmd |
|
|
|
|
import vultron.display |
|
|
|
|
|
|
|
|
|
class Help(vultron.cmd.Command): |
|
|
|
|
def init(self): |
|
|
|
|
self.uses_api = False |
|
|
|
|
|
|
|
|
|
def vultron_help(self, *args): |
|
|
|
|
# FIXME: print global help message |
|
|
|
|
pass |
|
|
|
|
|
|
|
|
|
class Account(vultron.cmd.Command): |
|
|
|
|
"""Query for account information.""" |
|
|
|
|
|
|
|
|
|
def vultron_info(self, *args): |
|
|
|
|
"""Display your account details.""" |
|
|
|
|
|
|
|
|
|
account = self.api.get("account") |
|
|
|
|
display = vultron.display.render(self.out, [account["account"]]) |
|
|
|
|
|
|
|
|
|
print(display) |
|
|
|
|
|
|
|
|
|
class VPC(vultron.cmd.Command): |
|
|
|
|
"""Query for information on VPCs.""" |
|
|
|
|
|
|
|
|
|
def vultron_list(self, *args): |
|
|
|
|
"""Display all VPCs.""" |
|
|
|
|
|
|
|
|
|
vpcs = self.api.get("vpcs") |
|
|
|
|
display = vultron.display.render(self.out, vpcs["vpcs"]) |
|
|
|
|
|
|
|
|
|
print(display) |
|
|
|
|
|
|
|
|
|
class Region(vultron.cmd.Command): |
|
|
|
|
"""Query for information on Vultr regions.""" |
|
|
|
|
|
|
|
|
|
def vultron_list(self, *args): |
|
|
|
|
regions = self.api.get("regions") |
|
|
|
|
display = vultron.display.render(self.out, regions["regions"]) |
|
|
|
|
|
|
|
|
|
print(display) |
|
|
|
|
from vultron.cmds import * |
|
|
|
|
|
|
|
|
|
@click.command() |
|
|
|
|
@click.option("--help", is_flag=True) |
|
|
|
|