{"id":15968622,"url":"https://github.com/erichs/cloudsysfs","last_synced_at":"2025-04-04T14:25:40.429Z","repository":{"id":144208919,"uuid":"87138974","full_name":"erichs/cloudsysfs","owner":"erichs","description":"A go library to detect cloud service providers using the local Linux sysfs filesystem","archived":false,"fork":false,"pushed_at":"2017-04-13T02:24:42.000Z","size":3,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-29T09:47:19.512Z","etag":null,"topics":["cloud","discovery","golang","sysfs"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/erichs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2017-04-04T02:01:42.000Z","updated_at":"2018-02-01T04:10:20.000Z","dependencies_parsed_at":null,"dependency_job_id":"147f86b7-1e4e-4130-aa41-71b15bfe6cf8","html_url":"https://github.com/erichs/cloudsysfs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichs%2Fcloudsysfs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichs%2Fcloudsysfs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichs%2Fcloudsysfs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erichs%2Fcloudsysfs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erichs","download_url":"https://codeload.github.com/erichs/cloudsysfs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247192301,"owners_count":20899066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["cloud","discovery","golang","sysfs"],"created_at":"2024-10-07T19:02:52.436Z","updated_at":"2025-04-04T14:25:40.397Z","avatar_url":"https://github.com/erichs.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cloudsysfs\nDetect Cloud Provider from DMI data on the local sysfs (/sys) filesystem\n\n## Usage\n\n```go\npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/erichs/cloudsysfs\"\n)\n\nfunc main() {\n  switch cloudsysfs.Detect() {\n  case \"aws\":\n    fmt.Println(\"Amazon Web Services\")\n  case \"azure\":\n    fmt.Println(\"Microsofte Azure\")\n  case \"digitalocean\":\n    fmt.Println(\"Digital Ocean\")\n  case \"gce\":\n    fmt.Println(\"Google Compute Engine\")\n  case \"openstack\":\n    fmt.Println(\"OpenStack\")\n  default:\n    fmt.Println(\"No cloud detected\")\n  }\n}\n\n``` \n\n## Motivation\n\nInspired by [cloudid](https://github.com/appscode/cloudid), I wanted a simple and fast mechanism for determining if the local environment is a cloud I want to support. [cloudid](https://github.com/appscode/cloudid) is great, but takes the (admittedly more robust) approach of fingerprinting metadata signatures from APIPA HTTP API endpoints (`http://169.254.x.x/latest/metadata` and friends). \n\nThis library takes the approach of attempting to read from the local [sysfs filesystem](https://en.wikipedia.org/wiki/Sysfs), looking for unambiguous vendor or product files that identify the cloud provider. The /sys filesystem is provided by the Linux kernel, so only Linux is currently supported.\n\n## Supported Operating Systems\n\nLinux\n\n## Supported Cloud Providers\n| provider_id | Name                  \n|-------------|-----------\n|aws          | Amazon Web Services  \n|azure        | Microsoft Azure      \n|digitalocean | DigitalOcean          \n|gce          | Google Compute Engine\n|openstack    | OpenStack\n\n## Example\n\n```      \npackage main\n\nimport (\n  \"fmt\"\n\n  \"github.com/erichs/cloudsysfs\"\n)\n\nfunc main() {\n  switch cloudsysfs.Detect() {\n  case \"aws\":\n    fmt.Println(\"Amazon Web Services\")\n  case \"azure\":\n    fmt.Println(\"Microsofte Azure\")\n  case \"digitalocean\":\n    fmt.Println(\"Digital Ocean\")\n  case \"gce\":\n    fmt.Println(\"Google Compute Engine\")\n  case \"openstack\":\n    fmt.Println(\"OpenStack\")\n  default:\n    fmt.Println(\"No cloud detected\")\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferichs%2Fcloudsysfs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferichs%2Fcloudsysfs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferichs%2Fcloudsysfs/lists"}