awful 0.0.123 → 0.0.124
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/apigw +8 -0
- data/lib/awful/api_gateway.rb +41 -0
- data/lib/awful/api_gateway_deployments.rb +44 -0
- data/lib/awful/version.rb +1 -1
- metadata +6 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73d0f072c1311e48bbea4f32b6aa262e676338c8
|
4
|
+
data.tar.gz: 8924ea3bad2e2fd12c275ce67548f3cb8a4809dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f339fd441fec34e7b4de8eef9abc5db31b669960d924b5cd5a7aae2473397fea4dcfe72419cb56cb0defe332e676edb93d3202c8b11d15ba19db88295eab3f7
|
7
|
+
data.tar.gz: 245919e6bf8293a5ca10ae5cb20103a0e5fc7b1b6236f98c7ddac715939e6d440d218dab65db141d14ecf400cea9f88d53f2345f81a6c7018c237de4d95c1ac1
|
data/bin/apigw
ADDED
@@ -0,0 +1,41 @@
|
|
1
|
+
module Awful
|
2
|
+
module Short
|
3
|
+
def apigw(*args)
|
4
|
+
Awful::ApiGateway.new.invoke(*args)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
class Cli < Thor
|
9
|
+
no_commands do
|
10
|
+
def api_gateway
|
11
|
+
@api_gateway ||= Aws::APIGateway::Client.new
|
12
|
+
end
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
module ApiGateway
|
17
|
+
class RestApi < Cli
|
18
|
+
desc 'ls', 'list rest apis'
|
19
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
20
|
+
def ls
|
21
|
+
api_gateway.get_rest_apis.items.output do |items|
|
22
|
+
if options[:long]
|
23
|
+
print_table items.map { |i|
|
24
|
+
[i.name, i.id, i.created_date, i.description]
|
25
|
+
}.sort
|
26
|
+
else
|
27
|
+
puts items.map(&:name).sort
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
desc 'delete ID', 'delete rest api with ID'
|
33
|
+
def delete(id)
|
34
|
+
name = api_gateway.get_rest_api(rest_api_id: id).name
|
35
|
+
if yes?("Really delete rest api #{id}: #{name}?", :yellow)
|
36
|
+
api_gateway.delete_rest_api(rest_api_id: id)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
@@ -0,0 +1,44 @@
|
|
1
|
+
module Awful
|
2
|
+
module Short
|
3
|
+
def deployments(*args)
|
4
|
+
Awful::ApiGateway::Deployments.new.invoke(*args)
|
5
|
+
end
|
6
|
+
end
|
7
|
+
|
8
|
+
module ApiGateway
|
9
|
+
|
10
|
+
class Deployments < Cli
|
11
|
+
desc 'ls REST_API_ID', 'list deployments for given rest api'
|
12
|
+
method_option :long, aliases: '-l', default: false, desc: 'Long listing'
|
13
|
+
def ls(id)
|
14
|
+
api_gateway.get_deployments(rest_api_id: id).items.output do |items|
|
15
|
+
if options[:long]
|
16
|
+
print_table items.sort_by(&:created_date).map { |i|
|
17
|
+
[i.id, i.created_date, i.description]
|
18
|
+
}
|
19
|
+
else
|
20
|
+
puts items.map(&:id)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
desc 'create REST_API_ID STAGE', 'create deployment for rest api and stage'
|
26
|
+
method_option :description, aliases: '-d', type: :string, default: nil, desc: 'description of deployment'
|
27
|
+
def create(id, stage)
|
28
|
+
api_gateway.create_deployment(
|
29
|
+
rest_api_id: id,
|
30
|
+
stage_name: stage,
|
31
|
+
description: options[:description]
|
32
|
+
).output do |response|
|
33
|
+
puts response.id
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
class RestApi < Cli
|
39
|
+
desc 'deployments', 'deployments subcommands'
|
40
|
+
subcommand 'deployments', Deployments
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
data/lib/awful/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: awful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.124
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ric Lister
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -85,6 +85,7 @@ email:
|
|
85
85
|
- rlister+gh@gmail.com
|
86
86
|
executables:
|
87
87
|
- ami
|
88
|
+
- apigw
|
88
89
|
- asg
|
89
90
|
- asgn
|
90
91
|
- cf
|
@@ -121,6 +122,7 @@ files:
|
|
121
122
|
- Rakefile
|
122
123
|
- awful.gemspec
|
123
124
|
- bin/ami
|
125
|
+
- bin/apigw
|
124
126
|
- bin/asg
|
125
127
|
- bin/asgn
|
126
128
|
- bin/cf
|
@@ -149,6 +151,8 @@ files:
|
|
149
151
|
- bin/vpc
|
150
152
|
- lib/awful.rb
|
151
153
|
- lib/awful/ami.rb
|
154
|
+
- lib/awful/api_gateway.rb
|
155
|
+
- lib/awful/api_gateway_deployments.rb
|
152
156
|
- lib/awful/auto_scaling.rb
|
153
157
|
- lib/awful/auto_scaling_notifications.rb
|
154
158
|
- lib/awful/changesets.rb
|