Module: Octokit::EnterpriseManagementConsoleClient::ManagementConsole
- Included in:
- Octokit::EnterpriseManagementConsoleClient
- Defined in:
- lib/octokit/enterprise_management_console_client/management_console.rb
Overview
Methods for the Enterprise Management Console API
Instance Method Summary collapse
-
#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_status ⇒ Sawyer::Resource
(also: #config_check)
Get information about the Enterprise installation.
-
#edit_settings(settings) ⇒ nil
Modify the Enterprise 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
115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 115 def (key) octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') 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][:authorized_key] = content post '/setup/api/settings/authorized-keys', queries end |
#authorized_keys ⇒ Sawyer::Resource Also known as:
Fetch the authorized SSH keys on the Enterprise install
105 106 107 108 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 105 def octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') get '/setup/api/settings/authorized-keys', password_hash end |
#config_status ⇒ Sawyer::Resource Also known as: config_check
Get information about the Enterprise installation
54 55 56 57 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 54 def config_status octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') get '/setup/api/configcheck', password_hash end |
#edit_settings(settings) ⇒ nil
Modify the Enterprise settings
74 75 76 77 78 79 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 74 def edit_settings(settings) octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') queries = password_hash queries[:query][:settings] = settings.to_json.to_s put '/setup/api/settings', queries end |
#maintenance_status ⇒ Sawyer::Resource Also known as: get_maintenance_status
Get information about the Enterprise maintenance status
84 85 86 87 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 84 def maintenance_status octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') get '/setup/api/maintenance', password_hash end |
#remove_authorized_key(key) ⇒ Sawyer::Resource Also known as:
Removes an authorized SSH keys from the Enterprise install
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 140 def (key) octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') 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][:authorized_key] = 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
94 95 96 97 98 99 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 94 def set_maintenance_status(maintenance) octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') 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
63 64 65 66 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 63 def settings octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') get '/setup/api/settings', password_hash end |
#start_configuration ⇒ Object
Start a configuration process.
31 32 33 34 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 31 def start_configuration octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') post '/setup/api/configure', password_hash end |
#upgrade(license) ⇒ Object
Upgrade an Enterprise installation
41 42 43 44 45 46 47 48 49 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 41 def upgrade(license) octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') 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
16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/octokit/enterprise_management_console_client/management_console.rb', line 16 def upload_license(license, settings = nil) octokit_warn('The Management Console API will be deprecated in GitHub Enterprise Server 3.15.0, please use the ManageGHES client instead.') 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 |