{"id":37668138,"url":"https://github.com/flytrap/bwg-api","last_synced_at":"2026-01-16T12:00:51.624Z","repository":{"id":62560563,"uuid":"137695732","full_name":"flytrap/bwg-api","owner":"flytrap","description":"搬瓦工Api","archived":false,"fork":false,"pushed_at":"2019-06-23T01:22:10.000Z","size":15,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-27T09:44:06.369Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/flytrap.png","metadata":{"files":{"readme":"README-CN.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}},"created_at":"2018-06-18T00:07:49.000Z","updated_at":"2025-06-22T05:58:21.000Z","dependencies_parsed_at":"2022-11-03T14:45:18.264Z","dependency_job_id":null,"html_url":"https://github.com/flytrap/bwg-api","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/flytrap/bwg-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flytrap%2Fbwg-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flytrap%2Fbwg-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flytrap%2Fbwg-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flytrap%2Fbwg-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flytrap","download_url":"https://codeload.github.com/flytrap/bwg-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flytrap%2Fbwg-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28478397,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T11:59:17.896Z","status":"ssl_error","status_checked_at":"2026-01-16T11:55:55.838Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":"2026-01-16T12:00:36.431Z","updated_at":"2026-01-16T12:00:51.576Z","avatar_url":"https://github.com/flytrap.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bwg-api\n搬瓦工 Api\n\n## 帮助\n\n```\n-\u003e python -m bwg.bwg_api -h\n-\u003e python bwg_api.py -h\nOptions:\n  -h, --help            show this help message and exit\n  -c FUNC, --call=FUNC  [start, stop, restart, kill, getServiceInfo,\n                        getLiveServiceInfo, getAvailableOS, reinstallOS,\n                        resetRootPassword, getUsageGraphs, getRawUsageStats,\n                        setHostname, setPTR, basicShell_cd, basicShell_exec,\n                        shellScript_exec, snapshot_create, snapshot_list,\n                        snapshot_delete, snapshot_restore,\n                        snapshot_toggleSticky, snapshot_export,\n                        snapshot_import, ipv6_add, ipv6_delete,\n                        migrate_getLocations, migrate_start,\n                        cloneFromExternalServer, getSuspensionDetail,\n                        unsuspend, getRateLimitStatus, help]\n  -f FILENAME, --file=FILENAME\n                        Assign config file\n  --init-config=INIT_CONFIG\n                        Init config file\n  -e EMAIL, --email=EMAIL\n                        email adders,e.g: a@mail.com,b.mail.com\n  -m MONITOR, --monitor=MONITOR\n                        start monitor\n  -r RATE, --rate=RATE  Usage monitoring, email send threshold, e.g: 50%\n  \n  -\u003e python bwg_api.py -c help\nstart                    : \t启动\nstop                     : \t停止\nrestart                  : \t重启\nkill                     : \t强制关闭\ngetServiceInfo           : \t获取服务器信息\ngetLiveServiceInfo       : \t获取活动的服务器信息\ngetAvailableOS           : \t获取有效的系统\nreinstallOS              : \t重装系统\nresetRootPassword        : \t重置root密码\ngetUsageGraphs           : \t获取使用统计信息\ngetRawUsageStats         : \t获取原始状态\nsetHostname              : \t设置hostname\nsetPTR                   : \t设置PTR\nbasicShell_cd            : \t模拟修改路径\nbasicShell_exec          : \t命令\nshellScript_exec         : \t执行脚本\nsnapshot_create          : \t创建快照\nsnapshot_list            : \t获取快照列表\nsnapshot_delete          : \t删除快照\nsnapshot_restore         : \t恢复快照\nsnapshot_toggleSticky    : \t快照开关\nsnapshot_export          : \t快照导出\nsnapshot_import          : \t快照导入\nipv6_add                 : \t添加ipv6\nipv6_delete              : \t删除ipv6\nmigrate_getLocations     : \t获取迁移地址\nmigrate_start            : \t迁移开始\ncloneFromExternalServer  : \t克隆外部服务器\ngetSuspensionDetail      : \t获取被暂停详情\nunsuspend                : \t取消暂停\ngetRateLimitStatus       : \t获取使用率状态\n```\n\n## 配置文件\n\n默认路径: ~/.config/bwg/bwgrc(~/.bwgrc)\n\n``` json\n{\n        \"VEID\": \"\",\n        \"API_KEY_BWH\": \"\",\n        \"MAIL_HOST\": \"邮箱host\",\n        \"MAIL_USER\": \"发信邮箱\",\n        \"MAIL_PASS\": \"密码\"\n}\n```\n\n## 使用\n``` bash\npython -m bwg.bwg_api -h\npython bwg_api.py -h \npython bwg_api.py -c  方法名\npython bwg_api.py -m network -e flytrap@mail.com -r 50%  # 检查流量使用情况，超过50则发邮件 \n```\npython call\n\n``` bash\npip install bwg-api\n```\n\n``` python\nfrom bwg.bwg_api import BWG\nbwg = BWG(VEID, API_KEY_BWH)\nbwg.__doc__  # 类文档\nfunc = getattr(bwg, func_name)\nfunc()\n```\n\n欢迎您提出改进建议\n\n[英文文档](./README.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflytrap%2Fbwg-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflytrap%2Fbwg-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflytrap%2Fbwg-api/lists"}