|
| 1 | +<?php |
| 2 | +/** |
| 3 | + * This file is part of the php-github-api package. |
| 4 | + * |
| 5 | + * For the full copyright and license information, please view the LICENSE |
| 6 | + * file that was distributed with this source code. |
| 7 | + */ |
| 8 | + |
| 9 | +namespace Github\Api\Enterprise; |
| 10 | + |
| 11 | +use Github\Api\AbstractApi; |
| 12 | + |
| 13 | +class ManagementConsole extends AbstractApi |
| 14 | +{ |
| 15 | + /** |
| 16 | + * Checks the status of your installation’s most recent configuration process. |
| 17 | + * @link https://developer.github.com/v3/enterprise/management_console/#check-configuration-status |
| 18 | + * |
| 19 | + * @param string $hash md5 hash of your license |
| 20 | + * @return array array of configuration status information |
| 21 | + */ |
| 22 | + public function configcheck($hash) |
| 23 | + { |
| 24 | + return $this->get('/setup/api/configcheck', $hash); |
| 25 | + } |
| 26 | + |
| 27 | + /** |
| 28 | + * Retrieves your installation’s settings. |
| 29 | + * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-settings |
| 30 | + * |
| 31 | + * @param string $hash md5 hash of your license |
| 32 | + * @return array array of settings |
| 33 | + */ |
| 34 | + public function settings($hash) |
| 35 | + { |
| 36 | + return $this->get('/setup/api/settings', $hash); |
| 37 | + } |
| 38 | + |
| 39 | + /** |
| 40 | + * Checks your installation’s maintenance status. |
| 41 | + * @link https://developer.github.com/v3/enterprise/management_console/#check-maintenance-status |
| 42 | + * |
| 43 | + * @param string $hash md5 hash of your license |
| 44 | + * @return array array of maintenance status information |
| 45 | + */ |
| 46 | + public function maintenance($hash) |
| 47 | + { |
| 48 | + return $this->get('/setup/api/maintenance', $hash); |
| 49 | + } |
| 50 | + |
| 51 | + /** |
| 52 | + * Retrieves your installation’s authorized SSH keys. |
| 53 | + * @link https://developer.github.com/v3/enterprise/management_console/#retrieve-authorized-ssh-keys |
| 54 | + * |
| 55 | + * @param string $hash md5 hash of your license |
| 56 | + * @return array array of authorized keys |
| 57 | + */ |
| 58 | + public function keys($hash) |
| 59 | + { |
| 60 | + return $this->get('/setup/api/settings/authorized-keys', $hash); |
| 61 | + } |
| 62 | + |
| 63 | + public function getClient() |
| 64 | + { |
| 65 | + return $this->client; |
| 66 | + } |
| 67 | + |
| 68 | + /** |
| 69 | + * Sends an authenticated GET request. |
| 70 | + * |
| 71 | + * @see \Github\Api\AbstractApi::get() |
| 72 | + * @param string $uri |
| 73 | + * @param array $hash |
| 74 | + * @return \Guzzle\Http\EntityBodyInterface|mixed|string |
| 75 | + */ |
| 76 | + protected function get($uri, $hash) |
| 77 | + { |
| 78 | + return parent::get($uri, array('auth' => array('license', rawurlencode($hash)))); |
| 79 | + } |
| 80 | +} |
0 commit comments