@@ -9,20 +9,28 @@ title: Management Console | GitHub API
99
1010The Management Console API helps you manage your GitHub Enterprise installation.
1111
12+ {{#tip}}
13+
14+ You must explicitly set the port number when making API calls to the Management Console. If SSL is enabled on your Enterprise instance, the port number is ` 8443 ` ; otherwise, the port number is ` 8080 ` .
15+
16+ If you don't want to provide a port number, you'll need to configure your tool to automatically follow redirects.
17+
18+ {{/tip}}
19+
1220## Authentication
1321
1422You need to pass your [ Management Console password] ( https://help.github.com/enterprise/2.0/admin/articles/accessing-the-management-console/ ) as an authentication token to every Management Console API endpoint except [ ` /setup/api/start ` ] ( #upload-a-license-for-the-first-time ) .
1523
1624Use the ` api_key ` parameter to send this token with each request. For example:
1725
1826<pre class =" terminal " >
19- $ curl 'http://<em >hostname</em >/setup/api?api_key=<em >your-amazing-password</em >'
27+ $ curl -L 'http://<em >hostname</em >/setup/api?api_key=<em >your-amazing-password</em >'
2028</pre >
2129
2230You can also use standard HTTP authentication to send this token. For example:
2331
2432<pre class =" terminal " >
25- $ curl 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api'
33+ $ curl -L 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api'
2634</pre >
2735
2836## Upload a license for the first time
@@ -62,7 +70,7 @@ Location: http://<em>hostname</em>/setup/api/configcheck
6270### Example
6371
6472<pre class =" terminal " >
65- curl -X POST 'http://<em >hostname</em >/setup/api/start' -F license=@<em >/path/to/github-enterprise.ghl</em > -F "password=<em >your-amazing-password</em >" -F settings=< ; <em >/path/to/settings.json</em >
73+ curl -L - X POST 'http://<em >hostname</em >/setup/api/start' -F license=@<em >/path/to/github-enterprise.ghl</em > -F "password=<em >your-amazing-password</em >" -F settings=< ; <em >/path/to/settings.json</em >
6674</pre >
6775
6876## Upgrade a license
@@ -87,7 +95,7 @@ Location: http://hostname/setup/api/configcheck
8795### Example
8896
8997<pre class =" terminal " >
90- curl -X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/upgrade'
98+ curl -L - X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/upgrade'
9199</pre >
92100
93101## Check configuration status
@@ -116,7 +124,7 @@ Status | Description
116124### Example
117125
118126<pre class =" terminal " >
119- curl 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/configcheck'
127+ curl -L 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/configcheck'
120128</pre >
121129
122130## Start a configuration process
@@ -135,7 +143,7 @@ Location: http://hostname/setup/api/configcheck
135143### Example
136144
137145<pre class =" terminal " >
138- curl -X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/configure'
146+ curl -L - X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/configure'
139147</pre >
140148
141149## Retrieve settings
@@ -150,7 +158,7 @@ curl -X POST 'http://api_key:<em>your-amazing-password</em>@<em>hostname</em>/se
150158### Example
151159
152160<pre class =" terminal " >
153- curl 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings'
161+ curl -L 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings'
154162</pre >
155163
156164## Modify settings
@@ -172,7 +180,7 @@ HTTP/1.1 204 No Content
172180### Example
173181
174182<pre class =" terminal " >
175- curl -X PUT 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings' --data-urlencode "settings=`cat /path/to/settings.json`"
183+ curl -L - X PUT 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings' --data-urlencode "settings=`cat /path/to/settings.json`"
176184</pre >
177185
178186## Check maintenance status
@@ -189,7 +197,7 @@ Check your installation's maintenance status:
189197### Example
190198
191199<pre class =" terminal " >
192- curl 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/maintenance'
200+ curl -L 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/maintenance'
193201</pre >
194202
195203## Enable or disable maintenance mode
@@ -216,7 +224,7 @@ The possible values for `when` are `now` or any date parseable by
216224### Example
217225
218226<pre class =" terminal " >
219- curl -X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/maintenance' -d 'maintenance=<em >{"enabled":true, "when":"now"}</em >'
227+ curl -L - X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/maintenance' -d 'maintenance=<em >{"enabled":true, "when":"now"}</em >'
220228</pre >
221229
222230## Retrieve authorized SSH keys
@@ -231,7 +239,7 @@ curl -X POST 'http://api_key:<em>your-amazing-password</em>@<em>hostname</em>/se
231239### Example
232240
233241<pre class =" terminal " >
234- curl 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings/authorized-keys'
242+ curl -L 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings/authorized-keys'
235243</pre >
236244
237245## Add a new authorized SSH key
@@ -252,7 +260,7 @@ Name | Type | Description
252260### Example
253261
254262<pre class =" terminal " >
255- curl -X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings/authorized-keys' -F authorized_key=@<em >/path/to/key.pub</em >
263+ curl -L - X POST 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings/authorized-keys' -F authorized_key=@<em >/path/to/key.pub</em >
256264</pre >
257265
258266## Remove an authorized SSH key
@@ -273,5 +281,5 @@ Name | Type | Description
273281### Example
274282
275283<pre class =" terminal " >
276- curl -X DELETE 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings/authorized-keys' -F authorized_key=@<em >/path/to/key.pub</em >
284+ curl -L - X DELETE 'http://api_key:<em >your-amazing-password</em >@<em >hostname</em >/setup/api/settings/authorized-keys' -F authorized_key=@<em >/path/to/key.pub</em >
277285</pre >
0 commit comments