惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

L
LangChain Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
雷峰网
雷峰网
量子位
V
V2EX
S
SegmentFault 最新的问题
月光博客
月光博客
博客园 - 【当耐特】
Hugging Face - Blog
Hugging Face - Blog
V
Visual Studio Blog
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
博客园_首页
博客园 - Franky
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
美团技术团队
Y
Y Combinator Blog
The Cloudflare Blog
C
Check Point Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
腾讯CDC
B
Blog
Stack Overflow Blog
Stack Overflow Blog
P
Proofpoint News Feed

夜行人

回家路上 第一期的直播演示项目 震动检测器 正能量 在线参观CodeLab Neverland 发布 CodeLab Adapter 3.3.1 DynamicTable 之 纸糊方向盘 CodeLab DynamicTable: 一个可实施的技术方案 CodeLab Insight 发布 Alpha 版 情人节 Home Assistant 周报 && IoT 周报 (02) Joplin: 关注隐私的 Evernote 开源替代软件 浏览器的未来与 Web 传感器 Home Assistant 周报 && IoT 周报 (01) 百宝箱(01) 论自由 介绍 WebThings Home Assistant 周报 && iot 周报 (00) 百宝箱(00) 毛姆读书心得 传世之作 周末徒步 CodeLab Adapter ❤️ Jupyter/Python 航班 躲雨 夏令营途中 [译]思想--作为一种技术 The future of coding 美国之行 三门问题的程序模拟
使用命令行操作青云
2016-03-04 · via 夜行人

#目的 学会在命令行下,对云主机进行日常的操控

#安装 pip install qingcloud-cli

#新手指南 将你的access key填入~/.qingcloud/config.yaml

  • 列出所有命令 : qingcloud
  • help : qingcloud iaas run-instances -h

#命令列表 只列出我日常常用的


###主机相关 #####describe-instances describe-instances(实例描述):qingcloud iaas describe-instances,返回一串json,可以使用 | jq "."来美化输出,关于jq可以参考命令行神器之jq

使用示例

  • qingcloud iaas describe-instances|ack 209 -C 17
  • qingcloud iaas describe-instances|jq '.instance_set[].instance_name'
  • qingcloud iaas describe-instances|jq '.instance_set[]|.memory_current,.vcpus_current,.instance_name'

重要字段

  • instance_id : 主机id
  • status : 主机状态,可通过获得 jq “.instance_set[].status"获得
  • instance_name : 主机名
  • vcpus_current : 核数
  • memory_current : 内存

###start-instances qingcloud iaas start-instances <instance_id>

###stop-instances qingcloud iaas stop-instances <instance_id>


其他的命令使用时再记录

#附 附上我的这个项目:qingcloud_cron:使用定时任务控制青云服务器

参考: 命令列表

#参考

#延伸

文章作者 种瓜

上次更新 2016-03-04