|
| 1 | +Script started on 2020-01-17 13:06:15+10:00 [TERM="xterm-256color" TTY="/dev/pts/8" COLUMNS="90" LINES="22"] |
| 2 | +]777;notify;Command completed;bma type skim-stdin \]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 3 | +$ [H[2J |
| 4 | +$ instances |
| 5 | +777;preexeci-0588726918d6ee19b t3.small running huginn-bma 2020-01-17T01:57:33.000Z |
| 6 | +i-08ec93cf02239df3d t3.nano running nginx-bma 2020-01-17T01:57:40.000Z |
| 7 | +i-09b1a3bc8917b9ca0 t3.nano running grafana-bma 2020-01-17T01:57:42.000Z |
| 8 | +i-0120b019f373f8860 t3.small running huginn-bma 2020-01-17T02:40:14.000Z |
| 9 | +i-065bf156cdd2d6dc3 t3.nano running grafana-bma 2020-01-17T02:40:20.000Z |
| 10 | +i-078337da5262a5d5a t3.nano running nginx-bma 2020-01-17T02:40:28.000Z |
| 11 | +]777;notify;Command completed;instances\]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 12 | +$ instance-asg |
| 13 | +777;preexecUSAGE: instance-asg instance-id [instance-id] |
| 14 | +]777;notify;Command completed;instance-asg\]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 15 | +$ instance-asgs[K | instance-asg |
| 16 | +777;preexecgrafana-bma-AutoScalingGroup-1NXJHMJVZQVMB i-09b1a3bc8917b9ca0 |
| 17 | +nginx-bma-AutoScalingGroup-106KHAYHUSRHU i-08ec93cf02239df3d |
| 18 | +nginx-bma-AutoScalingGroup-106KHAYHUSRHU i-078337da5262a5d5a |
| 19 | +grafana-bma-AutoScalingGroup-1NXJHMJVZQVMB i-065bf156cdd2d6dc3 |
| 20 | +huginn-bma-AutoScalingGroup-QS7EQOT1G7OX i-0120b019f373f8860 |
| 21 | +huginn-bma-AutoScalingGroup-QS7EQOT1G7OX i-0588726918d6ee19b |
| 22 | +]777;notify;Command completed;instances | instance-asg\]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 23 | +$ instances | instance-asg | asg- |
| 24 | +asg-capacity asg-max-size-set asg-scaling-activities |
| 25 | +asg-desired-size-set asg-min-size-set asg-stack |
| 26 | +asg-instances asg-processes_suspended asg-suspend |
| 27 | +asg-launch-configuration asg-resume |
| 28 | + |
| 29 | +$ instances | instance-asg | asg-capacity |
| 30 | +777;preexecgrafana-bma-AutoScalingGroup-1NXJHMJVZQVMB 1 2 2 |
| 31 | +huginn-bma-AutoScalingGroup-QS7EQOT1G7OX 1 2 2 |
| 32 | +nginx-bma-AutoScalingGroup-106KHAYHUSRHU 1 2 2 |
| 33 | +]777;notify;Command completed;instances | instance-asg | asg-capacity \]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 34 | +$ [H[2J |
| 35 | +$ bma type instance-asg |
| 36 | +777;preexecinstance-asg is a function |
| 37 | +instance-asg () |
| 38 | +{ |
| 39 | + local instance_ids=$(skim-stdin "$@"); |
| 40 | + [[ -z $instance_ids ]] && __bma_usage "instance-id [instance-id]" && return 1; |
| 41 | + aws ec2 describe-instances --instance-ids $instance_ids --output text --query " |
| 42 | + Reservations[].Instances[][ |
| 43 | + { |
| 44 | + "AutoscalingGroupName": |
| 45 | + [Tags[?Key=='aws:autoscaling:groupName'].Value][0][0], |
| 46 | + "InstanceId": InstanceId |
| 47 | + } |
| 48 | + ][]" | column -s' ' -t |
| 49 | +} |
| 50 | +]777;notify;Command completed;bma type instance-asg\]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 51 | +$ bma type skim-stdin |
| 52 | +777;preexecskim-stdin is a function |
| 53 | +skim-stdin () |
| 54 | +{ |
| 55 | + echo $@ $([[ -t 0 ]] || awk 'ORS=" " { print $1 }') |
| 56 | +} |
| 57 | +]777;notify;Command completed;bma type skim-stdin \]777;precmd\]0;m@localhost:~/.bash-my-aws\]7;file://localhost.localdomain/home/m/.bash-my-aws\ |
| 58 | +$ exit |
| 59 | + |
| 60 | +Script done on 2020-01-17 13:07:32+10:00 [COMMAND_EXIT_CODE="0"] |
|
0 commit comments