doctl 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/Gemfile +32 -0
- data/Gemfile.lock +240 -0
- data/bin/doctl +39 -0
- data/doctl.gemspec +34 -0
- data/lib/dldinternet/doctl/account/command.rb +39 -0
- data/lib/dldinternet/doctl/account/mixins/no_commands.rb +12 -0
- data/lib/dldinternet/doctl/api/account.rb +2 -0
- data/lib/dldinternet/doctl/api/account/get.rb +18 -0
- data/lib/dldinternet/doctl/api/account/ratelimit.rb +22 -0
- data/lib/dldinternet/doctl/api/auth.rb +1 -0
- data/lib/dldinternet/doctl/api/auth/get.rb +16 -0
- data/lib/dldinternet/doctl/api/auth/mixins/get/getnameservers.rb +17 -0
- data/lib/dldinternet/doctl/api/base.rb +120 -0
- data/lib/dldinternet/doctl/api/compute.rb +1 -0
- data/lib/dldinternet/doctl/api/compute/domain.rb +6 -0
- data/lib/dldinternet/doctl/api/compute/domain/create.rb +29 -0
- data/lib/dldinternet/doctl/api/compute/domain/delete.rb +28 -0
- data/lib/dldinternet/doctl/api/compute/domain/get.rb +20 -0
- data/lib/dldinternet/doctl/api/compute/domain/list.rb +24 -0
- data/lib/dldinternet/doctl/api/compute/domain/records.rb +4 -0
- data/lib/dldinternet/doctl/api/compute/domain/records/create.rb +30 -0
- data/lib/dldinternet/doctl/api/compute/domain/records/delete.rb +30 -0
- data/lib/dldinternet/doctl/api/compute/domain/records/list.rb +33 -0
- data/lib/dldinternet/doctl/api/compute/domain/records/update.rb +30 -0
- data/lib/dldinternet/doctl/auth/command.rb +19 -0
- data/lib/dldinternet/doctl/auth/init/command.rb +18 -0
- data/lib/dldinternet/doctl/auth/init/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/auth/mixins/no_commands.rb +12 -0
- data/lib/dldinternet/doctl/compute/action/command.rb +30 -0
- data/lib/dldinternet/doctl/compute/action/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/action/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/action/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/action/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/action/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/action/wait/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/action/wait/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/command.rb +81 -0
- data/lib/dldinternet/doctl/compute/domain/command.rb +105 -0
- data/lib/dldinternet/doctl/compute/domain/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/domain/records/command.rb +89 -0
- data/lib/dldinternet/doctl/compute/domain/records/mixins/no_commands.rb +62 -0
- data/lib/dldinternet/doctl/compute/droplet-action/change-kernel/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/change-kernel/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/command.rb +86 -0
- data/lib/dldinternet/doctl/compute/droplet-action/disable-backups/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/disable-backups/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/enable-ipv6/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/enable-ipv6/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/enable-private-networking/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/enable-private-networking/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/droplet-action/password-reset/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/password-reset/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/power-cycle/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/power-cycle/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/power-off/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/power-off/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/power-on/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/power-on/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/reboot/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/reboot/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/rebuild/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/rebuild/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/rename/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/rename/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/resize/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/resize/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/restore/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/restore/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/shutdown/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/shutdown/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/snapshot/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/snapshot/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet-action/upgrade/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet-action/upgrade/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/actions/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/actions/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/backups/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/backups/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/command.rb +62 -0
- data/lib/dldinternet/doctl/compute/droplet/create/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/create/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/delete/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/delete/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/kernels/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/kernels/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/droplet/neighbors/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/neighbors/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/snapshots/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/snapshots/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/tag/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/tag/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/droplet/untag/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/droplet/untag/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/assign/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/assign/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/command.rb +30 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/unassign/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip-action/unassign/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip/command.rb +34 -0
- data/lib/dldinternet/doctl/compute/floating-ip/create/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip/create/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip/delete/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip/delete/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/floating-ip/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/floating-ip/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/image-action/command.rb +26 -0
- data/lib/dldinternet/doctl/compute/image-action/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image-action/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image-action/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/image-action/transfer/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image-action/transfer/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/command.rb +46 -0
- data/lib/dldinternet/doctl/compute/image/delete/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/delete/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/list-application/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/list-application/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/list-distribution/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/list-distribution/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/list-user/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/list-user/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/image/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/image/update/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/image/update/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/mixins/no_commands.rb +12 -0
- data/lib/dldinternet/doctl/compute/plugin/command.rb +26 -0
- data/lib/dldinternet/doctl/compute/plugin/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/plugin/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/plugin/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/plugin/run/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/plugin/run/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/region/command.rb +22 -0
- data/lib/dldinternet/doctl/compute/region/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/region/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/region/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/size/command.rb +22 -0
- data/lib/dldinternet/doctl/compute/size/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/size/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/size/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/ssh-key/command.rb +42 -0
- data/lib/dldinternet/doctl/compute/ssh-key/create/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/ssh-key/create/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh-key/delete/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/ssh-key/delete/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh-key/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/ssh-key/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh-key/import/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/ssh-key/import/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh-key/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/ssh-key/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh-key/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/ssh-key/update/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/ssh-key/update/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh/command.rb +18 -0
- data/lib/dldinternet/doctl/compute/ssh/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/tag/command.rb +38 -0
- data/lib/dldinternet/doctl/compute/tag/create/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/tag/create/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/tag/delete/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/tag/delete/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/tag/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/tag/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/tag/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/tag/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/tag/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/tag/update/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/tag/update/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume-action/attach/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/volume-action/attach/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume-action/command.rb +26 -0
- data/lib/dldinternet/doctl/compute/volume-action/detach/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/volume-action/detach/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume-action/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/compute/volume/command.rb +34 -0
- data/lib/dldinternet/doctl/compute/volume/create/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/volume/create/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume/delete/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/volume/delete/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume/get/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/volume/get/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume/list/command.rb +20 -0
- data/lib/dldinternet/doctl/compute/volume/list/mixins/no_commands.rb +18 -0
- data/lib/dldinternet/doctl/compute/volume/mixins/no_commands.rb +16 -0
- data/lib/dldinternet/doctl/main.rb +35 -0
- data/lib/dldinternet/doctl/mixins/no_commands.rb +8 -0
- data/lib/dldinternet/doctl/version.rb +5 -0
- metadata +421 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module DLDInternet
|
|
2
|
+
module DOctl
|
|
3
|
+
module Auth
|
|
4
|
+
module Init
|
|
5
|
+
module MixIns
|
|
6
|
+
module NoCommands
|
|
7
|
+
|
|
8
|
+
require 'dldinternet/doctl/auth/mixins/no_commands'
|
|
9
|
+
include DLDInternet::DOctl::Auth::MixIns::NoCommands
|
|
10
|
+
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
require 'dldinternet/doctl/api/compute'
|
|
2
|
+
require 'dldinternet/doctl/compute/action/get/command'
|
|
3
|
+
require 'dldinternet/doctl/compute/action/list/command'
|
|
4
|
+
require 'dldinternet/doctl/compute/action/wait/command'
|
|
5
|
+
|
|
6
|
+
module DLDInternet
|
|
7
|
+
module DOctl
|
|
8
|
+
module Compute
|
|
9
|
+
module Action
|
|
10
|
+
class Command < DLDInternet::Thor::Command
|
|
11
|
+
no_commands do
|
|
12
|
+
|
|
13
|
+
require 'dldinternet/doctl/compute/action/mixins/no_commands'
|
|
14
|
+
include DLDInternet::DOctl::Compute::Action::MixIns::NoCommands
|
|
15
|
+
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
desc 'get SUBCOMMAND ... ARGS', 'get action'
|
|
19
|
+
subcommand 'get', ::DLDInternet::DOctl::Compute::Action::Get::Command
|
|
20
|
+
|
|
21
|
+
desc 'list SUBCOMMAND ... ARGS', 'list actions'
|
|
22
|
+
subcommand 'list', ::DLDInternet::DOctl::Compute::Action::List::Command
|
|
23
|
+
|
|
24
|
+
desc 'wait SUBCOMMAND ... ARGS', 'wait for action to complete'
|
|
25
|
+
subcommand 'wait', ::DLDInternet::DOctl::Compute::Action::Wait::Command
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'dldinternet/doctl/api/compute'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module DOctl
|
|
5
|
+
module Compute
|
|
6
|
+
module Action
|
|
7
|
+
module Get
|
|
8
|
+
class Command < DLDInternet::Thor::Command
|
|
9
|
+
no_commands do
|
|
10
|
+
|
|
11
|
+
require 'dldinternet/doctl/compute/action/get/mixins/no_commands'
|
|
12
|
+
include DLDInternet::DOctl::Compute::Action::Get::MixIns::NoCommands
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module DLDInternet
|
|
2
|
+
module DOctl
|
|
3
|
+
module Compute
|
|
4
|
+
module Action
|
|
5
|
+
module Get
|
|
6
|
+
module MixIns
|
|
7
|
+
module NoCommands
|
|
8
|
+
|
|
9
|
+
require 'dldinternet/doctl/compute/action/mixins/no_commands'
|
|
10
|
+
include DLDInternet::DOctl::Compute::Action::MixIns::NoCommands
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'dldinternet/doctl/api/compute'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module DOctl
|
|
5
|
+
module Compute
|
|
6
|
+
module Action
|
|
7
|
+
module List
|
|
8
|
+
class Command < DLDInternet::Thor::Command
|
|
9
|
+
no_commands do
|
|
10
|
+
|
|
11
|
+
require 'dldinternet/doctl/compute/action/list/mixins/no_commands'
|
|
12
|
+
include DLDInternet::DOctl::Compute::Action::List::MixIns::NoCommands
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module DLDInternet
|
|
2
|
+
module DOctl
|
|
3
|
+
module Compute
|
|
4
|
+
module Action
|
|
5
|
+
module List
|
|
6
|
+
module MixIns
|
|
7
|
+
module NoCommands
|
|
8
|
+
|
|
9
|
+
require 'dldinternet/doctl/compute/action/mixins/no_commands'
|
|
10
|
+
include DLDInternet::DOctl::Compute::Action::MixIns::NoCommands
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module DLDInternet
|
|
2
|
+
module DOctl
|
|
3
|
+
module Compute
|
|
4
|
+
module Action
|
|
5
|
+
module MixIns
|
|
6
|
+
module NoCommands
|
|
7
|
+
|
|
8
|
+
require 'dldinternet/doctl/compute/mixins/no_commands'
|
|
9
|
+
include DLDInternet::DOctl::Compute::MixIns::NoCommands
|
|
10
|
+
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
require 'dldinternet/doctl/api/compute'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module DOctl
|
|
5
|
+
module Compute
|
|
6
|
+
module Action
|
|
7
|
+
module Wait
|
|
8
|
+
class Command < DLDInternet::Thor::Command
|
|
9
|
+
no_commands do
|
|
10
|
+
|
|
11
|
+
require 'dldinternet/doctl/compute/action/wait/mixins/no_commands'
|
|
12
|
+
include DLDInternet::DOctl::Compute::Action::Wait::MixIns::NoCommands
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
module DLDInternet
|
|
2
|
+
module DOctl
|
|
3
|
+
module Compute
|
|
4
|
+
module Action
|
|
5
|
+
module Wait
|
|
6
|
+
module MixIns
|
|
7
|
+
module NoCommands
|
|
8
|
+
|
|
9
|
+
require 'dldinternet/doctl/compute/action/mixins/no_commands'
|
|
10
|
+
include DLDInternet::DOctl::Compute::Action::MixIns::NoCommands
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
end
|
|
18
|
+
end
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
require 'dldinternet/doctl/compute/action/command'
|
|
2
|
+
require 'dldinternet/doctl/compute/droplet-action/command'
|
|
3
|
+
require 'dldinternet/doctl/compute/droplet/command'
|
|
4
|
+
require 'dldinternet/doctl/compute/domain/command'
|
|
5
|
+
require 'dldinternet/doctl/compute/floating-ip/command'
|
|
6
|
+
require 'dldinternet/doctl/compute/floating-ip-action/command'
|
|
7
|
+
require 'dldinternet/doctl/compute/image/command'
|
|
8
|
+
require 'dldinternet/doctl/compute/image-action/command'
|
|
9
|
+
require 'dldinternet/doctl/compute/plugin/command'
|
|
10
|
+
require 'dldinternet/doctl/compute/region/command'
|
|
11
|
+
require 'dldinternet/doctl/compute/size/command'
|
|
12
|
+
require 'dldinternet/doctl/compute/ssh-key/command'
|
|
13
|
+
require 'dldinternet/doctl/compute/tag/command'
|
|
14
|
+
require 'dldinternet/doctl/compute/volume/command'
|
|
15
|
+
require 'dldinternet/doctl/compute/volume-action/command'
|
|
16
|
+
require 'dldinternet/doctl/compute/ssh/command'
|
|
17
|
+
require 'dldinternet/doctl//compute/action/command'
|
|
18
|
+
|
|
19
|
+
module DLDInternet
|
|
20
|
+
module DOctl
|
|
21
|
+
module Compute
|
|
22
|
+
class Command < DLDInternet::Thor::Command
|
|
23
|
+
no_commands do
|
|
24
|
+
|
|
25
|
+
require 'dldinternet/doctl/compute/mixins/no_commands'
|
|
26
|
+
include DLDInternet::DOctl::Compute::MixIns::NoCommands
|
|
27
|
+
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
desc 'actions SUBCOMMAND ... ARGS', 'action commands'
|
|
31
|
+
subcommand 'actions', ::DLDInternet::DOctl::Compute::Action::Command
|
|
32
|
+
|
|
33
|
+
desc 'droplet-action SUBCOMMAND ... ARGS', 'droplet action commands'
|
|
34
|
+
subcommand 'droplet-action', ::DLDInternet::DOctl::Compute::DropletAction::Command
|
|
35
|
+
|
|
36
|
+
desc 'droplet SUBCOMMAND ... ARGS', 'droplet commands'
|
|
37
|
+
subcommand 'droplet', ::DLDInternet::DOctl::Compute::Droplet::Command
|
|
38
|
+
|
|
39
|
+
desc 'domain SUBCOMMAND ... ARGS', 'domain commands'
|
|
40
|
+
subcommand 'domain', ::DLDInternet::DOctl::Compute::Domain::Command
|
|
41
|
+
|
|
42
|
+
desc 'floating-ip SUBCOMMAND ... ARGS', 'floating IP commands'
|
|
43
|
+
subcommand 'floating-ip', ::DLDInternet::DOctl::Compute::FloatingIp::Command
|
|
44
|
+
|
|
45
|
+
desc 'floating-ip-action SUBCOMMAND ... ARGS', 'floating IP action commands'
|
|
46
|
+
subcommand 'floating-ip-action', ::DLDInternet::DOctl::Compute::FloatingIpAction::Command
|
|
47
|
+
|
|
48
|
+
desc 'image SUBCOMMAND ... ARGS', 'image commands'
|
|
49
|
+
subcommand 'image', ::DLDInternet::DOctl::Compute::Image::Command
|
|
50
|
+
|
|
51
|
+
desc 'image-action SUBCOMMAND ... ARGS', 'image-action commands'
|
|
52
|
+
subcommand 'image-action', ::DLDInternet::DOctl::Compute::ImageAction::Command
|
|
53
|
+
|
|
54
|
+
desc 'plugin SUBCOMMAND ... ARGS', 'plugin commands'
|
|
55
|
+
subcommand 'plugin', ::DLDInternet::DOctl::Compute::Plugin::Command
|
|
56
|
+
|
|
57
|
+
desc 'region SUBCOMMAND ... ARGS', 'region commands'
|
|
58
|
+
subcommand 'region', ::DLDInternet::DOctl::Compute::Region::Command
|
|
59
|
+
|
|
60
|
+
desc 'size SUBCOMMAND ... ARGS', 'size commands'
|
|
61
|
+
subcommand 'size', ::DLDInternet::DOctl::Compute::Size::Command
|
|
62
|
+
|
|
63
|
+
desc 'ssh-key SUBCOMMAND ... ARGS', 'sshkey commands'
|
|
64
|
+
subcommand 'ssh-key', ::DLDInternet::DOctl::Compute::SshKey::Command
|
|
65
|
+
|
|
66
|
+
desc 'tag SUBCOMMAND ... ARGS', 'tag commands'
|
|
67
|
+
subcommand 'tag', ::DLDInternet::DOctl::Compute::Tag::Command
|
|
68
|
+
|
|
69
|
+
desc 'volume SUBCOMMAND ... ARGS', 'volume commands'
|
|
70
|
+
subcommand 'volume', ::DLDInternet::DOctl::Compute::Volume::Command
|
|
71
|
+
|
|
72
|
+
desc 'volume-action SUBCOMMAND ... ARGS', 'volume action commands'
|
|
73
|
+
subcommand 'volume-action', ::DLDInternet::DOctl::Compute::VolumeAction::Command
|
|
74
|
+
|
|
75
|
+
desc 'ssh SUBCOMMAND ... ARGS', 'ssh to droplet'
|
|
76
|
+
subcommand 'ssh', ::DLDInternet::DOctl::Compute::Ssh::Command
|
|
77
|
+
|
|
78
|
+
end
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
require 'dldinternet/doctl/api/compute'
|
|
2
|
+
require 'dldinternet/doctl/compute/domain/records/command'
|
|
3
|
+
|
|
4
|
+
module DLDInternet
|
|
5
|
+
module DOctl
|
|
6
|
+
module Compute
|
|
7
|
+
module Domain
|
|
8
|
+
class Command < DLDInternet::Thor::Command
|
|
9
|
+
no_commands do
|
|
10
|
+
|
|
11
|
+
require 'dldinternet/doctl/compute/domain/mixins/no_commands'
|
|
12
|
+
include DLDInternet::DOctl::Compute::Domain::MixIns::NoCommands
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc 'list ARGS', 'list domains'
|
|
17
|
+
def list()
|
|
18
|
+
command_pre
|
|
19
|
+
res = DLDInternet::DOctl::API::Compute::Domain::List.new(options, @logger).GetDomainList()
|
|
20
|
+
@header = -> { sprintf('%-17s%s', 'Domain', 'TTL') }
|
|
21
|
+
@format = ->(obj) { sprintf('%-17s%s', obj[:name], obj[:ttl] ) }
|
|
22
|
+
command_out(res)
|
|
23
|
+
# case options[:format]
|
|
24
|
+
# when /text|none/
|
|
25
|
+
# output sprintf('%-17s%s', 'Domain', 'TTL')
|
|
26
|
+
# res.each do |obj|
|
|
27
|
+
# output sprintf('%-17s%s', obj[:name], obj[:ttl] )
|
|
28
|
+
# end
|
|
29
|
+
# else
|
|
30
|
+
# output res
|
|
31
|
+
# end
|
|
32
|
+
0
|
|
33
|
+
end
|
|
34
|
+
|
|
35
|
+
desc 'get SUBCOMMAND ... ARGS', 'get domain'
|
|
36
|
+
method_option :header, type: :boolean, desc: 'show/hide headers', default: true
|
|
37
|
+
method_option :format_string, type: :string, desc: 'Columns for output in a comma seperated list. Possible values: Domain,TTL', default: 'Domain,TTL'
|
|
38
|
+
def get(domain)
|
|
39
|
+
formats = Hashie::Mash.new({
|
|
40
|
+
Domain: [ :name, '%-16s', :to_s ],
|
|
41
|
+
TTL: [ :ttl, '%-6s', :to_i ],
|
|
42
|
+
})
|
|
43
|
+
format_names = options[:format_string].split(/,/)
|
|
44
|
+
format_templ = format_names.map { |name| formats[name][1] }.join('')
|
|
45
|
+
|
|
46
|
+
@header = -> { sprintf(format_templ, *format_names) }
|
|
47
|
+
@format = ->(o) {
|
|
48
|
+
# h = Hashie::Mash.new(hash_it(o))
|
|
49
|
+
sprintf(format_templ, *(format_names.map{ |n|
|
|
50
|
+
if o.respond_to?(formats[n][0])
|
|
51
|
+
o.send(formats[n][0]).send(formats[n][2])
|
|
52
|
+
else
|
|
53
|
+
$stderr.write "#{n} not in #{o.class.name}::#{hash_it(o)}\n"
|
|
54
|
+
''
|
|
55
|
+
end
|
|
56
|
+
})) }
|
|
57
|
+
command_pre(domain)
|
|
58
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Get.new(options, @logger).GetDomain(domain))
|
|
59
|
+
0
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
desc 'create ARGS', 'create domain'
|
|
63
|
+
method_option :header, type: :boolean, desc: 'show/hide headers', default: true
|
|
64
|
+
method_option :format_string, type: :string, desc: 'Columns for output in a comma seperated list. Possible values: Domain,TTL', default: 'Domain,TTL'
|
|
65
|
+
method_option :ip_address, type: :string, desc: 'IP address', required: true
|
|
66
|
+
def create(domain)
|
|
67
|
+
formats = Hashie::Mash.new({
|
|
68
|
+
Domain: [ :name, '%-16s', :to_s ],
|
|
69
|
+
TTL: [ :ttl, '%-6s', :to_i ],
|
|
70
|
+
})
|
|
71
|
+
format_names = options[:format_string].split(/,/)
|
|
72
|
+
format_templ = format_names.map { |name| formats[name][1] }.join('')
|
|
73
|
+
|
|
74
|
+
@header = -> { sprintf(format_templ, *format_names) }
|
|
75
|
+
@format = ->(o) {
|
|
76
|
+
# h = Hashie::Mash.new(hash_it(o))
|
|
77
|
+
sprintf(format_templ, *(format_names.map{ |n|
|
|
78
|
+
if o.respond_to?(formats[n][0])
|
|
79
|
+
o.send(formats[n][0]).send(formats[n][2])
|
|
80
|
+
else
|
|
81
|
+
$stderr.write "#{n} not in #{o.class.name}::#{hash_it(o)}\n"
|
|
82
|
+
''
|
|
83
|
+
end
|
|
84
|
+
})) }
|
|
85
|
+
command_pre(domain)
|
|
86
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Create.new(options, @logger).CreateDomain(domain, options[:ip_address]))
|
|
87
|
+
0
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
desc 'delete SUBCOMMAND ... ARGS', 'delete droplet'
|
|
91
|
+
def delete(domain)
|
|
92
|
+
@header = -> { }
|
|
93
|
+
@format = ->(o) { o.ai }
|
|
94
|
+
command_pre(domain)
|
|
95
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Delete.new(options, @logger).DeleteDomain(domain))
|
|
96
|
+
0
|
|
97
|
+
end
|
|
98
|
+
|
|
99
|
+
desc 'records SUBCOMMAND ... ARGS', 'domain record commands'
|
|
100
|
+
subcommand 'records', ::DLDInternet::DOctl::Compute::Domain::Records::Command
|
|
101
|
+
end
|
|
102
|
+
end
|
|
103
|
+
end
|
|
104
|
+
end
|
|
105
|
+
end
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module DLDInternet
|
|
2
|
+
module DOctl
|
|
3
|
+
module Compute
|
|
4
|
+
module Domain
|
|
5
|
+
module MixIns
|
|
6
|
+
module NoCommands
|
|
7
|
+
|
|
8
|
+
require 'dldinternet/doctl/compute/mixins/no_commands'
|
|
9
|
+
include DLDInternet::DOctl::Compute::MixIns::NoCommands
|
|
10
|
+
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
end
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
require 'dldinternet/doctl/api/compute'
|
|
2
|
+
|
|
3
|
+
module DLDInternet
|
|
4
|
+
module DOctl
|
|
5
|
+
module Compute
|
|
6
|
+
module Domain
|
|
7
|
+
module Records
|
|
8
|
+
class Command < DLDInternet::Thor::Command
|
|
9
|
+
no_commands do
|
|
10
|
+
|
|
11
|
+
require 'dldinternet/doctl/compute/domain/records/mixins/no_commands'
|
|
12
|
+
include DLDInternet::DOctl::Compute::Domain::Records::MixIns::NoCommands
|
|
13
|
+
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc 'list ARGS', 'list records'
|
|
17
|
+
method_option :domain_name, type: :string, desc: 'Domain name'
|
|
18
|
+
method_option :header, type: :boolean, desc: 'show/hide headers', default: true
|
|
19
|
+
method_option :format_string, type: :string, desc: 'Columns for output in a comma seperated list. Possible values: ID,Type,Name,Data,Priority,Port,Weight', default: 'ID,Type,Name,Data,Priority,Port,Weight'
|
|
20
|
+
def list(domain)
|
|
21
|
+
records_formats
|
|
22
|
+
command_pre(domain)
|
|
23
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Records::List.new(options, @logger).GetDomainRecordsList(domain))
|
|
24
|
+
0
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
desc 'create ARGS', 'create record'
|
|
28
|
+
method_option :header, type: :boolean, desc: 'show/hide headers', default: true
|
|
29
|
+
method_option :format_string, type: :string, desc: 'Columns for output in a comma seperated list. Possible values: ID,Type,Name,Data,Priority,Port,Weight', default: 'ID,Type,Name,Data,Priority,Port,Weight'
|
|
30
|
+
method_option :record_name, type: :string, desc: 'Record name', required: true
|
|
31
|
+
method_option :record_type, type: :string, desc: 'Record type', required: true
|
|
32
|
+
method_option :record_data, type: :string, desc: 'Record data', required: true
|
|
33
|
+
method_option :record_port, type: :numeric, desc: 'Record port', default: nil
|
|
34
|
+
method_option :record_priority, type: :numeric, desc: 'Record priority', default: nil
|
|
35
|
+
method_option :record_weight, type: :numeric, desc: 'Record weight', default: nil
|
|
36
|
+
def create(domain)
|
|
37
|
+
records_formats
|
|
38
|
+
command_pre(domain)
|
|
39
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Records::Create.new(options, @logger).CreateDomainRecord(domain, record_from_options))
|
|
40
|
+
0
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
desc 'delete ARGS', 'delete record'
|
|
44
|
+
method_option :header, type: :boolean, desc: 'show/hide headers', default: true
|
|
45
|
+
method_option :format_string, type: :string, desc: 'Columns for output in a comma seperated list. Possible values: ID,Type,Name,Data,Priority,Port,Weight', default: 'ID,Type,Name,Data,Priority,Port,Weight'
|
|
46
|
+
def delete(domain, id)
|
|
47
|
+
# @header = -> { }
|
|
48
|
+
# @format = ->(o) { o.ai }
|
|
49
|
+
records_formats
|
|
50
|
+
command_pre(domain)
|
|
51
|
+
DLDInternet::DOctl::API::Compute::Domain::Records::Delete.new(options, @logger).DeleteDomainRecord(domain, id)
|
|
52
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Records::List.new(options, @logger).GetDomainRecordsList(domain))
|
|
53
|
+
0
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
desc 'update ARGS', 'update record'
|
|
57
|
+
method_option :header, type: :boolean, desc: 'show/hide headers', default: true
|
|
58
|
+
method_option :format_string, type: :string, desc: 'Columns for output in a comma seperated list. Possible values: ID,Type,Name,Data,Priority,Port,Weight', default: 'ID,Type,Name,Data,Priority,Port,Weight'
|
|
59
|
+
method_option :record_id, type: :numeric, desc: 'Record ID', required: true
|
|
60
|
+
method_option :record_name, type: :string, desc: 'Record name', required: true
|
|
61
|
+
method_option :record_type, type: :string, desc: 'Record type', required: true
|
|
62
|
+
method_option :record_data, type: :string, desc: 'Record data', required: true
|
|
63
|
+
method_option :record_port, type: :numeric, desc: 'Record port', default: nil
|
|
64
|
+
method_option :record_priority, type: :numeric, desc: 'Record priority', default: nil
|
|
65
|
+
method_option :record_weight, type: :numeric, desc: 'Record weight', default: nil
|
|
66
|
+
def update(domain)
|
|
67
|
+
records_formats
|
|
68
|
+
command_pre(domain)
|
|
69
|
+
res = DLDInternet::DOctl::API::Compute::Domain::Records::Update.new(options, @logger).UpdateDomainRecord(domain, record_from_options, options[:record_id])
|
|
70
|
+
if res.is_a?(::DropletKit::DomainRecord)
|
|
71
|
+
res = DLDInternet::DOctl::API::Compute::Domain::Records::Delete.new(options, @logger).DeleteDomainRecord(domain, options[:record_id])
|
|
72
|
+
if res === true
|
|
73
|
+
command_out(DLDInternet::DOctl::API::Compute::Domain::Records::List.new(options, @logger).GetDomainRecordsList(domain))
|
|
74
|
+
0
|
|
75
|
+
else
|
|
76
|
+
command_out(res)
|
|
77
|
+
1
|
|
78
|
+
end
|
|
79
|
+
else
|
|
80
|
+
command_out(res)
|
|
81
|
+
1
|
|
82
|
+
end
|
|
83
|
+
end
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
end
|
|
87
|
+
end
|
|
88
|
+
end
|
|
89
|
+
end
|