{"meta":{"title":"用于管理 GitHub Enterprise Server 的 REST API 终结点","intro":"使用 REST API 管理 GitHub Enterprise Server 实例。","product":"REST API","breadcrumbs":[{"href":"/zh/enterprise-server@3.19/rest","title":"REST API"},{"href":"/zh/enterprise-server@3.19/rest/enterprise-admin","title":"企业管理"},{"href":"/zh/enterprise-server@3.19/rest/enterprise-admin/manage-ghes","title":"管理 GHES"}],"documentType":"article"},"body":"# 用于管理 GitHub Enterprise Server 的 REST API 终结点\n\n使用 REST API 管理 GitHub Enterprise Server 实例。\n\n## 关于管理 GitHub Enterprise Server API\n\n可以使用管理你的 GitHub Enterprise Server 实例 API 来管理GitHub Enterprise Server。 例如，可以检索有关实例上运行的软件版本 GitHub Enterprise Server 的信息，或者在具有多个节点的实例上，查看复制的状态。\n\n> \\[!TIP] 可以使用此 API 替换在版本 3.15 中删除\\*\\*\\*\\* 的GitHub Enterprise Server 的功能。\n\n在对管理 GitHub Enterprise Server API 的终结点进行 API 调用时指定端口号。 如果实例使用 TLS，则端口号为 8443。 否则，端口号为 8080。 如果无法提供端口号，则需要将客户端配置为自动遵循重定向。 有关详细信息，请参阅“[配置 TLS](/zh/enterprise-server@3.19/admin/configuring-settings/hardening-security-for-your-enterprise/configuring-tls)”。\n\n还可以使用 GitHub Enterprise Server 的 GitHub CLI 扩展在“管理 GitHub Enterprise Server API”中调用终结点。 有关详细信息，请参阅 [`github/gh-es`](https://github.com/github/gh-es/blob/main/README.md) 存储库。\n\n### 身份验证\n\n若要对管理 GitHub Enterprise Server API 的终结点的请求进行身份验证，请将实例的根站点管理员帐户的密码指定为身份验证令牌。 使用标准 HTTP 身份验证发送密码。\n`api_key` 用户标识根站点管理员。 以下示例演示此 API 的身份验证。 将 ROOT-SITE-ADMINISTRATOR-PASSWORD 替换为密码，将 ADMINISTRATION-PORT 替换为 8443 或 8080。\n\n```shell\ncurl -L -u \"api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD\" 'http(s)://HOSTNAME:ADMINISTRATION-PORT/manage'\n```\n\n### 以管理控制台用户身份进行身份验证\n\n管理控制台 用户帐户还可以进行身份验证以访问这些终结点。 有关详细信息，请参阅“[管理对管理控制台的访问](/zh/enterprise-server@3.19/admin/administering-your-instance/administering-your-instance-from-the-web-ui/managing-access-to-the-management-console#management-console-user)”。\n\n若要使用 管理控制台 用户帐户的密码进行身份验证，请使用标准 HTTP 身份验证。 在以下示例中，将 YOUR\\_USER\\_NAME 和 YOUR\\_PASSWORD 替换为帐户的用户名和密码。\n\n```shell\ncurl -L -u \"YOUR_USER_NAME:YOUR_PASSWORD\" 'http(s)://HOSTNAME:ADMINISTRATION-PORT/manage'\n```\n\n### 查询参数\n\n默认情况下，响应包括有关实例的所有已配置节点的信息。 在具有多个节点的实例上，详细信息源自 `/data/user/common/cluster.conf`。 可以使用以下查询参数来筛选响应，以获取有关特定节点的信息。\n\n| 查询参数           | 说明                                                                                                                                                     |\n| :------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `uuid`         | 节点的唯一标识符。                                                                                                                                              |\n| `cluster_role` | 群集中的节点所具备的角色。 有关详细信息，请参阅“[关于集群节点](/zh/enterprise-server@3.19/admin/monitoring-and-managing-your-instance/configuring-clustering/about-cluster-nodes)”。 |\n\n可以通过用逗号分隔值来为查询参数指定多个值。 例如，以下请求使用 curl 返回具有 `web-server` 或 `storage-server` 角色的任何节点。\n\n```shell\ncurl -L -u \"api_key:ROOT-SITE-ADMINISTRATOR-PASSWORD\" 'http(s)://HOSTNAME:ADMINISTRATION-PORT/manage/v1/config/nodes?cluster_role=WebServer,StorageServer'\n```\n\n> \\[!NOTE]\n> Most endpoints use `Authorization: Bearer <YOUR-TOKEN>` and `Accept: application/vnd.github+json` headers, plus `X-GitHub-Api-Version: 2022-11-28`. Curl examples below omit these standard headers for brevity.\n\n## Get the configured SSH keys\n\n```\nGET /manage/v1/access/ssh\n```\n\nGets the configured SSH keys on all available nodes. For more information, see \"Accessing the administrative shell (SSH).\"\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/access/ssh\n```\n\n**Response schema (Status: 200):**\n\nArray of objects:\n\n* `key`: string, format: ssh-key\n* `fingerprint`: string, format: ssh-key fingerprint\n\n## Set a new SSH key\n\n```\nPOST /manage/v1/access/ssh\n```\n\nAdds a SSH key to the authorized\\_keys file for your GitHub Enterprise Server instance. This will grant access via SSH to your instance. For more information, see \"Accessing the administrative shell (SSH).\"\n\n### Parameters\n\n#### Body parameters\n\n* **`key`** (string) (required)\n  The public SSH key to add to the authorized\\_keys file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/manage/v1/access/ssh \\\n  -d '{\n  \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADCIABAAAAgQCY/ZiDDOFWcZnYXPwMbvwQDofXPdHxLfxPK+HWGVPd1DLcDncYBUSB0bmCU2g9Sc+oHKLoHhXp0ivau9h+EpmQJ7V8vqsRdD9pc4aL/WAnUyF4o3Y7xL94rlRpVbVo/tNjzcvqxxyzBiYyy3GciCMpYQh/uKt56B94/5PNyIGEEw==\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nArray of objects:\n\n* `hostname`: string, format: hostname\n* `uuid`: string, format: uuid\n* `message`: string\n* `error`: string\n* `modified`: boolean\n\n## Delete a SSH key\n\n```\nDELETE /manage/v1/access/ssh\n```\n\nDeletes a SSH key from the authorized\\_keys file for your GitHub Enterprise Server instance. This will remove access via SSH to your instance. For more information, see \"Accessing the administrative shell (SSH).\"\n\n### Parameters\n\n#### Body parameters\n\n* **`key`** (string) (required)\n  The public SSH key to remove from the authorized\\_keys file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X DELETE \\\n  http(s)://HOSTNAME/manage/v1/access/ssh \\\n  -d '{\n  \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADCIABAAAAgQCY/ZiDDOFWcZnYXPwMbvwQDofXPdHxLfxPK+HWGVPd1DLcDncYBUSB0bmCU2g9Sc+oHKLoHhXp0ivau9h+EpmQJ7V8vqsRdD9pc4aL/WAnUyF4o3Y7xL94rlRpVbVo/tNjzcvqxxyzBiYyy3GciCMpYQh/uKt56B94/5PNyIGEEw==\"\n}'\n```\n\n**Response schema (Status: 200):**\n\nArray of objects:\n\n* `hostname`: string, format: hostname\n* `uuid`: string, format: uuid\n* `message`: string\n* `error`: string\n\n## Get the system requirement check results for configured cluster nodes\n\n```\nGET /manage/v1/checks/system-requirements\n```\n\nChecks if the minimum requirements for system hardware resources are met on each configured cluster node.\nThis endpoint may take several seconds to reply.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/checks/system-requirements\n```\n\n**Response schema (Status: 200):**\n\n* `status`: string, enum: `OK`, `FAILED`\n* `nodes`: array of objects:\n  * `hostname`: string\n  * `status`: string, enum: `OK`, `FAILED`\n  * `roles_status`: array of objects:\n    * `status`: string, enum: `OK`, `FAILED`\n    * `role`: string\n\n## Get the status of services running on all cluster nodes\n\n```\nGET /manage/v1/cluster/status\n```\n\nGets the status of all services running on each cluster node.\nThis endpoint may take several seconds to reply.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/cluster/status\n```\n\n**Response schema (Status: 200):**\n\n* `status`: string, enum: `UNKNOWN`, `OK`, `WARNING`, `CRITICAL`\n* `nodes`: array of objects:\n  * `hostname`: string\n  * `status`: string, enum: `UNKNOWN`, `OK`, `WARNING`, `CRITICAL`\n  * `services`: array of objects:\n    * `status`: string, enum: `UNKNOWN`, `OK`, `WARNING`, `CRITICAL`\n    * `name`: string\n    * `details`: string\n\n## Get the status of a ghe-config-apply run\n\n```\nGET /manage/v1/config/apply\n```\n\nDisplays the current status of ghe-config-apply in the environment or the status of a historical run by ID.\n\n### Parameters\n\n#### Path and query parameters\n\n* **`run_id`** (string)\n  The unique run ID of the ghe-config-apply run.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/config/apply\n```\n\n**Response schema (Status: 200):**\n\n* `running`: boolean\n* `successful`: boolean\n* `nodes`: array of objects:\n  * `run_id`: string\n  * `hostname`: string\n  * `running`: boolean\n  * `successful`: boolean\n\n## Trigger a ghe-config-apply run\n\n```\nPOST /manage/v1/config/apply\n```\n\nTriggers a run of ghe-config-apply from the ghes-manage agent on your Nomad Delegate instance.\nYou can provide a run ID or allow one to be generated randomly.\n\n### Parameters\n\n#### Body parameters\n\n* **`run_id`** (string)\n  The run ID to execute ghe-config-apply with. If not provided, a run ID will be generated randomly.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/manage/v1/config/apply \\\n  -d '{\n  \"run_id\": \"d34db33f\"\n}'\n```\n\n**Response schema (Status: 200):**\n\n* `run_id`: string\n\n## List events from ghe-config-apply\n\n```\nGET /manage/v1/config/apply/events\n```\n\nLists events from an in-process ghe-config-apply run on your Github Enterprise Server instance.\n\n### Parameters\n\n#### Path and query parameters\n\n* **`last_request_id`** (string)\n  The unique ID of the last response from a host, used for pagination.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/config/apply/events\n```\n\n**Response schema (Status: 200):**\n\n* `nodes`: array of objects:\n  * `node`: string\n  * `last_request_id`: string\n  * `events`: array of objects:\n    * `timestamp`: string\n    * `severity_text`: string\n    * `body`: string\n    * `event_name`: string\n    * `topology`: string\n    * `hostname`: string\n    * `config_run_id`: string\n    * `trace_id`: string\n    * `span_id`: string\n    * `span_parent_id`: string\n    * `span_depth`: integer\n\n## Initialize instance configuration with license and password\n\n```\nPOST /manage/v1/config/init\n```\n\nWhen you boot and set up a GitHub instance for the first time, you can use this endpoint to upload a license and set the initial root site administrator password.\nImportant\n\nTo start the configuration process and apply the license, you need to POST to /manage/v1/config/apply\n\nThe root site administrator password provided when calling this endpoint is used to authenticate for all other endpoints in the GHES Manage API and the Management Console UI.\nNote\n\nThe request body for this operation must be submitted as multipart/form-data data. You can can reference the license file by prefixing the filename with the @ symbol using curl. For more information, see the curl documentation.\n\n### Parameters\n\n#### Body parameters\n\n* **`license`** (string) (required)\n  The content of your .ghl license file.\n\n* **`password`** (string) (required)\n  The root site administrator password.\n\n### HTTP response status codes\n\n* **202** - Accepted\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/manage/v1/config/init \\\n  -d '{\n  \"license\": \"@enterprise.ghl\",\n  \"password\": \"provide-password-here!\"\n}'\n```\n\n**Response schema (Status: 202):**\n\n## Get the enterprise license information\n\n```\nGET /manage/v1/config/license\n```\n\nGets information about the license that is currently set for the enterprise.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/config/license\n```\n\n**Response schema (Status: 200):**\n\n* `advancedSecurityEnabled`: boolean\n* `advancedSecuritySeats`: integer\n* `clusterSupport`: boolean\n* `company`: string\n* `croquetSupport`: boolean\n* `customTerms`: boolean\n* `evaluation`: boolean\n* `expireAt`: string, format: date-time\n* `insightsEnabled`: boolean\n* `insightsExpireAt`: string, format: date-time\n* `learningLabEvaluationExpires`: string, format: date-time\n* `learningLabSeats`: integer\n* `perpetual`: boolean\n* `referenceNumber`: string\n* `seats`: integer\n* `sshAllowed`: boolean\n* `supportKey`: string\n* `unlimitedSeating`: boolean\n\n## Upload an enterprise license\n\n```\nPUT /manage/v1/config/license\n```\n\nUploads a new enterprise license. In order to apply it right away, use the apply query parameter.\nNote\n\nThe request body for this operation must be submitted as multipart/form-data data. You can can reference the license file by prefixing the filename with the @ symbol using curl. For more information, see the curl documentation.\n\n### Parameters\n\n#### Path and query parameters\n\n* **`apply`** (boolean)\n  Whether to instantly apply changes from the license. Otherwise the new license can be applied using the /manage/v1/config/apply endpoint.\n\n#### Body parameters\n\n* **`license`** (string) (required)\n  The content of your .ghl license file.\n\n### HTTP response status codes\n\n* **201** - Created\n\n* **202** - Accepted\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example 1: Status Code 201\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  http(s)://HOSTNAME/manage/v1/config/license \\\n  -d '{\n  \"license\": \"@enterprise.ghl\"\n}'\n```\n\n**Response schema (Status: 201):**\n\n#### Example 2: Status Code 202\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  http(s)://HOSTNAME/manage/v1/config/license \\\n  -d '{\n  \"license\": \"@enterprise.ghl\"\n}'\n```\n\n**Response schema (Status: 202):**\n\n## Check a license\n\n```\nGET /manage/v1/config/license/check\n```\n\nCheck the status of the license that is currently set for the enterprise.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/config/license/check\n```\n\n**Response schema (Status: 200):**\n\n* `status`: string, enum: `valid`, `invalid`, `expired`, `cluster mode not supported`\n\n## Get GHES node metadata for all nodes\n\n```\nGET /manage/v1/config/nodes\n```\n\nGet node metadata for all configured nodes in the current cluster. For more information, see \"About clustering.\"\n\n### Parameters\n\n#### Path and query parameters\n\n* **`uuid`** (string)\n  The UUID which identifies a node.\n\n* **`cluster_roles`** (string)\n  The cluster roles from the cluster configuration file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/config/nodes\n```\n\n**Response schema (Status: 200):**\n\n* `topology`: string, enum: `SingleNode`, `Ha`, `Cluster`\n* `nodes`: array of objects:\n  * `hostname`: string\n  * `uuid`: string\n  * `replica`: boolean\n  * `cluster_roles`: array of string, enum: `Blank`, `ActionsServer`, `ConsulServer`, `ElasticsearchServer`, `GitServer`, `JobServer`, `LaunchServer`, `MemcacheServer`, `MetricsServer`, `MssqlServer`, `MysqlServer`, `PagesServer`, `RedisServer`, `StorageServer`, `WebServer`\n\n## Get the GHES settings\n\n```\nGET /manage/v1/config/settings\n```\n\nGets a list of settings for a GitHub Enterprise Server instance.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/config/settings\n```\n\n**Response schema (Status: 200):**\n\n* `private_mode`: boolean\n* `public_pages`: boolean\n* `subdomain_isolation`: boolean\n* `signup_enabled`: boolean\n* `github_hostname`: string\n* `identicons_host`: string\n* `http_proxy`: string or null\n* `auth_mode`: string\n* `expire_sessions`: boolean\n* `admin_password`: string or null\n* `configuration_id`: integer\n* `configuration_run_count`: integer\n* `avatar`: object:\n  * `enabled`: boolean\n  * `uri`: string\n* `customer`: object:\n  * `name`: string\n  * `email`: string\n  * `uuid`: string\n  * `secret_key_data`: string\n  * `public_key_data`: string\n* `license`: object:\n  * `seats`: integer\n  * `evaluation`: boolean\n  * `perpetual`: boolean\n  * `unlimited_seating`: boolean\n  * `support_key`: string\n  * `ssh_allowed`: boolean\n  * `cluster_support`: boolean\n  * `expire_at`: string\n* `github_ssl`: object:\n  * `enabled`: boolean\n  * `cert`: string or null\n  * `key`: string or null\n* `ldap`: object:\n  * `host`: string or null\n  * `port`: integer\n  * `base`: array of string\n  * `uid`: string or null\n  * `bind_dn`: string or null\n  * `password`: string or null\n  * `method`: string\n  * `search_strategy`: string\n  * `user_groups`: array of string\n  * `admin_group`: string or null\n  * `virtual_attribute_enabled`: boolean\n  * `recursive_group_search`: boolean\n  * `posix_support`: boolean\n  * `user_sync_emails`: boolean\n  * `user_sync_keys`: boolean\n  * `user_sync_interval`: integer\n  * `team_sync_interval`: integer\n  * `sync_enabled`: boolean\n  * `reconciliation`: object:\n    * `user`: string or null\n    * `org`: string or null\n  * `profile`: object:\n    * `uid`: string\n    * `name`: string or null\n    * `mail`: string or null\n    * `key`: string or null\n* `cas`: object:\n  * `url`: string or null\n* `saml`: object:\n  * `sso_url`: string or null\n  * `certificate`: string or null\n  * `certificate_path`: string or null\n  * `issuer`: string or null\n  * `idp_initiated_sso`: boolean\n  * `disable_admin_demote`: boolean\n* `github_oauth`: object:\n  * `client_id`: string\n  * `client_secret`: string\n  * `organization_name`: string\n  * `organization_team`: string\n* `smtp`: object:\n  * `enabled`: boolean\n  * `address`: string\n  * `authentication`: string\n  * `port`: string\n  * `domain`: string\n  * `username`: string\n  * `user_name`: string\n  * `enable_starttls_auto`: boolean\n  * `password`: string\n  * `discard-to-noreply-address`: boolean\n  * `support_address`: string\n  * `support_address_type`: string\n  * `noreply_address`: string\n* `ntp`: object:\n  * `primary_server`: string\n  * `secondary_server`: string\n* `timezone`: string or null\n* `snmp`: object:\n  * `enabled`: boolean\n  * `community`: string\n* `syslog`: object:\n  * `enabled`: boolean\n  * `server`: string or null\n  * `protocol_name`: string\n* `assets`: string or null\n* `pages`: object:\n  * `enabled`: boolean\n* `collectd`: object:\n  * `enabled`: boolean\n  * `server`: string or null\n  * `port`: integer\n  * `encryption`: string or null\n  * `username`: string or null\n  * `password`: string or null\n* `mapping`: object:\n  * `enabled`: boolean\n  * `tileserver`: string or null\n  * `basemap`: string\n  * `token`: string or null\n* `load_balancer`: string or null\n* `prometheus`: object:\n  * `enabled`: boolean\n  * `trusted_ips`: string or null\n\n## Set settings\n\n```\nPUT /manage/v1/config/settings\n```\n\nUpdates the settings on your instance. For a list of the available settings, see the Get settings endpoint.\nNotes:\n\nThe request body only requires the settings parameters that should be updated to be specified, all other parameters will be unmodified or populated from the default values.\nYou cannot set the Management Console root site administrator password with this API endpoint. Use the ghe-set-password utility to change the management console password. For more information, see \"Command-line utilities.\"\n\n### HTTP response status codes\n\n* **204** - No Content\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X PUT \\\n  http(s)://HOSTNAME/manage/v1/config/settings \\\n  -d '{\n  \"public_pages\": true\n}'\n```\n\n**Response schema (Status: 204):**\n\n## Get the status of maintenance mode\n\n```\nGET /manage/v1/maintenance\n```\n\nGets the status and details of maintenance mode on all available nodes. For more information, see \"Enabling and scheduling maintenance mode.\"\n\n### Parameters\n\n#### Path and query parameters\n\n* **`uuid`** (string)\n  The UUID which identifies a node.\n\n* **`cluster_roles`** (string)\n  The cluster roles from the cluster configuration file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/maintenance\n```\n\n**Response schema (Status: 200):**\n\nArray of objects:\n\n* `hostname`: string, format: hostname\n* `uuid`: string, format: uuid\n* `status`: string, enum: `on`, `off`, `scheduled`\n* `scheduled_time`: string, format: date\n* `connection_services`: array of objects:\n  * `name`: string\n  * `number`: integer\n* `can_unset_maintenance`: boolean\n* `ip_exception_list`: array of string, format: ip/cidr\n* `maintenance_mode_message`: string\n\n## Set the status of maintenance mode\n\n```\nPOST /manage/v1/maintenance\n```\n\nSets or schedules the maintenance mode. For more information, see \"Enabling and scheduling maintenance mode.\"\n\n### Parameters\n\n#### Body parameters\n\n* **`enabled`** (boolean) (required)\n  Whether to enable maintenance mode.\n\n* **`uuid`** (string)\n  The UUID of the node to target. This parameter is incompatible with maintenance mode scheduling. Only use uuid if the value of when is empty or now.\n\n* **`when`** (string)\n  The time to enable maintenance mode. If this parameter is empty or set to now, maintenance mode is enabled immediately. Otherwise, maintenance mode is enabled at the specified time. The format is ISO 8601.\n\n* **`ip_exception_list`** (array of strings)\n  The list of IP addresses to exclude from maintenance mode. IPv4, IPv6, and CIDR addresses are supported.\n\n* **`maintenance_mode_message`** (string)\n  The message to display to users when maintenance mode is enabled.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **400** - Bad request\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X POST \\\n  http(s)://HOSTNAME/manage/v1/maintenance \\\n  -d '{\n  \"enabled\": true,\n  \"when\": \"2006-01-02T15:04:05+00:00\",\n  \"ip_exception_list\": [\n    \"192.168.1.0/24\",\n    \"1.1.1.1\"\n  ]\n}'\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Delete a SSH key](#delete-a-ssh-key).\n\n## Get the status of services running on all replica nodes\n\n```\nGET /manage/v1/replication/status\n```\n\nGets the status of all services running on each replica node.\nThis endpoint may take several seconds to reply.\n\n### Parameters\n\n#### Path and query parameters\n\n* **`uuid`** (string)\n  The UUID which identifies a node.\n\n* **`cluster_roles`** (string)\n  The cluster roles from the cluster configuration file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/replication/status\n```\n\n**Response schema (Status: 200):**\n\nSame response schema as [Get the status of services running on all cluster nodes](#get-the-status-of-services-running-on-all-cluster-nodes).\n\n## Get all GHES release versions for all nodes\n\n```\nGET /manage/v1/version\n```\n\nGets the GitHub Enterprise Server release versions that are currently installed on all available nodes. For more information, see \"GitHub Enterprise Server releases.\"\n\n### Parameters\n\n#### Path and query parameters\n\n* **`uuid`** (string)\n  The UUID which identifies a node.\n\n* **`cluster_roles`** (string)\n  The cluster roles from the cluster configuration file.\n\n### HTTP response status codes\n\n* **200** - OK\n\n* **401** - Unauthorized\n\n* **500** - Internal error\n\n### Code examples\n\n#### Example\n\n**Request:**\n\n```curl\ncurl -L \\\n  -X GET \\\n  http(s)://HOSTNAME/manage/v1/version\n```\n\n**Response schema (Status: 200):**\n\nArray of objects:\n\n* `hostname`: string, format: hostname\n* `version`: object:\n  * `version`: string, pattern: `[0-9]\\.[0-9]{2}\\.[0-9]`\n  * `platform`: string, enum: `ami`, `azure`, `esx`, `gce`, `hyperv`, `kvm`\n  * `build_id`: string, pattern: `[0-9a-f]{8}`\n  * `build_date`: string, format: date"}