awscli 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- metadata +5 -53
- data/README.rdoc +0 -5
- data/Rakefile +0 -44
- data/bin/awscli +0 -32
- data/features/awscli.feature +0 -8
- data/features/step_definitions/awscli_steps.rb +0 -6
- data/features/support/env.rb +0 -15
- data/lib/awscli.rb +0 -44
- data/lib/awscli/cli.rb +0 -21
- data/lib/awscli/cli/ec2.rb +0 -23
- data/lib/awscli/cli/ec2/ami.rb +0 -46
- data/lib/awscli/cli/ec2/ebs.rb +0 -85
- data/lib/awscli/cli/ec2/eip.rb +0 -56
- data/lib/awscli/cli/ec2/instances.rb +0 -195
- data/lib/awscli/cli/ec2/keypairs.rb +0 -60
- data/lib/awscli/cli/ec2/monitoring.rb +0 -35
- data/lib/awscli/cli/ec2/placement.rb +0 -42
- data/lib/awscli/cli/ec2/reservedinstmng.rb +0 -45
- data/lib/awscli/cli/ec2/secgroups.rb +0 -66
- data/lib/awscli/cli/ec2/spot.rb +0 -81
- data/lib/awscli/cli/ec2/subnet.rb +0 -43
- data/lib/awscli/cli/ec2/tags.rb +0 -45
- data/lib/awscli/cli/ec2/vmmng.rb +0 -17
- data/lib/awscli/cli/ec2/vpc.rb +0 -42
- data/lib/awscli/cli/ec2/vpc/connections.rb +0 -0
- data/lib/awscli/cli/ec2/vpc/cust_gateways.rb +0 -0
- data/lib/awscli/cli/ec2/vpc/dhcp.rb +0 -51
- data/lib/awscli/cli/ec2/vpc/internet_gateways.rb +0 -58
- data/lib/awscli/cli/ec2/vpc/net_interfaces.rb +0 -75
- data/lib/awscli/cli/ec2/vpc/network_acls.rb +0 -29
- data/lib/awscli/cli/ec2/vpc/priv_gatewats.rb +0 -0
- data/lib/awscli/cli/ec2/vpc/route_tables.rb +0 -0
- data/lib/awscli/cli/s3.rb +0 -12
- data/lib/awscli/cli/s3/directories.rb +0 -82
- data/lib/awscli/cli/s3/files.rb +0 -77
- data/lib/awscli/connection.rb +0 -55
- data/lib/awscli/ec2.rb +0 -790
- data/lib/awscli/errors.rb +0 -64
- data/lib/awscli/helper.rb +0 -8
- data/lib/awscli/s3.rb +0 -108
- data/lib/awscli/version.rb +0 -3
- data/test/default_test.rb +0 -14
- data/test/test_helper.rb +0 -9
data/lib/awscli/cli/ec2/spot.rb
DELETED
@@ -1,81 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
require 'awscli/cli/ec2'
|
5
|
-
class SpotInstancesManagement < Thor
|
6
|
-
|
7
|
-
desc "list", "List spot requests or spot data feed subscription"
|
8
|
-
method_option :describe_spot_datafeed_subscription, :aliases => "-s", :type => :boolean, :default => false, :desc => "Describe spot data feed subscription"
|
9
|
-
method_option :price_history, :aliases => "-p", :type => :boolean, :default => false, :desc => "Describe spot price history"
|
10
|
-
method_option :filters, :aliases => "-f", :type => :hash, :desc => "List of filters to limit results with"
|
11
|
-
method_option :list_filters, :aliases => "-l", :type => :boolean, :default => false, :desc => "List the available filters"
|
12
|
-
def list
|
13
|
-
create_ec2_object
|
14
|
-
if options[:describe_spot_datafeed_subscription]
|
15
|
-
@ec2.describe_spot_datafeed_subscription
|
16
|
-
elsif options[:price_history]
|
17
|
-
@ec2.describe_spot_price_history options[:filters]
|
18
|
-
elsif options[:list_filters]
|
19
|
-
@ec2.list_filters
|
20
|
-
else
|
21
|
-
@ec2.describe_spot_requests
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
desc "create_spot_datafeed", "Create a spot datafeed subscription"
|
26
|
-
method_option :bucket, :aliases => "-b", :type => :string, :required => true, :desc => "bucket name to store datafeed in"
|
27
|
-
method_option :prefix, :aliases => "-p", :type => :string, :required => true, :desc => "prefix to store data with"
|
28
|
-
def create_spot_datafeed
|
29
|
-
create_ec2_object
|
30
|
-
@ec2.create_spot_datafeed_subsription options[:bucket], options[:prefix]
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "delete_spot_datafeed", "Delete a spot datafeed subscription"
|
34
|
-
def delete_spot_datafeed
|
35
|
-
create_ec2_object
|
36
|
-
@ec2.delete_spot_datafeed_subsription
|
37
|
-
end
|
38
|
-
|
39
|
-
desc "create", "Request spot instances"
|
40
|
-
method_option :price, :aliases => "-p", :type => :string, :required => true, :desc => "The maximum hourly price for any Spot Instance launched to fulfill the request"
|
41
|
-
method_option :image_id, :aliases => "-a", :type => :string, :required => true, :desc => "ami id to use"
|
42
|
-
method_option :flavor_id, :aliases => "-t", :type => :string, :required => true, :desc => "type of the instance to use"
|
43
|
-
method_option :key_name, :aliases => "-k", :type => :string, :required => true, :desc => "The name of the key pair"
|
44
|
-
method_option :instance_count, :aliases => "-c", :type => :numeric, :default => 1, :desc => "The maximum number of Spot Instances to launch"
|
45
|
-
method_option :request_type, :type => :string, :desc => "The Spot Instance request type, Valid Values:one-time | persistent"
|
46
|
-
method_option :valid_from, :type => :string, :banner => "DATETIME", :desc => "Start date of the request" #If this is a one-time request, the request becomes active at this date and time and remains active until all instances launch, the request expires, or the request is canceled If the request is persistent, the request becomes active at this date and time and remains active until it expires or is canceled.
|
47
|
-
method_option :valid_until, :type => :string, :banner => "DATETIME", :desc => "End date of the request" #If this is a one-time request, the request remains active until all instances launch, the request is canceled, or this date is reached. If the request is persistent, it remains active until it is canceled or this date and time is reached
|
48
|
-
method_option :launch_group, :type => :string, :default => "awscli_spot_group_#{Time.now.to_i}",:desc => "The instance launch group. Launch groups are Spot Instances that launch together and terminate together"
|
49
|
-
method_option :availability_zone_group, :type => :string, :desc => "The Availability Zone group. If you specify the same Availability Zone group for all Spot Instance requests, all Spot Instances are launched in the same Availability Zone"
|
50
|
-
method_option :groups, :type => :array, :default => ["default"], :desc => "Name of the security group"
|
51
|
-
method_option :user_data, :type => :string, :desc => "MIME, Base64-encoded user data to make available to the instances"
|
52
|
-
method_option :availability_zone, :type => :string, :desc => "The placement constraints (Availability Zone) for launching the instances"
|
53
|
-
method_option :block_device_mapping, :type => :string, :desc => "ebs mappings"
|
54
|
-
method_option :subnet_id, :type => :string, :desc => "subnet id use if vpc"
|
55
|
-
method_option :ebs_optimized, :type => :boolean, :desc => "whether to enable ebs optimization"
|
56
|
-
method_option :monitoring, :type => :boolean, :deafult => false, :desc => "Enables monitoring for the instance"
|
57
|
-
method_option :tags, :type => :string, :desc => "tags for the instances"
|
58
|
-
def create
|
59
|
-
create_ec2_object
|
60
|
-
@ec2.request_spot_instances options
|
61
|
-
end
|
62
|
-
|
63
|
-
desc "cancel", "Cancel spot instance requests"
|
64
|
-
def cancel
|
65
|
-
end
|
66
|
-
|
67
|
-
private
|
68
|
-
|
69
|
-
def create_ec2_object
|
70
|
-
puts "ec2 Establishing Connetion..."
|
71
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
72
|
-
puts "ec2 Establishing Connetion... OK"
|
73
|
-
@ec2 = Awscli::EC2::Spot.new($ec2_conn)
|
74
|
-
end
|
75
|
-
|
76
|
-
AwsCli::CLI::Ec2.register AwsCli::CLI::EC2::SpotInstancesManagement, :spot, 'spot [COMMAND]', 'EC2 Spot Instances Management'
|
77
|
-
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
end
|
@@ -1,43 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
require 'awscli/cli/ec2'
|
5
|
-
class Subnet < Thor
|
6
|
-
|
7
|
-
desc "list", "List VPCs"
|
8
|
-
def list
|
9
|
-
create_ec2_object
|
10
|
-
@ec2.list
|
11
|
-
end
|
12
|
-
|
13
|
-
desc "create", "Create a subnet in an existing VPC, You can create up to 20 subnets in a VPC."
|
14
|
-
method_option :vpc_id, :aliases => "-v", :type => :string, :required => true, :desc => "The ID of the VPC where you want to create the subnet"
|
15
|
-
method_option :cidr_block, :aliases => "-c", :type => :string, :required => true, :desc => "The CIDR block you want the subnet to cover (e.g., 10.0.0.0/24)"
|
16
|
-
method_option :availability_zone, :aliases => "-z", :type => :string, :desc => "The Availability Zone you want the subnet in. Default: AWS selects a zone for you (recommended)"
|
17
|
-
def create
|
18
|
-
create_ec2_object
|
19
|
-
@ec2.create options
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "delete", "Delete a subnet"
|
23
|
-
method_option :subnet_id, :aliases => "-s", :type => :string, :required => true, :desc => "The ID of the subnet you want to delete"
|
24
|
-
def delete
|
25
|
-
create_ec2_object
|
26
|
-
@ec2.delete options[:subnet_id]
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def create_ec2_object
|
32
|
-
puts "ec2 Establishing Connetion..."
|
33
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
34
|
-
puts "ec2 Establishing Connetion... OK"
|
35
|
-
@ec2 = Awscli::EC2::Subnet.new($ec2_conn)
|
36
|
-
end
|
37
|
-
|
38
|
-
AwsCli::CLI::Ec2.register AwsCli::CLI::EC2::Subnet, :subnet, 'subnet [COMMAND]', 'EC2 Subnet Management'
|
39
|
-
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
data/lib/awscli/cli/ec2/tags.rb
DELETED
@@ -1,45 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
require 'awscli/cli/ec2'
|
5
|
-
class Tags < Thor
|
6
|
-
|
7
|
-
desc "list", "List tags"
|
8
|
-
def list
|
9
|
-
create_ec2_object
|
10
|
-
@ec2.list
|
11
|
-
end
|
12
|
-
|
13
|
-
desc "create", "Create tag"
|
14
|
-
method_option :key, :aliases => "-k", :required => true, :type => :string, :desc => "key for the tag"
|
15
|
-
method_option :resource_id, :aliases => "-r", :required => true, :banner => "RID", :type => :string, :desc => "ID of a resource to tag. For example, ami-1a2b3c4d"
|
16
|
-
method_option :value, :aliases => "-v", :required => true, :type => :string, :desc => "Value for a tag. If you don't want the tag to have a value, specify the parameter with no value"
|
17
|
-
def create
|
18
|
-
create_ec2_object
|
19
|
-
@ec2.create options
|
20
|
-
end
|
21
|
-
|
22
|
-
desc "delete", "Deletes a specific set of tags from a specific set of resources"
|
23
|
-
method_option :key, :aliases => "-k", :required => true, :type => :string, :desc => "key for the tag"
|
24
|
-
method_option :resource_id, :aliases => "-r", :required => true, :banner => "RID", :type => :string, :desc => "ID of a resource to tag. For example, ami-1a2b3c4d"
|
25
|
-
method_option :value, :aliases => "-v", :required => true, :type => :string, :desc => "Value for a tag. If you don't want the tag to have a value, specify the parameter with no value"
|
26
|
-
def delete
|
27
|
-
create_ec2_object
|
28
|
-
@ec2.delete options
|
29
|
-
end
|
30
|
-
|
31
|
-
private
|
32
|
-
|
33
|
-
def create_ec2_object
|
34
|
-
puts "ec2 Establishing Connetion..."
|
35
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
36
|
-
puts "ec2 Establishing Connetion... OK"
|
37
|
-
@ec2 = Awscli::EC2::Tags.new($ec2_conn)
|
38
|
-
end
|
39
|
-
|
40
|
-
AwsCli::CLI::Ec2.register AwsCli::CLI::EC2::Tags, :tags, 'tags [COMMAND]', 'EC2 Tags Management'
|
41
|
-
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
data/lib/awscli/cli/ec2/vmmng.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
require 'awscli/cli/ec2'
|
5
|
-
class VmManagement < Thor
|
6
|
-
|
7
|
-
desc "list", "List Images"
|
8
|
-
def list
|
9
|
-
puts "Listing Images"
|
10
|
-
end
|
11
|
-
|
12
|
-
AwsCli::CLI::Ec2.register AwsCli::CLI::EC2::VmManagement, :vm, 'vm [COMMAND]', 'EC2 VM Management'
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
data/lib/awscli/cli/ec2/vpc.rb
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
require 'awscli/cli/ec2'
|
5
|
-
class Vpc < Thor
|
6
|
-
|
7
|
-
desc "list", "List VPCs"
|
8
|
-
def list
|
9
|
-
create_ec2_object
|
10
|
-
@ec2.list
|
11
|
-
end
|
12
|
-
|
13
|
-
desc "create", "Create a VPC with the CIDR block you specify"
|
14
|
-
method_option :cidr_block, :aliases => "-c", :type => :string, :required => true, :desc => "The CIDR block you want the VPC to cover (e.g., 10.0.0.0/16), You can't change the size of a VPC after you create it"
|
15
|
-
method_option :tenancy, :type => :string, :default => "default", :desc => "The allowed tenancy of instances launched into the VPC. A value of default means instances can be launched with any tenancy; a value of dedicated means instances must be launched with tenancy as dedicated"
|
16
|
-
def create
|
17
|
-
create_ec2_object
|
18
|
-
@ec2.create options
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "delete", "Deletes a VPC. You must detach or delete all gateways or other objects that are dependent on the VPC first"
|
22
|
-
method_option :vpc_id, :aliases => "-v", :type => :string, :required => true, :desc => "The ID of the VPC you want to delete"
|
23
|
-
def delete
|
24
|
-
create_ec2_object
|
25
|
-
@ec2.delete options[:vpc_id]
|
26
|
-
end
|
27
|
-
|
28
|
-
private
|
29
|
-
|
30
|
-
def create_ec2_object
|
31
|
-
puts "ec2 Establishing Connetion..."
|
32
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
33
|
-
puts "ec2 Establishing Connetion... OK"
|
34
|
-
@ec2 = Awscli::EC2::Vpc.new($ec2_conn)
|
35
|
-
end
|
36
|
-
|
37
|
-
AwsCli::CLI::Ec2.register AwsCli::CLI::EC2::Vpc, :vpc, 'vpc [COMMAND]', 'EC2 VPC Management'
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|
41
|
-
end
|
42
|
-
end
|
File without changes
|
File without changes
|
@@ -1,51 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
module VPC
|
5
|
-
require 'awscli/cli/ec2/vpc'
|
6
|
-
class Dhcp < Thor
|
7
|
-
|
8
|
-
desc "list", "List Dhcp Options"
|
9
|
-
def list
|
10
|
-
create_ec2_object
|
11
|
-
@ec2.list
|
12
|
-
end
|
13
|
-
|
14
|
-
desc "create", "Creates a set of DHCP options for your VPC"
|
15
|
-
method_option :dhcp_configuration_options, :aliases => "-o", :type => :hash, :required => true, :desc => "hash of key value dhcp options(domain-name, domain-name-servers, ntp-servers, netbios-name-servers, netbios-node-type) to assign"
|
16
|
-
def create
|
17
|
-
create_ec2_object
|
18
|
-
@ec2.create options[:dhcp_configuration_options]
|
19
|
-
end
|
20
|
-
|
21
|
-
desc "delete", "Deletes a set of DHCP options that you specify"
|
22
|
-
method_option :dhcp_options_id, :aliases => "-d", :type => :string, :required => true, :desc => "The ID of the DHCP options set you want to delete"
|
23
|
-
def delete
|
24
|
-
create_ec2_object
|
25
|
-
@ec2.delete options[:dhcp_options_id]
|
26
|
-
end
|
27
|
-
|
28
|
-
desc "associate", "Associates a set of DHCP options (that you've previously created) with the specified VPC. Or, associates no DHCP options with the VPC"
|
29
|
-
method_option :dhcp_options_id, :aliases => "-d", :type => :string, :required => true, :desc => "The ID of the DHCP options you want to associate with the VPC"
|
30
|
-
method_option :vpc_id, :aliases => "-v", :type => :string, :required => true, :desc => "The ID of the VPC you want to associate the DHCP options with"
|
31
|
-
def associate
|
32
|
-
create_ec2_object
|
33
|
-
@ec2.associate options[:dhcp_options_id], options[:vpc_id]
|
34
|
-
end
|
35
|
-
|
36
|
-
private
|
37
|
-
|
38
|
-
def create_ec2_object
|
39
|
-
puts "ec2 Establishing Connetion..."
|
40
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
41
|
-
puts "ec2 Establishing Connetion... OK"
|
42
|
-
@ec2 = Awscli::EC2::Dhcp.new($ec2_conn)
|
43
|
-
end
|
44
|
-
|
45
|
-
AwsCli::CLI::EC2::Vpc.register AwsCli::CLI::EC2::VPC::Dhcp, :dhcp, 'dhcp [COMMAND]', 'VPC DHCP Management'
|
46
|
-
|
47
|
-
end
|
48
|
-
end
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
module VPC
|
5
|
-
require 'awscli/cli/ec2/vpc'
|
6
|
-
class InternetGateways < Thor
|
7
|
-
|
8
|
-
desc "list", "List Internet Gateways"
|
9
|
-
def list
|
10
|
-
create_ec2_object
|
11
|
-
@ec2.list
|
12
|
-
end
|
13
|
-
|
14
|
-
desc "create", "Create Internet Gateway"
|
15
|
-
def create
|
16
|
-
create_ec2_object
|
17
|
-
@ec2.create
|
18
|
-
end
|
19
|
-
|
20
|
-
desc "delete", "Delete Internet Gateway"
|
21
|
-
method_option :internet_gateway_id, :aliases => "-i", :type => :string, :required => true, :desc => "id of the internet gateway to delete"
|
22
|
-
def delete
|
23
|
-
create_ec2_object
|
24
|
-
@ec2.delete options[:internet_gateway_id]
|
25
|
-
end
|
26
|
-
|
27
|
-
desc "attach", "Attach Internet Gateway"
|
28
|
-
method_option :internet_gateway_id, :aliases => "-i", :type => :string, :required => true, :desc => "id of the internet gateway to attach"
|
29
|
-
method_option :vpc_id, :aliases => "-v", :type => :string, :required => true, :desc => "id vpc to attach to"
|
30
|
-
def attach
|
31
|
-
create_ec2_object
|
32
|
-
@ec2.attach options[:internet_gateway_id], options[:vpc_id]
|
33
|
-
end
|
34
|
-
|
35
|
-
desc "deattach", "Deattach Internet Gateway"
|
36
|
-
method_option :internet_gateway_id, :aliases => "-i", :type => :string, :required => true, :desc => "id of the internet gateway to attach"
|
37
|
-
method_option :vpc_id, :aliases => "-v", :type => :string, :required => true, :desc => "id vpc to attach to"
|
38
|
-
def deattach
|
39
|
-
create_ec2_object
|
40
|
-
@ec2.deattach options[:internet_gateway_id], options[:vpc_id]
|
41
|
-
end
|
42
|
-
|
43
|
-
private
|
44
|
-
|
45
|
-
def create_ec2_object
|
46
|
-
puts "ec2 Establishing Connetion..."
|
47
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
48
|
-
puts "ec2 Establishing Connetion... OK"
|
49
|
-
@ec2 = Awscli::EC2::InternetGateways.new($ec2_conn)
|
50
|
-
end
|
51
|
-
|
52
|
-
AwsCli::CLI::EC2::Vpc.register AwsCli::CLI::EC2::VPC::InternetGateways, :internetgateways, 'internetgateways [COMMAND]', 'VPC Network Internet Gateway Management'
|
53
|
-
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|
@@ -1,75 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
module VPC
|
5
|
-
require 'awscli/cli/ec2/vpc'
|
6
|
-
class NetworkInterfaces < Thor
|
7
|
-
|
8
|
-
desc "list", "List Network Interfaces"
|
9
|
-
def list
|
10
|
-
create_ec2_object
|
11
|
-
@ec2.list
|
12
|
-
end
|
13
|
-
|
14
|
-
desc "create", "Creates a network interface in the specified subnet. This command is supported only in EC2-VPC"
|
15
|
-
method_option :subnet_id, :aliases => "-s", :type => :string, :required => true, :desc => "subnet id"
|
16
|
-
method_option :description, :aliases => "-d", :type => :string, :desc => "Set the description of the network interface"
|
17
|
-
method_option :private_ip_address, :aliases => "-p", :type => :string, :desc => "The primary private IP address of the network interface. If an IP address is not specified, one will be auto-assigned to the interface"
|
18
|
-
method_option :group_set, :aliases => "-g", :type => :array, :desc => "A security group to add to the network interface"
|
19
|
-
def create
|
20
|
-
create_ec2_object
|
21
|
-
@ec2.create options
|
22
|
-
end
|
23
|
-
|
24
|
-
desc "delete", "Deletes a network interface. Network interfaces must be detached from an instance before they can be deleted."
|
25
|
-
method_option :network_interface_id, :aliases => "-n", :type => :string, :required => true, :desc => "Id of the network interface to delete"
|
26
|
-
def delete
|
27
|
-
create_ec2_object
|
28
|
-
@ec2.delete options[:network_interface_id]
|
29
|
-
end
|
30
|
-
|
31
|
-
desc "attach", "Attaches a network interface to an instance"
|
32
|
-
method_option :network_interface_id, :aliases => "-n", :type => :string, :required => true, :desc => "ID of the network interface to attach"
|
33
|
-
method_option :instance_id, :aliases => "-i", :type => :string, :required => true, :desc => "ID of the instance that will be attached to the network interface"
|
34
|
-
method_option :device_index, :aliases => "-d", :type => :numeric, :required => true, :desc => "index of the device for the network interface attachment on the instance"
|
35
|
-
def attach
|
36
|
-
create_ec2_object
|
37
|
-
@ec2.attach options[:network_interface_id], options[:instance_id], options[:device_index]
|
38
|
-
end
|
39
|
-
|
40
|
-
desc "deattach", "Detaches a network interface"
|
41
|
-
method_option :attachment_id, :aliases => "-a", :type => :string, :required => true, :desc => "ID of the attachment to detach"
|
42
|
-
method_option :force, :aliases => "-f", :type => :boolean, :default => false, :desc => "Set to true to force a detachment"
|
43
|
-
def deattach
|
44
|
-
create_ec2_object
|
45
|
-
@ec2.deattach options[:attachment_id], options[:force]
|
46
|
-
end
|
47
|
-
|
48
|
-
desc "modify_attribute", "Modifies a network interface attribute. You can specify only one attribute at a time"
|
49
|
-
method_option :network_interface_id, :aliases => "-n", :type => :string, :required => true, :desc => "The ID of the network interface you want to modify an attribute of"
|
50
|
-
method_option :attribute, :aliases => "-a", :type => :string, :required => true, :desc => "The attribute to modify, must be one of 'description', 'groupSet', 'sourceDestCheck' or 'attachment'"
|
51
|
-
method_option :description, :aliases => "-d", :type => :string, :desc => "New value of attribute - description"
|
52
|
-
method_option :group_set, :aliases => "-g", :type => :array, :desc => "New value of attribute - a list of group id's"
|
53
|
-
method_option :source_dest_check, :aliases => "-s", :type => :boolean, :desc => "New value of attribute - a boolean value"
|
54
|
-
method_option :attachment, :aliases => "-t", :type => :hash, :desc => "a hash with: attachmentid - the attachment to change & deleteOnTermination - a boolean"
|
55
|
-
def modify_attribute
|
56
|
-
create_ec2_object
|
57
|
-
@ec2.modify_attribute options
|
58
|
-
end
|
59
|
-
|
60
|
-
private
|
61
|
-
|
62
|
-
def create_ec2_object
|
63
|
-
puts "ec2 Establishing Connetion..."
|
64
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
65
|
-
puts "ec2 Establishing Connetion... OK"
|
66
|
-
@ec2 = Awscli::EC2::NetworkInterfaces.new($ec2_conn)
|
67
|
-
end
|
68
|
-
|
69
|
-
AwsCli::CLI::EC2::Vpc.register AwsCli::CLI::EC2::VPC::NetworkInterfaces, :netinterfaces, 'netinterfaces [COMMAND]', 'VPC Network Acl Management'
|
70
|
-
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
75
|
-
end
|
@@ -1,29 +0,0 @@
|
|
1
|
-
module AwsCli
|
2
|
-
module CLI
|
3
|
-
module EC2
|
4
|
-
module VPC
|
5
|
-
require 'awscli/cli/ec2/vpc'
|
6
|
-
class NetworkAcl < Thor
|
7
|
-
|
8
|
-
desc "list", "List NACLs"
|
9
|
-
def list
|
10
|
-
create_ec2_object
|
11
|
-
@ec2.list
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def create_ec2_object
|
17
|
-
puts "ec2 Establishing Connetion..."
|
18
|
-
$ec2_conn = Awscli::Connection.new.request_ec2
|
19
|
-
puts "ec2 Establishing Connetion... OK"
|
20
|
-
@ec2 = Awscli::EC2::NetworkAcl.new($ec2_conn)
|
21
|
-
end
|
22
|
-
|
23
|
-
AwsCli::CLI::EC2::Vpc.register AwsCli::CLI::EC2::VPC::NetworkAcl, :networkacl, 'networkacl [COMMAND]', 'VPC Network Acl Management'
|
24
|
-
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|