{"id":15938002,"url":"https://github.com/pluveto/cloudctl","last_synced_at":"2025-02-22T22:14:33.833Z","repository":{"id":109018668,"uuid":"471662730","full_name":"pluveto/cloudctl","owner":"pluveto","description":"云服务器控制工具，帮你省钱。","archived":false,"fork":false,"pushed_at":"2022-03-24T02:25:03.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-03T20:24:33.452Z","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pluveto.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,"publiccode":null,"codemeta":null}},"created_at":"2022-03-19T10:32:11.000Z","updated_at":"2022-03-19T10:39:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"c6b92855-524b-4fe0-abeb-714d342bcd35","html_url":"https://github.com/pluveto/cloudctl","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/pluveto%2Fcloudctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fcloudctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fcloudctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pluveto%2Fcloudctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pluveto","download_url":"https://codeload.github.com/pluveto/cloudctl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240241820,"owners_count":19770466,"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":[],"created_at":"2024-10-07T05:20:35.416Z","updated_at":"2025-02-22T22:14:33.813Z","avatar_url":"https://github.com/pluveto.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"cloudctl 致力于设计一套通用的云服务器管理接口，并提供通用的云服务器管理功能，如：开机、查看状态、重启。\n\n## 支持的云服务商\n\n+ 华为云 `huawei`\n\n## 使用方法\n\n### 配置运行环境\n\n```shell\n# 克隆仓库\ngit clone https://github.com/pluveto/cloudctl\ncd cloudctl\n# 创建虚拟环境\npython -m venv ./venv\n./venv/Scripts/activate\n# 安装依赖\npython -m pip install -r requirement.txt\n```\n\n### 配置\n\n创建 `.env` 文件，填写认证信息。示例：\n\n```shell\nLOG_LEVEL=info\nHUAWEICLOUD_SDK_AK=KAAABBCCDABABABABABAB\nHUAWEICLOUD_SDK_SK=111111111111QQQQQQQQQQQQQqqqqqqqqfffffff\nHUAWEICLOUD_SDK_PROJECT_ID=0df51c3c6400f4c52fbe8888888888888\nHUAWEICLOUD_SDK_IAM_ENDPOINT=ecs.cn-north-4.myhuaweicloud.com\n```\n\n创建 `config.yaml` 文件，填写服务器信息。示例：\n\n```yaml\nservers:\n  - id: 38210be0-80ee-46f5-81ad-4ed2839309c6\n    provider: huawei\n  - id: 1dd9d8d5-bf9d-4810-a303-3a7244ea5ede\n    provider: huawei\n  - id: 6de462db-bb8c-44ee-b120-03c5268cce44\n    provider: huawei\n  - id: b46113d6-d570-4691-a1ed-7a6b8d4e57a7\n    provider: huawei\n```\n\n### 使用\n\n```shell\n# 列出所有服务器\npy cloudctl.py server --action list\n# 批量开机\npy cloudctl.py server --action start --server-ids 38210be0-80ee-46f5-81ad-4ed2839309c6 1dd9d8d5-bf9d-4810-a303-3a7244ea5ede 6de462db-bb8c-44ee-b120-03c5268cce44 b46113d6-d570-4691-a1ed-7a6b8d4e57a7\n# 批量关机\npy cloudctl.py server --action stop --server-ids 38210be0-80ee-46f5-81ad-4ed2839309c6 1dd9d8d5-bf9d-4810-a303-3a7244ea5ede 6de462db-bb8c-44ee-b120-03c5268cce44 b46113d6-d570-4691-a1ed-7a6b8d4e57a7\n```\n\n### 华为云相关凭证的获取\n\n访问 https://support.huaweicloud.com/devg-apisign/api-sign-provide.html\n\n## 扩展\n\n本项目可以自行扩展支持其它服务商。只需要在 `extensions` 目录下建立文件 `PROVIDER_NAME.py`\n\n### 调用约定\n\n你的扩展需要实现以下方法。返回值均为 dict 类型。\n\u003c!-- \n#### get_server_status\n参数：\n + 无\n返回： --\u003e\n#### list_servers\n\n参数：\n + 无\n\n返回：\n + Array of: \n   + `id: string`\n   + `status: string`\n   + `name: string`\n   + `private_ip: string`\n   + `public_ip: string`\n\n#### start_servers\n\n参数：\n + `server_ids: Array\u003cstring\u003e` \n\n返回：\n + 无\n\n#### stop_servers\n\n参数：\n + `server_ids: Array\u003cstring\u003e` \n\n返回：\n + 无","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluveto%2Fcloudctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpluveto%2Fcloudctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpluveto%2Fcloudctl/lists"}