| Path: | lib/rhc-common.rb |
| Last Update: | Tue Feb 05 11:30:18 -0500 2013 |
Public: Add or upload an ssh key
type - The String type RSA or DSS. command - The String value ‘add’ or ‘update’ identifier - The String value to identify the key pub_key_file_path - The String file path of the public key rhlogin - The String login to the broker password- The String password for the user
Examples
generate_ssh_key_ruby('add', 'newkeyname', '~/.ssh/id_rsa',
'mylogin', 'mypass')
# => /home/user/.ssh/id_rsa.pub
Returns nil on success or HTTP object on failure
Public: Generate an SSH key and store it in ~/.ssh/id_rsa
type - The String type RSA or DSS. bits - The Integer value for number of bits. comment - The String comment for the key
Examples
generate_ssh_key_ruby() # => /home/user/.ssh/id_rsa.pub
Returns nil on failure or public key location as a String on success
Public: Handle response message when updating keys
url - The Object URI::HTTPS data - The Hash representation of the data response password - The String password for the user
Examples
handle_key_mgmt_response(
URI.parse('https://openshift.redhat.com/broker/ssh_keys'),
{
:rhlogin=>"rhnlogin@example.com",
:key_name=>"default",
:action=>"update-key",
:ssh=>"AAAAB3NzaC1yc2EAAAADAQABAAAAgQCrXG5c.....",
:key_type=>"ssh-rsa"},
'mypass')
# => nil
Returns nil on Success and RHC::http object on failure
Public: Run ssh command on remote host
host - The String of the remote hostname to ssh to. username - The String username of the remote user to ssh as. command - The String command to run on the remote host.
Examples
ssh_ruby('myapp-t.rhcloud.com',
'109745632b514e9590aa802ec015b074',
'rhcsh tail -f $OPENSHIFT_LOG_DIR/*"')
# => true
Returns true on success