Module: Octokit::EnterpriseManagementConsoleClient::ManagementConsole
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | lib/octokit/enterprise_management_console_client/management_console.rb |
Overview
Methods for the Enterprise Management Console API
Instance Method Summary
-
#add_authorized_key(key) ⇒ Sawyer::Resource
Add an authorized SSH keys on the Enterprise install.
-
#authorized_keys ⇒ Sawyer::Resource
(also: #get_authorized_keys)
Fetch the authorized SSH keys on the Enterprise install.
-
#config_check
Alias for #config_status.
-
#config_status ⇒ Sawyer::Resource
(also: #config_check)
Get information about the Enterprise installation.
-
#delete_authorized_key(key)
Alias for #remove_authorized_key.
-
#edit_maintenance_status(maintenance)
Alias for #set_maintenance_status.
-
#edit_settings(settings) ⇒ nil
Modify the Enterprise settings.
-
#get_authorized_keys
Alias for #authorized_keys.
-
#get_maintenance_status
Alias for #maintenance_status.
-
#get_settings
Alias for #settings.
-
#maintenance_status ⇒ Sawyer::Resource
(also: #get_maintenance_status)
Get information about the Enterprise maintenance status.
-
#remove_authorized_key(key) ⇒ Sawyer::Resource
(also: #delete_authorized_key)
Removes an authorized SSH keys from the Enterprise install.
-
#set_maintenance_status(maintenance) ⇒ nil
(also: #edit_maintenance_status)
Start (or turn off) the Enterprise maintenance mode.
-
#settings ⇒ Sawyer::Resource
(also: #get_settings)
Get information about the Enterprise installation.
-
#start_configuration ⇒ Object
Start a configuration process.
-
#upgrade(license) ⇒ Object
Upgrade an Enterprise installation.
-
#upload_license(license, settings = nil) ⇒ Object
Uploads a license for the first time.
Instance Method Details
#add_authorized_key(key) ⇒ Sawyer::Resource
Add an authorized SSH keys on the Enterprise install
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 106
def (key) queries = password_hash case key when String if File.exist?(key) key = File.open(key, 'r') content = key.read.strip key.close else content = key end when File content = key.read.strip key.close end queries[:query][: ] = content post '/setup/api/settings/authorized-keys', queries end
#authorized_keys ⇒ Sawyer::Resource
Also known as: #get_authorized_keys
Fetch the authorized SSH keys on the Enterprise install
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 97
def get '/setup/api/settings/authorized-keys', password_hash end
#config_check
Alias for #config_status.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 54
alias config_check config_status
#config_status ⇒ Sawyer::Resource
Also known as: #config_check
Get information about the Enterprise installation
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 51
def config_status get '/setup/api/configcheck', password_hash end
#delete_authorized_key(key)
Alias for #remove_authorized_key.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 149
alias
#edit_maintenance_status(maintenance)
Alias for #set_maintenance_status.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 92
alias edit_maintenance_status set_maintenance_status
#edit_settings(settings) ⇒ nil
Modify the Enterprise settings
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 69
def edit_settings(settings) queries = password_hash queries[:query][:settings] = settings.to_json.to_s put '/setup/api/settings', queries end
#get_authorized_keys
Alias for #authorized_keys.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 100
alias
#get_maintenance_status
Alias for #maintenance_status.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 81
alias get_maintenance_status maintenance_status
#get_settings
Alias for #settings.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 62
alias get_settings settings
#maintenance_status ⇒ Sawyer::Resource
Also known as: #get_maintenance_status
Get information about the Enterprise maintenance status
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 78
def maintenance_status get '/setup/api/maintenance', password_hash end
#remove_authorized_key(key) ⇒ Sawyer::Resource
Also known as: #delete_authorized_key
Removes an authorized SSH keys from the Enterprise install
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 130
def (key) queries = password_hash case key when String if File.exist?(key) key = File.open(key, 'r') content = key.read.strip key.close else content = key end when File content = key.read.strip key.close end queries[:query][: ] = content delete '/setup/api/settings/authorized-keys', queries end
#set_maintenance_status(maintenance) ⇒ nil
Also known as: #edit_maintenance_status
Start (or turn off) the Enterprise maintenance mode
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 87
def set_maintenance_status(maintenance) queries = password_hash queries[:query][:maintenance] = maintenance.to_json.to_s post '/setup/api/maintenance', queries end
#settings ⇒ Sawyer::Resource
Also known as: #get_settings
Get information about the Enterprise installation
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 59
def settings get '/setup/api/settings', password_hash end
#start_configuration ⇒ Object
Start a configuration process.
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 30
def start_configuration post '/setup/api/configure', password_hash end
#upgrade(license) ⇒ Object
Upgrade an Enterprise installation
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 39
def upgrade(license) conn = faraday_configuration params = {} params[:license] = Faraday::UploadIO.new(license, 'binary') params[:api_key] = @management_console_password @last_response = conn.post('/setup/api/upgrade', params) end
#upload_license(license, settings = nil) ⇒ Object
Uploads a license for the first time
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 16
def upload_license(license, settings = nil) conn = faraday_configuration params = {} params[:license] = Faraday::UploadIO.new(license, 'binary') params[:password] = @management_console_password params[:settings] = settings.to_json.to_s unless settings.nil? @last_response = conn.post('/setup/api/start', params) end