Class: ZAWS::Command::Compute
- Inherits:
-
Thor
- Object
- Thor
- ZAWS::Command::Compute
- Defined in:
- lib/zaws/command/compute.rb
Instance Attribute Summary collapse
-
#aws ⇒ Object
Returns the value of attribute aws.
-
#out ⇒ Object
Returns the value of attribute out.
-
#print_exit_code ⇒ Object
Returns the value of attribute print_exit_code.
Instance Method Summary collapse
- #assoc_security_group(externalid, security_group) ⇒ Object
- #declare(externalid, image, owner, type, root, zone, key, sgroup) ⇒ Object
- #declare_secondary_ip(externalid, ip) ⇒ Object
- #delete(externalid) ⇒ Object
- #delete_secondary_ip(externalid, ip) ⇒ Object
- #exists_by_external_id(externalid) ⇒ Object
- #exists_secondary_ip(externalid, ip) ⇒ Object
- #exists_security_group_assoc(externalid, security_group) ⇒ Object
-
#initialize(*args) ⇒ Compute
constructor
A new instance of Compute.
- #interval_cron ⇒ Object
- #interval_eligible ⇒ Object
- #set_interval(hours, email) ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #view ⇒ Object
- #view_images ⇒ Object
Constructor Details
#initialize(*args) ⇒ Compute
Returns a new instance of Compute.
13 14 15 16 17 18 19 20 |
# File 'lib/zaws/command/compute.rb', line 13 def initialize(*args) super shellout=ZAWS::Helper::Shell.new awscli = ZAWS::AWSCLI.new(shellout,false) @aws = ZAWS::AWS.new(shellout, awscli) @out = $stdout @print_exit_code = false end |
Instance Attribute Details
#aws ⇒ Object
Returns the value of attribute aws.
9 10 11 |
# File 'lib/zaws/command/compute.rb', line 9 def aws @aws end |
#out ⇒ Object
Returns the value of attribute out.
10 11 12 |
# File 'lib/zaws/command/compute.rb', line 10 def out @out end |
#print_exit_code ⇒ Object
Returns the value of attribute print_exit_code.
11 12 13 |
# File 'lib/zaws/command/compute.rb', line 11 def print_exit_code @print_exit_code end |
Instance Method Details
#assoc_security_group(externalid, security_group) ⇒ Object
91 92 93 |
# File 'lib/zaws/command/compute.rb', line 91 def assoc_security_group(externalid, security_group) @aws.ec2.compute.assoc_security_group([:region], @out, ([:verbose] ? @out : nil), [:vpcid], externalid, security_group) end |
#declare(externalid, image, owner, type, root, zone, key, sgroup) ⇒ Object
69 70 71 72 |
# File 'lib/zaws/command/compute.rb', line 69 def declare(externalid, image, owner, type, root, zone, key, sgroup) val=@aws.ec2.compute.declare(externalid, image, owner, type, root, zone, key, sgroup, [:privateip], [:optimized], [:apiterminate], [:clienttoken], [:region], @out, ([:verbose] ? @out : nil), [:vpcid], [:check], [:undofile], [:nosdcheck], [:skipruncheck], [:volsize], [:volume], [:tenancy], [:profilename], [:userdata]) return val end |
#declare_secondary_ip(externalid, ip) ⇒ Object
107 108 109 |
# File 'lib/zaws/command/compute.rb', line 107 def declare_secondary_ip(externalid, ip) @aws.ec2.compute.declare_secondary_ip([:region], ip, @out, ([:verbose] ? @out : nil), [:vpcid], externalid, [:check], [:undofile]) end |
#delete(externalid) ⇒ Object
77 78 79 |
# File 'lib/zaws/command/compute.rb', line 77 def delete(externalid) @aws.ec2.compute.delete([:region], @out, ([:verbose] ? @out : nil), [:vpcid], externalid) end |
#delete_secondary_ip(externalid, ip) ⇒ Object
114 115 116 |
# File 'lib/zaws/command/compute.rb', line 114 def delete_secondary_ip(externalid, ip) @aws.ec2.compute.delete_secondary_ip([:region], ip, @out, ([:verbose] ? @out : nil), [:vpcid], externalid) end |
#exists_by_external_id(externalid) ⇒ Object
49 50 51 52 |
# File 'lib/zaws/command/compute.rb', line 49 def exists_by_external_id(externalid) val, instance_id, sgroups=@aws.ec2.compute.exists([:region], @out, ([:verbose] ? @out : nil), [:vpcid], externalid) return val end |
#exists_secondary_ip(externalid, ip) ⇒ Object
98 99 100 |
# File 'lib/zaws/command/compute.rb', line 98 def exists_secondary_ip(externalid, ip) val, compute_exists, netid=@aws.ec2.compute.exists_secondary_ip([:region], ip, @out, ([:verbose] ? @out : nil), [:vpcid], externalid) end |
#exists_security_group_assoc(externalid, security_group) ⇒ Object
84 85 86 |
# File 'lib/zaws/command/compute.rb', line 84 def exists_security_group_assoc(externalid, security_group) val, instancid, sgroupid=@aws.ec2.compute.exists_security_group_assoc([:region], @out, ([:verbose] ? @out : nil), [:vpcid], externalid, security_group) end |
#interval_cron ⇒ Object
139 140 141 |
# File 'lib/zaws/command/compute.rb', line 139 def interval_cron() @aws.ec2.compute.interval_cron([:policy_arn], [:region], @out, ([:verbose] ? @out : nil), [:overridebasetime]) end |
#interval_eligible ⇒ Object
121 122 123 |
# File 'lib/zaws/command/compute.rb', line 121 def interval_eligible @aws.ec2.compute.interval_eligible([:policy_arn], [:region], @out, ([:verbose] ? @out : nil)) end |
#set_interval(hours, email) ⇒ Object
131 132 133 |
# File 'lib/zaws/command/compute.rb', line 131 def set_interval(hours, email) @aws.ec2.compute.set_interval([:policy_arn], [:name], [:externalid], hours, email, [:region], @out, ([:verbose] ? @out : nil), [:overridebasetime]) end |
#start ⇒ Object
148 149 150 |
# File 'lib/zaws/command/compute.rb', line 148 def start() @aws.ec2.compute.start([:name], [:externalid], [:region], @out, ([:verbose] ? @out : nil), [:skipruncheck]) end |
#stop ⇒ Object
157 158 159 |
# File 'lib/zaws/command/compute.rb', line 157 def stop() @aws.ec2.compute.stop([:name], [:externalid], [:region], @out, ([:verbose] ? @out : nil), [:skipruncheck]) end |
#view ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/zaws/command/compute.rb', line 27 def view region =[:region] viewtype=[:viewtype] verbose=([:verbose] ? @out : nil) vpcid=[:vpcid] profile=[:profile] home=[:home] @aws.ec2.compute.view(region, viewtype, @out, verbose, vpcid,nil, profile,home) end |
#view_images ⇒ Object
42 43 44 |
# File 'lib/zaws/command/compute.rb', line 42 def view_images @aws.ec2.compute.view_images([:region], [:viewtype], [:owner], [:imageid], @out, ([:verbose] ? @out : nil)) end |