ey-core 3.5.0 → 3.6.0.autoscaling1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/Dockerfile +3 -0
- data/bin/ey-core +0 -8
- data/lib/ey-core/client/mock.rb +1 -0
- data/lib/ey-core/client.rb +3 -0
- data/lib/ey-core/collections/container_clusters.rb +9 -0
- data/lib/ey-core/collections/container_service_deployments.rb +17 -0
- data/lib/ey-core/models/container_service_deployment.rb +17 -0
- data/lib/ey-core/models/server.rb +1 -1
- data/lib/ey-core/requests/discover_container_service_deployments.rb +71 -0
- data/lib/ey-core/version.rb +1 -1
- metadata +10 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d6ea2b7bfed5dc192b709ae8531b774ad238f90b5ed4709186af8250639c944e
|
4
|
+
data.tar.gz: b930f35c380cc22b00465bd98b7f4c8ce193732911cfadac0ae7034a27390ecb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3ef000eaee9816291914a7eb0214775a2b8625ef1dafcb9acda1cd6947b2791a3c979e3e785c9743ff1b500e2f2d7cca32b1e1c68993970f3f35aa4ae5e17c44
|
7
|
+
data.tar.gz: 887e4c0d1b3a97a67b8b9524433e318f8ebe275329817f87f3d7f4f55f6749603f23d6c008f2c670f7f3c30546025c27b1c73610527179e48411bbefd42f2f71
|
data/Dockerfile
ADDED
data/bin/ey-core
CHANGED
@@ -1,12 +1,4 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
git_path = File.expand_path("../../.git", __FILE__)
|
4
|
-
|
5
|
-
if File.exist? git_path
|
6
|
-
lib_dir = File.expand_path("../../lib", __FILE__)
|
7
|
-
$LOAD_PATH.unshift( lib_dir )
|
8
|
-
end
|
9
|
-
|
10
2
|
require File.expand_path('../../lib/ey-core/cli/main', __FILE__)
|
11
3
|
|
12
4
|
Ey::Core::Cli::Main.new(ARGV).execute!
|
data/lib/ey-core/client/mock.rb
CHANGED
@@ -127,6 +127,7 @@ class Ey::Core::Client::Mock
|
|
127
127
|
:components => components,
|
128
128
|
:contact_assignments => [],
|
129
129
|
:contacts => {},
|
130
|
+
:container_service_deployments => {},
|
130
131
|
:costs => [],
|
131
132
|
:database_plan_usages => Hash.new { |h1,k1| h1[k1] = {} },
|
132
133
|
:database_server_firewalls => [],
|
data/lib/ey-core/client.rb
CHANGED
@@ -21,6 +21,7 @@ class Ey::Core::Client < Cistern::Service
|
|
21
21
|
collection :blueprints
|
22
22
|
collection :components
|
23
23
|
collection :contacts
|
24
|
+
collection :container_service_deployments
|
24
25
|
collection :costs
|
25
26
|
collection :database_plan_usages
|
26
27
|
collection :database_server_revisions
|
@@ -82,6 +83,7 @@ class Ey::Core::Client < Cistern::Service
|
|
82
83
|
model :blueprint
|
83
84
|
model :component
|
84
85
|
model :contact
|
86
|
+
model :container_service_deployment
|
85
87
|
model :cost
|
86
88
|
model :database_plan_usage
|
87
89
|
model :database_server
|
@@ -197,6 +199,7 @@ class Ey::Core::Client < Cistern::Service
|
|
197
199
|
request :destroy_user
|
198
200
|
request :detach_address
|
199
201
|
request :disable_feature
|
202
|
+
request :discover_container_service_deployments
|
200
203
|
request :discover_database_server
|
201
204
|
request :discover_database_server_snapshots
|
202
205
|
request :discover_provider_location
|
@@ -0,0 +1,9 @@
|
|
1
|
+
class Ey::Core::Client::ContainerClusters < Ey::Core::Collection
|
2
|
+
|
3
|
+
model Ey::Core::Client::ContainerCluster
|
4
|
+
|
5
|
+
self.model_root = "container_cluster"
|
6
|
+
self.model_request = :get_container_cluster
|
7
|
+
self.collection_root = "container_clusters"
|
8
|
+
self.collection_request = :get_container_clusters
|
9
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Ey::Core::Client::ContainerServiceDeployments < Ey::Core::Collection
|
2
|
+
|
3
|
+
model Ey::Core::Client::ContainerServiceDeployment
|
4
|
+
|
5
|
+
self.model_root = "container_service_deployment"
|
6
|
+
self.model_request = :get_container_service_deployment
|
7
|
+
self.collection_root = "container_service_deployments"
|
8
|
+
self.collection_request = :get_container_service_deployments
|
9
|
+
|
10
|
+
def discover(task_definition_arn)
|
11
|
+
params = {
|
12
|
+
"task_definition_arn" => task_definition_arn
|
13
|
+
}
|
14
|
+
|
15
|
+
connection.requests.new(connection.discover_container_service_deployments(params).body["request"])
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class Ey::Core::Client::ContainerServiceDeployment < Ey::Core::Model
|
2
|
+
extend Ey::Core::Associations
|
3
|
+
|
4
|
+
identity :id
|
5
|
+
|
6
|
+
attribute :container_service_id
|
7
|
+
attribute :public_ip_address
|
8
|
+
attribute :private_ip_address
|
9
|
+
attribute :port_mappings
|
10
|
+
attribute :health_status
|
11
|
+
attribute :container_health_status
|
12
|
+
attribute :container_instance_id
|
13
|
+
attribute :task_arn
|
14
|
+
attribute :created_at, type: :time
|
15
|
+
attribute :updated_at, type: :time
|
16
|
+
attribute :deleted_at, type: :time
|
17
|
+
end
|
@@ -134,7 +134,7 @@ class Ey::Core::Client::Server < Ey::Core::Model
|
|
134
134
|
end
|
135
135
|
|
136
136
|
def destroy!(skip_snapshot="false")
|
137
|
-
if environment.servers.count ==
|
137
|
+
if environment.servers.reject { |server| server.id == self.id }.count == 0
|
138
138
|
raise Ey::Core::Client::NotPermitted, "Terminating the last server in an environment is not allowed. You must deprovision or destroy the environment instead."
|
139
139
|
end
|
140
140
|
|
@@ -0,0 +1,71 @@
|
|
1
|
+
class Ey::Core::Client
|
2
|
+
class Real
|
3
|
+
def discover_container_service_deployments(params={})
|
4
|
+
url = params.delete("url")
|
5
|
+
|
6
|
+
request(
|
7
|
+
:method => :get,
|
8
|
+
:url => url,
|
9
|
+
:params => params,
|
10
|
+
:path => "/container_service_deployments/discover",
|
11
|
+
)
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
class Mock
|
16
|
+
def discover_container_service_deployments(params={})
|
17
|
+
extract_url_params!(params)
|
18
|
+
|
19
|
+
callback_url = params.delete("callback_url")
|
20
|
+
deployment_id = self.uuid
|
21
|
+
resource_id = self.uuid
|
22
|
+
|
23
|
+
existing_deploymens = self.data[:container_service_deployments].values.select do |deployment|
|
24
|
+
deployment["container_service_id"] == container_service["id"]
|
25
|
+
end
|
26
|
+
existing_deploymens = nil if existing_deploymens.empty?
|
27
|
+
|
28
|
+
resources = existing_deploymens || [{
|
29
|
+
"id" => deployment_id,
|
30
|
+
"container_service_id" => params["container_service_id"],
|
31
|
+
"public_ip_address" => "123.456.789.123",
|
32
|
+
"private_ip_address" => "10.0.1.2",
|
33
|
+
"container_instance_id" => SecureRandom.uuid,
|
34
|
+
"port_mappings" => [{
|
35
|
+
"container_port" => "80",
|
36
|
+
"host_port" => "80",
|
37
|
+
"protocol" => "tcp"
|
38
|
+
}],
|
39
|
+
"provisioned_id" => resource_id,
|
40
|
+
"health_status" => "HEALTHY",
|
41
|
+
"task_arn" => SecureRandom.uuid,
|
42
|
+
"container_health_status" => [{
|
43
|
+
"container_arn" => SecureRandom.uuid,
|
44
|
+
"health_status" => SecureRandom.uuid
|
45
|
+
}]
|
46
|
+
}]
|
47
|
+
|
48
|
+
request = {
|
49
|
+
"id" => request_id,
|
50
|
+
"type" => "discover_container_service_deployments",
|
51
|
+
"successful" => true,
|
52
|
+
"started_at" => Time.now,
|
53
|
+
"finished_at" => nil,
|
54
|
+
"resource" => [:container_service_deployments, resource_id, resources, "/container_service_deployments"]
|
55
|
+
}
|
56
|
+
|
57
|
+
self.data[:container_service_deployments][deployment_id] = request
|
58
|
+
|
59
|
+
response_hash = request.dup
|
60
|
+
response_hash.delete("resource")
|
61
|
+
|
62
|
+
response(
|
63
|
+
:body => {"request" => response_hash},
|
64
|
+
:status => 200,
|
65
|
+
:headers => {
|
66
|
+
"Content-Type" => "application/json; charset=utf8"
|
67
|
+
}
|
68
|
+
)
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
data/lib/ey-core/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ey-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0.autoscaling1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Engine Yard Engineering
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-09-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|
@@ -387,6 +387,7 @@ files:
|
|
387
387
|
- ".ruby-version"
|
388
388
|
- ".travis.yml"
|
389
389
|
- CHANGELOG.md
|
390
|
+
- Dockerfile
|
390
391
|
- Gemfile
|
391
392
|
- Guardfile
|
392
393
|
- LICENSE.txt
|
@@ -496,6 +497,8 @@ files:
|
|
496
497
|
- lib/ey-core/collections/blueprints.rb
|
497
498
|
- lib/ey-core/collections/components.rb
|
498
499
|
- lib/ey-core/collections/contacts.rb
|
500
|
+
- lib/ey-core/collections/container_clusters.rb
|
501
|
+
- lib/ey-core/collections/container_service_deployments.rb
|
499
502
|
- lib/ey-core/collections/costs.rb
|
500
503
|
- lib/ey-core/collections/database_plan_usages.rb
|
501
504
|
- lib/ey-core/collections/database_server_revisions.rb
|
@@ -564,6 +567,7 @@ files:
|
|
564
567
|
- lib/ey-core/models/blueprint.rb
|
565
568
|
- lib/ey-core/models/component.rb
|
566
569
|
- lib/ey-core/models/contact.rb
|
570
|
+
- lib/ey-core/models/container_service_deployment.rb
|
567
571
|
- lib/ey-core/models/cost.rb
|
568
572
|
- lib/ey-core/models/database_plan_usage.rb
|
569
573
|
- lib/ey-core/models/database_server.rb
|
@@ -680,6 +684,7 @@ files:
|
|
680
684
|
- lib/ey-core/requests/destroy_user.rb
|
681
685
|
- lib/ey-core/requests/detach_address.rb
|
682
686
|
- lib/ey-core/requests/disable_feature.rb
|
687
|
+
- lib/ey-core/requests/discover_container_service_deployments.rb
|
683
688
|
- lib/ey-core/requests/discover_database_server.rb
|
684
689
|
- lib/ey-core/requests/discover_database_server_snapshots.rb
|
685
690
|
- lib/ey-core/requests/discover_provider_location.rb
|
@@ -927,12 +932,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
927
932
|
version: 2.2.2
|
928
933
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
929
934
|
requirements:
|
930
|
-
- - "
|
935
|
+
- - ">"
|
931
936
|
- !ruby/object:Gem::Version
|
932
|
-
version:
|
937
|
+
version: 1.3.1
|
933
938
|
requirements: []
|
934
|
-
|
935
|
-
rubygems_version: 2.5.2.1
|
939
|
+
rubygems_version: 3.0.3
|
936
940
|
signing_key:
|
937
941
|
specification_version: 4
|
938
942
|
summary: Client library providing real and mock functionality for accessing Engine
|