LoginSignup
1
0

More than 5 years have passed since last update.

aliyuncli で ECS インスタンス情報取得

Last updated at Posted at 2017-12-04

aliyuncliを使ってECSインスタンスの情報を取得してみる。

aliyuncli ecs DescribeInstances | jq ".Instances.Instance[] | \
 {name: .InstanceName, region: .RegionId, family: .InstanceTypeFamily, \
  cpu: .Cpu, memory: .Memory, public_ip: .PublicIpAddress.IpAddress[0], \
  private_ip: .VpcAttributes.PrivateIpAddress.IpAddress[0] }"

実行結果

{
  "name": "ubuntu16.04",
  "region": "ap-northeast-1",
  "family": "ecs.n4",
  "cpu": 2,
  "memory": 4096,
  "public_ip": "47.74.4.203",
  "private_ip": "172.24.119.233"
}
{
  "name": "centos7",
  "region": "ap-northeast-1",
  "family": "ecs.n4",
  "cpu": 2,
  "memory": 4096,
  "public_ip": "47.74.36.146",
  "private_ip": "172.24.119.232"
}
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0