-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from marcqualie/feature/sshkeys
Add ssh key on droplet creation
- Loading branch information
Showing
5 changed files
with
58 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
module Pearl | ||
class Client | ||
|
||
module Sshkeys | ||
|
||
def sshkeys | ||
response = request("ssh_keys").body | ||
pretty_table("SSH Keys", response) | ||
end | ||
|
||
def view_sshkey(id) | ||
response = request("ssh_keys/#{id}").body | ||
data = MultiJson.load(response, symbolize_keys: true) | ||
ssh_key = data[:ssh_key][:ssh_pub_key] | ||
data[:ssh_key].delete :ssh_pub_key | ||
pretty_table('ssh key', MultiJson.dump(data)) | ||
print "\n" | ||
print ssh_key | ||
print "\n\n" | ||
end | ||
|
||
end | ||
end | ||
end |