dimension_shell 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -0
- data/README.md +11 -2
- data/lib/dimension_shell/cli.rb +6 -3
- data/lib/dimension_shell/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a6daf03bc5dec4d40bc7a56139bf53702fd9b67
|
4
|
+
data.tar.gz: 8f7b915d3f0fa62aa244b9d601c2b5e422b26a87
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56a2df9103aa7decc62895318004025d7d8e8b99550cc9d36e7df27e1673b13b6dd6d93a2e7fde27fb9b8ff2568235c52559b74482dbf9ed064718f2c7cfb8a1
|
7
|
+
data.tar.gz: 59950996c6539d8c541aed8b8dd3286ca1a3fc1b7e6d68309c4cbb09a69380439b08817c5426f59becf9eaea366a99f2e6f48d10c51ffc0775002a96d42fd8d9
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
- 0.5.0 Added ssh-options to the `connect` command
|
4
|
+
- 0.4.0 Added primary-ipv6 address to the output of the `list` command
|
3
5
|
- Fixed Typo in README
|
4
6
|
- 0.3.0 Added `list` command
|
5
7
|
- Added `list` command, which lists the first 250 servers for the given region.
|
data/README.md
CHANGED
@@ -14,7 +14,7 @@ root@2a00:33a0:47c0:110:1211:468:ac2d:62de:191f's password: *
|
|
14
14
|
### Connect to a specific server
|
15
15
|
|
16
16
|
```
|
17
|
-
$ dsh connect SERVERNAME -r REGION -o ORGANIZATION -u USERNAME -p PASSWORD -s SHELL_USER
|
17
|
+
$ dsh connect SERVERNAME -r REGION -o ORGANIZATION -u USERNAME -p PASSWORD -s SHELL_USER SSH-OPTIONS
|
18
18
|
```
|
19
19
|
|
20
20
|
Connects to the DimensionData-API at the specified REGION with the ORGANIZATION-id, USERNAME and PASSWORD to fetch all servers matching to SERVERNAME.
|
@@ -23,6 +23,15 @@ If a matching server is found, its primary ipv6-address is taken to open a ssh-c
|
|
23
23
|
|
24
24
|
If the SHELL_USER is omitted, the connection will be established as `root`.
|
25
25
|
|
26
|
+
Additional options for the ssh-client may be defined by appending them to the `dsh`-command:
|
27
|
+
|
28
|
+
```
|
29
|
+
$ dsh connect my-server -s root -v
|
30
|
+
```
|
31
|
+
|
32
|
+
The example above passes the verbose-option (`-v`) to ssh.
|
33
|
+
|
34
|
+
|
26
35
|
### List servers for region
|
27
36
|
|
28
37
|
```
|
@@ -34,7 +43,7 @@ Connects to the DimensionData-API at the specified Region with the ORGANIZATION-
|
|
34
43
|
If the API-call is successful the returned servernames will be printed, followed by their operating system, their current state and their primary ipv6-address:
|
35
44
|
|
36
45
|
``
|
37
|
-
super-server (UBUNTU12/64) - NORMAL
|
46
|
+
super-server (UBUNTU12/64) - NORMAL ipv6: 1234:1234:123:1234:1234:1234:123:1234
|
38
47
|
1 server/s in total.
|
39
48
|
``
|
40
49
|
|
data/lib/dimension_shell/cli.rb
CHANGED
@@ -14,10 +14,10 @@ module DimensionShell
|
|
14
14
|
%w(password -p) => :string,
|
15
15
|
}
|
16
16
|
|
17
|
-
desc 'connect SERVERNAME', 'connects to the server called SERVERNAME'
|
17
|
+
desc 'connect SERVERNAME SSH-OPTIONS', 'connects to the server called SERVERNAME'
|
18
18
|
options default_options
|
19
19
|
option :shell_user, type: :string, aliases: '-s'
|
20
|
-
def connect(servername)
|
20
|
+
def connect(servername, *ssh_options)
|
21
21
|
_init_command(options)
|
22
22
|
shell_user = options[:shell_user] || configatron.shell_user || 'root'
|
23
23
|
|
@@ -31,7 +31,10 @@ module DimensionShell
|
|
31
31
|
server = result['server'].first
|
32
32
|
primary_ipv6 = server['networkInfo']['primaryNic']['ipv6']
|
33
33
|
puts "Server \"#{servername}\" found, opening secure shell to #{shell_user}@#{primary_ipv6}."
|
34
|
-
|
34
|
+
call = "ssh #{shell_user}@#{primary_ipv6}"
|
35
|
+
call += " " + ssh_options.join(" ") if ssh_options.any?
|
36
|
+
puts call
|
37
|
+
Kernel.exec(call)
|
35
38
|
end
|
36
39
|
end
|
37
40
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dimension_shell
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Breisch
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|