{"id":19900102,"url":"https://github.com/m-lab/reboot-service","last_synced_at":"2026-06-06T13:31:23.339Z","repository":{"id":54442061,"uuid":"169402105","full_name":"m-lab/reboot-service","owner":"m-lab","description":null,"archived":false,"fork":false,"pushed_at":"2023-08-22T23:10:16.000Z","size":129,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":9,"default_branch":"master","last_synced_at":"2026-05-27T21:34:10.469Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/m-lab.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2019-02-06T12:24:19.000Z","updated_at":"2021-02-17T17:03:01.000Z","dependencies_parsed_at":"2024-02-23T05:44:01.188Z","dependency_job_id":null,"html_url":"https://github.com/m-lab/reboot-service","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/m-lab/reboot-service","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Freboot-service","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Freboot-service/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Freboot-service/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Freboot-service/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/m-lab","download_url":"https://codeload.github.com/m-lab/reboot-service/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/m-lab%2Freboot-service/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33984824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-06T02:00:07.033Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T20:11:10.885Z","updated_at":"2026-06-06T13:31:23.313Z","avatar_url":"https://github.com/m-lab.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Reboot API\n\n[![GoDoc](https://godoc.org/github.com/m-lab/reboot-service?status.svg)](https://godoc.org/github.com/m-lab/reboot-service) [![Build Status](https://travis-ci.org/m-lab/reboot-service.svg?branch=master)](https://travis-ci.org/m-lab/reboot-service) [![Coverage Status](https://coveralls.io/repos/github/m-lab/reboot-service/badge.svg?branch=master)](https://coveralls.io/github/m-lab/reboot-service?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/m-lab/reboot-service)](https://goreportcard.com/report/github.com/m-lab/reboot-service)\n\nThis API allows to execute common operations on M-Lab platform's BMC\nmodules and CoreOS hosts.\n\nIt retrieves credentials for BMCs from Google Cloud Datastore, while access to\nCoreOS hosts is granted through a private SSH key.\n\n## Rebooting nodes with the Reboot API\n\nThe API provides a reboot endpoint, `/v1/reboot`, which allows to reboot a node with two different methods.\n\n### POST /v1/reboot\n\nParameter         | Description\n------------------| ----------------\n`host`            | hostname to reboot\n`method`          | `host` or `bmc`. Defaults to `bmc`.\n\n#### Examples\n\n*Reboot mlab1.lga0t via the BMC:*\n\n```bash\ncurl -X POST https://\u003creboot-api-url\u003e/v1/reboot?host=mlab1.lga0t\n```\n\n*Reboot mlab1.lga0t by running `systemctl reboot` on CoreOS:*\n\n```bash\ncurl -X POST https://\u003creboot-api-url\u003e/v1/reboot?host=mlab1.lga0t\u0026method=host\n```\n\n## End-to-end testing \n\nThe `/v1/e2e` endpoint allows to run an e2e test on a specific BMC.\n\nResults are cached by default. You can configure the cache capacity and TTL with `-e2e.cache-capacity` and `-e2e.cache-ttl`.\n\n### GET /v1/e2e\n\nParameter         | Description\n------------------| ----------------\n`target`          | hostname of the BMC to check\n\nThis endpoint returns a valid Prometheus metric representing the status of the BMC:\n\n```reboot_e2e_result{status=\"\u003cstatus\u003e\",target=\"\u003chostname\u003e\"} 1```\n\nPossible statuses are:\n\nStatus            | Description\n------------------| ----------------\nok | Connection to this BMC was successful\ncredentials_not_found | Credentials to access this BMC are not available in the Credentials store\nconnection_failed | Connection to this BMC failed\n\n\n#### Examples\n\n```bash\ncurl https://\u003creboot-api-url\u003e/v1/e2e?target=mlab1d.lga0t.measurement-lab.org\n```\n\n*Output*:\n```\n# HELP reboot_e2e_result E2E test result for this target\n# TYPE reboot_e2e_result gauge\nreboot_e2e_result{status=\"ok\",target=\"mlab1d.lga0t.measurement-lab.org\"} 1\n```\n\n## Running the Reboot API\n\n### Authenticating to Google Cloud Datastore\n\nTo fetch credentials to authenticate to the BMCs, the Reboot API needs to have\naccess to Google Cloud Datastore.\n\nTo do so, the Reboot API will use the credentials configured in\n[gcloud](https://cloud.google.com/sdk/gcloud/reference/auth/login)\n(if available) or the [GOOGLE_APPLICATION_CREDENTIALS](https://cloud.google.com/docs/authentication/production) mechanism,\nalso known as *Application Default Credentials*.\n\n### Command line flags\n\nAll the command line flags can also be provided via a corresponding environment variable.\n\nFor a list of the available flags, run\n\n```bash\n./reboot-service -h\n```\n\n### Development\n\nTo run the Reboot API locally, for development/testing:\n\n- Build the Reboot API with  `go test ./... \u0026\u0026 go build`\n- Run it with `./reboot-service`\n\nPlease note that by default the Reboot API will not require any authentication,\nthus this method is **not suitable for production use**.\n\nTo configure HTTP Basic Authentication, you need to specify `-auth.username` and\n`-auth.password`.\n\nTo reboot nodes via CoreOS, a valid SSH private key must be provided,\nfor example: `./reboot-service --reboot.key=/path/to/private.key` .\n\n### Running with Docker\n\n- Build the docker image\n  - `docker -t reboot-api .`\n\n- Run it\n  - `docker run reboot-api`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-lab%2Freboot-service","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fm-lab%2Freboot-service","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fm-lab%2Freboot-service/lists"}