Method: Rundeck::Client::Key#update_private_key
- Defined in:
- lib/rundeck/client/key.rb
#update_private_key(path, key, options = {}) ⇒ Rundeck::ObjectifiedHash
Update a private key
Examples:
key = "-----BEGIN RSA PRIVATE KEY-----\nProc-Type:..."
Rundeck.update_private_key('path', key)
Parameters:
-
path
(String)
—
A key storage path
-
key
(String)
—
The entire private key value
-
options
(Hash)
(defaults to: {})
—
A set of options passed directly to HTTParty. See rubydoc.info/gems/httparty/HTTParty/ClassMethods
Options Hash (options):
-
:query
(Hash)
—
The parameters to pass with the request Use this hash to specify Rundeck parameters.
-
query: { project: ‘anvils’, id: ‘123456’ }
-
Returns:
Raises:
-
(Rundeck::Error::BadRequest)
—
400 error - Most likely indicates a required parameter is missing.
-
(Rundeck::Error::Unauthorized)
—
401 error - Unauthorized
-
(Rundeck::Error::Forbidden)
—
403 forbidden - ACL policies prevent accessing the given resource
-
(Rundeck::Error::NotFound)
—
404 not found - Indicates a resource could not be found at the location
-
(Rundeck::Error::MethodNotAllowed)
—
405 method not allowed - The request method is not allowed. This probably indicates a misconfiguration in a reverse proxy, such as Nginx or Apache
-
(Rundeck::Error::Conflict)
—
409 conflict - A conflicting resource exists.
-
(Rundeck::Error::InternalServerError)
—
500 server error - Indicates the Rundeck server experienced an error.
-
(Rundeck::Error::BadGateway)
—
502 bad gateway - Indicates something probably isn’t working right or is misconfigured on the Rundeck server.
-
(Rundeck::Error::ServiceUnavailable)
—
503 error - Indicates an issue on the Rundeck server.
-
(Rundeck::Error::NotFound)
—
if the key was not found
111 112 113 114 |
# File 'lib/rundeck/client/key.rb', line 111 def update_private_key(path, key, options = {}) key_check(path, 'private', options) create_or_update_key(path, key, 'private', 'put', options) end |