ey-core 3.4.0 → 3.6.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (119) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +27 -5
  5. data/Gemfile +0 -1
  6. data/README.md +65 -8
  7. data/Rakefile +4 -1
  8. data/ey-core.gemspec +9 -5
  9. data/features/accounts.feature +13 -0
  10. data/features/applications.feature +29 -0
  11. data/features/current_user.feature +14 -0
  12. data/features/docker_registry_credentials.feature +21 -0
  13. data/features/environment_variables.feature +54 -0
  14. data/features/environments.feature +30 -0
  15. data/features/init.feature +6 -0
  16. data/features/login.feature +6 -0
  17. data/features/scp.feature +6 -0
  18. data/features/step_definitions/accounts_steps.rb +37 -0
  19. data/features/step_definitions/applications_steps.rb +39 -0
  20. data/features/step_definitions/current_user_steps.rb +11 -0
  21. data/features/step_definitions/deprecated_command_steps.rb +3 -0
  22. data/features/step_definitions/docker_registry_credentials_steps.rb +3 -0
  23. data/features/step_definitions/environment_variables_steps.rb +51 -0
  24. data/features/step_definitions/environments_steps.rb +52 -0
  25. data/features/step_definitions/version_steps.rb +3 -0
  26. data/features/support/account_helpers.rb +89 -0
  27. data/features/support/app_helpers.rb +19 -0
  28. data/features/support/aruba.rb +1 -0
  29. data/features/support/boilerplate.rb +1 -0
  30. data/features/support/client_helpers.rb +36 -0
  31. data/features/support/config_file_helpers.rb +42 -0
  32. data/features/support/core.rb +19 -0
  33. data/features/support/deployment_helpers.rb +19 -0
  34. data/features/support/env.rb +40 -0
  35. data/features/support/environment_helpers.rb +23 -0
  36. data/features/support/environment_variable_helpers.rb +20 -0
  37. data/features/support/fake_kernel.rb +23 -0
  38. data/features/support/io.rb +5 -0
  39. data/features/support/mock_api.rb +20 -0
  40. data/features/support/output_helpers.rb +7 -0
  41. data/features/support/resource_helpers.rb +201 -0
  42. data/features/support/server_helpers.rb +27 -0
  43. data/features/version.feature +8 -0
  44. data/features/whoami.feature +14 -0
  45. data/lib/ey-core/cli/deploy.rb +4 -4
  46. data/lib/ey-core/cli/docker_registry_login.rb +29 -0
  47. data/lib/ey-core/cli/environment_variables.rb +71 -0
  48. data/lib/ey-core/cli/helpers/core.rb +29 -0
  49. data/lib/ey-core/cli/main.rb +5 -4
  50. data/lib/ey-core/cli/servers.rb +35 -17
  51. data/lib/ey-core/cli/ssh.rb +1 -1
  52. data/lib/ey-core/client.rb +35 -0
  53. data/lib/ey-core/client/mock.rb +5 -0
  54. data/lib/ey-core/collections/auto_scaling_alarms.rb +8 -0
  55. data/lib/ey-core/collections/auto_scaling_groups.rb +8 -0
  56. data/lib/ey-core/collections/auto_scaling_policies.rb +33 -0
  57. data/lib/ey-core/collections/container_clusters.rb +9 -0
  58. data/lib/ey-core/collections/container_service_deployments.rb +17 -0
  59. data/lib/ey-core/collections/environment_variables.rb +8 -0
  60. data/lib/ey-core/collections/servers.rb +4 -0
  61. data/lib/ey-core/models/account.rb +10 -0
  62. data/lib/ey-core/models/address.rb +2 -0
  63. data/lib/ey-core/models/application.rb +1 -0
  64. data/lib/ey-core/models/auto_scaling_alarm.rb +54 -0
  65. data/lib/ey-core/models/auto_scaling_group.rb +75 -0
  66. data/lib/ey-core/models/base_auto_scaling_policy.rb +61 -0
  67. data/lib/ey-core/models/container_service_deployment.rb +17 -0
  68. data/lib/ey-core/models/environment.rb +60 -47
  69. data/lib/ey-core/models/environment_variable.rb +29 -0
  70. data/lib/ey-core/models/request.rb +6 -0
  71. data/lib/ey-core/models/server.rb +2 -0
  72. data/lib/ey-core/models/simple_auto_scaling_policy.rb +24 -0
  73. data/lib/ey-core/models/step_auto_scaling_policy.rb +24 -0
  74. data/lib/ey-core/models/target_auto_scaling_policy.rb +24 -0
  75. data/lib/ey-core/requests/boot_environment.rb +1 -1
  76. data/lib/ey-core/requests/create_account.rb +5 -0
  77. data/lib/ey-core/requests/create_address.rb +1 -0
  78. data/lib/ey-core/requests/create_application.rb +8 -7
  79. data/lib/ey-core/requests/create_auto_scaling_alarm.rb +69 -0
  80. data/lib/ey-core/requests/create_auto_scaling_group.rb +62 -0
  81. data/lib/ey-core/requests/create_auto_scaling_policy.rb +68 -0
  82. data/lib/ey-core/requests/create_environment.rb +2 -0
  83. data/lib/ey-core/requests/create_environment_variable.rb +39 -0
  84. data/lib/ey-core/requests/create_user.rb +8 -6
  85. data/lib/ey-core/requests/destroy_auto_scaling_alarm.rb +49 -0
  86. data/lib/ey-core/requests/destroy_auto_scaling_group.rb +44 -0
  87. data/lib/ey-core/requests/destroy_auto_scaling_policy.rb +49 -0
  88. data/lib/ey-core/requests/discover_container_service_deployments.rb +71 -0
  89. data/lib/ey-core/requests/discover_server.rb +60 -0
  90. data/lib/ey-core/requests/get_applications.rb +1 -1
  91. data/lib/ey-core/requests/get_auto_scaling_alarm.rb +27 -0
  92. data/lib/ey-core/requests/get_auto_scaling_alarms.rb +34 -0
  93. data/lib/ey-core/requests/get_auto_scaling_group.rb +21 -0
  94. data/lib/ey-core/requests/get_auto_scaling_groups.rb +29 -0
  95. data/lib/ey-core/requests/get_auto_scaling_policies.rb +46 -0
  96. data/lib/ey-core/requests/get_auto_scaling_policy.rb +27 -0
  97. data/lib/ey-core/requests/get_deployments.rb +1 -1
  98. data/lib/ey-core/requests/get_environment_variable.rb +19 -0
  99. data/lib/ey-core/requests/get_environment_variables.rb +29 -0
  100. data/lib/ey-core/requests/get_environments.rb +1 -1
  101. data/lib/ey-core/requests/get_ssl_certificate.rb +1 -1
  102. data/lib/ey-core/requests/retrieve_docker_registry_credentials.rb +24 -0
  103. data/lib/ey-core/requests/update_auto_scaling_alarm.rb +45 -0
  104. data/lib/ey-core/requests/update_auto_scaling_group.rb +45 -0
  105. data/lib/ey-core/requests/update_auto_scaling_policy.rb +46 -0
  106. data/lib/ey-core/requests/update_environment_variable.rb +25 -0
  107. data/lib/ey-core/test_helpers.rb +2 -0
  108. data/lib/ey-core/test_helpers/auto_scaling_helpers.rb +35 -0
  109. data/lib/ey-core/version.rb +1 -1
  110. data/spec/addresses_spec.rb +2 -1
  111. data/spec/auto_scaling_alarms_spec.rb +40 -0
  112. data/spec/auto_scaling_groups_spec.rb +28 -0
  113. data/spec/auto_scaling_policies_spec.rb +94 -0
  114. data/spec/docker_registry_credentials_spec.rb +16 -0
  115. data/spec/environments_spec.rb +18 -0
  116. data/spec/servers_spec.rb +8 -0
  117. data/spec/spec_helper.rb +7 -0
  118. data/spec/support/core.rb +0 -2
  119. metadata +192 -18
@@ -173,6 +173,35 @@ module Ey
173
173
  end
174
174
  end
175
175
 
176
+ # Fetches a list of environments by given name or ID.
177
+ #
178
+ # @param environment_name_or_id [String] name or ID of environment.
179
+ #
180
+ # @return [Array<Ey::Core::Client::Environment>] list of environments.
181
+ def core_environments(environment_name_or_id)
182
+ core_client.environments.all(name: environment_name_or_id).tap do |result|
183
+ result << core_client.environments.get(environment_name_or_id) if result.empty?
184
+ end.to_a.compact
185
+ end
186
+
187
+ # Fetches a list of applications by given name or ID.
188
+ #
189
+ # @param application_name_or_id [String] name or ID of application.
190
+ #
191
+ # @return [Array<Ey::Core::Client::Environment>] list of environments.
192
+ def core_applications(application_name_or_id)
193
+ core_client.applications.all(name: application_name_or_id).tap do |result|
194
+ result << core_client.applications.get(application_name_or_id) if result.empty?
195
+ end.to_a.compact
196
+ end
197
+
198
+ # Fetches a list of environment variables available for current user.
199
+ #
200
+ # @return [Array<Ey::Core::Client::EnvironmentVariable>] list of environment variables.
201
+ def core_environment_variables
202
+ core_client.environment_variables
203
+ end
204
+
176
205
  def write_core_yaml(token=nil)
177
206
  core_yaml[core_url] = token if token
178
207
  File.open(self.class.core_file, "w") {|file|
@@ -2,7 +2,7 @@
2
2
  #require 'ostruct'
3
3
  #require 'ey-core'
4
4
  require 'ey-core/cli'
5
- require 'awesome_print'
5
+ require 'amazing_print'
6
6
  require 'belafonte'
7
7
  require 'rubygems/package'
8
8
  require 'escape'
@@ -13,7 +13,9 @@ require 'ey-core/cli/applications'
13
13
  require 'ey-core/cli/console'
14
14
  require 'ey-core/cli/current_user'
15
15
  require 'ey-core/cli/deploy'
16
+ require 'ey-core/cli/docker_registry_login'
16
17
  require 'ey-core/cli/environments'
18
+ require 'ey-core/cli/environment_variables'
17
19
  require 'ey-core/cli/help'
18
20
  require 'ey-core/cli/init'
19
21
  require 'ey-core/cli/login'
@@ -29,9 +31,6 @@ require 'ey-core/cli/version'
29
31
  require 'ey-core/cli/web'
30
32
  require 'ey-core/cli/whoami'
31
33
 
32
- Cistern.formatter = Cistern::Formatter::AwesomePrint
33
-
34
-
35
34
  module Ey
36
35
  module Core
37
36
  module Cli
@@ -44,7 +43,9 @@ module Ey
44
43
  mount Console
45
44
  mount CurrentUser
46
45
  mount Deploy
46
+ mount DockerRegistryLogin
47
47
  mount Environments
48
+ mount EnvironmentVariables
48
49
  mount Help
49
50
  mount Init
50
51
  mount Login
@@ -4,36 +4,54 @@ module Ey
4
4
  module Core
5
5
  module Cli
6
6
  class Servers < Subcommand
7
- title "servers"
8
- summary "List servers you have access to"
7
+ title 'servers'
8
+ summary 'List servers you have access to'
9
9
 
10
10
  option :account,
11
11
  short: 'c',
12
12
  long: 'account',
13
13
  description: 'Filter by account name or id',
14
- argument: 'Account'
14
+ argument: 'account'
15
15
 
16
16
  option :environment,
17
- short: "-e",
18
- long: "environment",
19
- description: "Filter by environment.",
20
- argument: "environment"
17
+ short: 'e',
18
+ long: 'environment',
19
+ description: 'Filter by environment.',
20
+ argument: 'environment'
21
+
22
+ option :role,
23
+ short: 'r',
24
+ long: 'role',
25
+ description: 'Filter by server role.',
26
+ argument: 'role'
21
27
 
22
28
  def handle
23
- puts TablePrint::Printer.
24
- new(servers, [{id: {width: 10}}, :role, :provisioned_id]).
25
- table_print
29
+ puts TablePrint::Printer.new(
30
+ servers,
31
+ [
32
+ { id: { width: 10 } },
33
+ :role,
34
+ :provisioned_id,
35
+ { public_hostname: { width: 50 } },
36
+ :name,
37
+ ]
38
+ ).table_print
26
39
  end
27
40
 
28
41
  private
29
42
  def servers
30
- if option(:account)
31
- core_client.servers.all(account: core_account)
32
- elsif environment = option(:environment)
33
- (core_client.environments.get(environment) || core_client.environments.first(name: environment)).servers.all
34
- else
35
- core_client.servers.all
36
- end
43
+ filter_opts = {}
44
+
45
+ operator =
46
+ if option(:environment)
47
+ core_account.environments.first(name: option(:environment))
48
+ else
49
+ filter_opts[:account] = core_account.id if option(:account)
50
+ core_client
51
+ end
52
+
53
+ filter_opts[:role] = option(:role).split(',') if option(:role)
54
+ operator ? operator.servers.all(filter_opts) : nil
37
55
  end
38
56
  end
39
57
  end
@@ -107,7 +107,7 @@ module Ey
107
107
  end
108
108
 
109
109
  if option(:server)
110
- servers += [core_server_for(server: option[:server], operator: environment)]
110
+ servers += [core_server_for(server: option(:server), operator: environment)]
111
111
  else
112
112
  servers += Ey::Core::Cli::Helpers::ServerSieve.filter(
113
113
  environment.servers,
@@ -14,10 +14,14 @@ class Ey::Core::Client < Cistern::Service
14
14
  collection :application_archives
15
15
  collection :application_deployments
16
16
  collection :applications
17
+ collection :auto_scaling_alarms
18
+ collection :auto_scaling_groups
19
+ collection :auto_scaling_policies
17
20
  collection :backup_files
18
21
  collection :blueprints
19
22
  collection :components
20
23
  collection :contacts
24
+ collection :container_service_deployments
21
25
  collection :costs
22
26
  collection :database_plan_usages
23
27
  collection :database_server_revisions
@@ -28,6 +32,7 @@ class Ey::Core::Client < Cistern::Service
28
32
  collection :deployments
29
33
  collection :environment_plan_usages
30
34
  collection :environments
35
+ collection :environment_variables
31
36
  collection :features
32
37
  collection :firewall_rules
33
38
  collection :firewalls
@@ -70,11 +75,15 @@ class Ey::Core::Client < Cistern::Service
70
75
  model :application
71
76
  model :application_archive
72
77
  model :application_deployment
78
+ model :auto_scaling_alarm
79
+ model :auto_scaling_group
73
80
  model :backup_file
81
+ model :base_auto_scaling_policy
74
82
  model :billing
75
83
  model :blueprint
76
84
  model :component
77
85
  model :contact
86
+ model :container_service_deployment
78
87
  model :cost
79
88
  model :database_plan_usage
80
89
  model :database_server
@@ -85,6 +94,7 @@ class Ey::Core::Client < Cistern::Service
85
94
  model :deployment
86
95
  model :environment
87
96
  model :environment_plan_usage
97
+ model :environment_variable
88
98
  model :feature
89
99
  model :firewall
90
100
  model :firewall_rule
@@ -107,10 +117,13 @@ class Ey::Core::Client < Cistern::Service
107
117
  model :server_event
108
118
  model :server_usage
109
119
  model :service
120
+ model :simple_auto_scaling_policy
110
121
  model :ssl_certificate
122
+ model :step_auto_scaling_policy
111
123
  model :storage
112
124
  model :storage_user
113
125
  model :support_trial
126
+ model :target_auto_scaling_policy
114
127
  model :task
115
128
  model :token
116
129
  model :untracked_address
@@ -134,11 +147,14 @@ class Ey::Core::Client < Cistern::Service
134
147
  request :create_alert
135
148
  request :create_application
136
149
  request :create_application_archive
150
+ request :create_auto_scaling_alarm
151
+ request :create_auto_scaling_group
137
152
  request :create_backup_file
138
153
  request :create_database_server
139
154
  request :create_database_service
140
155
  request :create_database_service_snapshot
141
156
  request :create_environment
157
+ request :create_environment_variable
142
158
  request :create_firewall
143
159
  request :create_firewall_rule
144
160
  request :create_keypair
@@ -151,6 +167,7 @@ class Ey::Core::Client < Cistern::Service
151
167
  request :create_password_reset
152
168
  request :create_provider
153
169
  request :create_server
170
+ request :create_auto_scaling_policy
154
171
  request :create_ssl_certificate
155
172
  request :create_storage
156
173
  request :create_storage_user
@@ -162,6 +179,8 @@ class Ey::Core::Client < Cistern::Service
162
179
  request :deploy_environment_application
163
180
  request :deprovision_environment
164
181
  request :destroy_addon
182
+ request :destroy_auto_scaling_alarm
183
+ request :destroy_auto_scaling_group
165
184
  request :destroy_blueprint
166
185
  request :destroy_database_server
167
186
  request :destroy_database_server_snapshot
@@ -173,15 +192,18 @@ class Ey::Core::Client < Cistern::Service
173
192
  request :destroy_logical_database
174
193
  request :destroy_provider
175
194
  request :destroy_server
195
+ request :destroy_auto_scaling_policy
176
196
  request :destroy_ssl_certificate
177
197
  request :destroy_storage
178
198
  request :destroy_storage_user
179
199
  request :destroy_user
180
200
  request :detach_address
181
201
  request :disable_feature
202
+ request :discover_container_service_deployments
182
203
  request :discover_database_server
183
204
  request :discover_database_server_snapshots
184
205
  request :discover_provider_location
206
+ request :discover_server
185
207
  request :download_file
186
208
  request :enable_feature
187
209
  request :get_account
@@ -203,6 +225,10 @@ class Ey::Core::Client < Cistern::Service
203
225
  request :get_application_deployment
204
226
  request :get_application_deployments
205
227
  request :get_applications
228
+ request :get_auto_scaling_alarm
229
+ request :get_auto_scaling_alarms
230
+ request :get_auto_scaling_group
231
+ request :get_auto_scaling_groups
206
232
  request :get_backup_file
207
233
  request :get_backup_files
208
234
  request :get_billing
@@ -229,6 +255,8 @@ class Ey::Core::Client < Cistern::Service
229
255
  request :get_environment_database_services
230
256
  request :get_environment_logical_databases
231
257
  request :get_environment_plan_usages
258
+ request :get_environment_variable
259
+ request :get_environment_variables
232
260
  request :get_environments
233
261
  request :get_feature
234
262
  request :get_features
@@ -271,6 +299,8 @@ class Ey::Core::Client < Cistern::Service
271
299
  request :get_server_events
272
300
  request :get_server_usages
273
301
  request :get_servers
302
+ request :get_auto_scaling_policy
303
+ request :get_auto_scaling_policies
274
304
  request :get_ssl_certificate
275
305
  request :get_ssl_certificates
276
306
  request :get_storage
@@ -294,6 +324,7 @@ class Ey::Core::Client < Cistern::Service
294
324
  request :reset_password
295
325
  request :reset_server_state
296
326
  request :restart_environment_app_servers
327
+ request :retrieve_docker_registry_credentials
297
328
  request :run_cluster_application_action
298
329
  request :run_environment_application_action
299
330
  request :signup
@@ -305,9 +336,13 @@ class Ey::Core::Client < Cistern::Service
305
336
  request :update_address
306
337
  request :update_alert
307
338
  request :update_application_archive
339
+ request :update_auto_scaling_alarm
340
+ request :update_auto_scaling_group
341
+ request :update_auto_scaling_policy
308
342
  request :update_billing
309
343
  request :update_blueprint
310
344
  request :update_environment
345
+ request :update_environment_variable
311
346
  request :update_membership
312
347
  request :update_provider_location
313
348
  request :update_server
@@ -116,6 +116,9 @@ class Ey::Core::Client::Mock
116
116
  :application_archives => {},
117
117
  :application_deployments => {},
118
118
  :applications => {},
119
+ :auto_scaling_alarms => {},
120
+ :auto_scaling_groups => {},
121
+ :auto_scaling_policies => {},
119
122
  :backup_files => {},
120
123
  :backups => {},
121
124
  :billing => {},
@@ -124,6 +127,7 @@ class Ey::Core::Client::Mock
124
127
  :components => components,
125
128
  :contact_assignments => [],
126
129
  :contacts => {},
130
+ :container_service_deployments => {},
127
131
  :costs => [],
128
132
  :database_plan_usages => Hash.new { |h1,k1| h1[k1] = {} },
129
133
  :database_server_firewalls => [],
@@ -136,6 +140,7 @@ class Ey::Core::Client::Mock
136
140
  :deployments => {},
137
141
  :environment_plan_usages => Hash.new { |h1,k1| h1[k1] = {} },
138
142
  :environments => {},
143
+ :environment_variables => {},
139
144
  :features => {},
140
145
  :firewall_rules => {},
141
146
  :firewalls => {},
@@ -0,0 +1,8 @@
1
+ class Ey::Core::Client::AutoScalingAlarms < Ey::Core::Collection
2
+ model Ey::Core::Client::AutoScalingAlarm
3
+
4
+ self.model_root = "auto_scaling_alarm"
5
+ self.model_request = :get_auto_scaling_alarm
6
+ self.collection_root = "auto_scaling_alarms"
7
+ self.collection_request = :get_auto_scaling_alarms
8
+ end
@@ -0,0 +1,8 @@
1
+ class Ey::Core::Client::AutoScalingGroups < Ey::Core::Collection
2
+ model Ey::Core::Client::AutoScalingGroup
3
+
4
+ self.model_root = "auto_scaling_group"
5
+ self.model_request = :get_auto_scaling_group
6
+ self.collection_root = "auto_scaling_groups"
7
+ self.collection_request = :get_auto_scaling_groups
8
+ end
@@ -0,0 +1,33 @@
1
+ class Ey::Core::Client::AutoScalingPolicies < Ey::Core::Collection
2
+ model Ey::Core::Client::BaseAutoScalingPolicy
3
+
4
+ MODELS_TO_TYPE = {
5
+ "simple" => Ey::Core::Client::SimpleAutoScalingPolicy,
6
+ "step" => Ey::Core::Client::StepAutoScalingPolicy,
7
+ "target" => Ey::Core::Client::TargetAutoScalingPolicy
8
+ }.freeze
9
+
10
+ self.model_root = "auto_scaling_policy"
11
+ self.model_request = :get_auto_scaling_policy
12
+ self.collection_root = "auto_scaling_policies"
13
+ self.collection_request = :get_auto_scaling_policies
14
+
15
+ def new(attributes = {})
16
+ unless attributes.is_a?(::Hash)
17
+ raise(ArgumentError.new("Initialization parameters must be an attributes hash, got #{attributes.class} #{attributes.inspect}"))
18
+ end
19
+
20
+ params = Cistern::Hash.stringify_keys(attributes)
21
+ type = params["type"] ||= "simple"
22
+ model = MODELS_TO_TYPE[type]
23
+ unless model
24
+ raise(ArgumentError.new("Unrecognized policy type #{type}. Allowed types are: #{MODELS_TO_TYPE.keys.join(', ')}"))
25
+ end
26
+ model.new(
27
+ {
28
+ :collection => self,
29
+ :connection => connection,
30
+ }.merge(params)
31
+ )
32
+ end
33
+ end
@@ -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,8 @@
1
+ class Ey::Core::Client::EnvironmentVariables < Ey::Core::Collection
2
+ model Ey::Core::Client::EnvironmentVariable
3
+
4
+ self.model_root = "environment_variable"
5
+ self.model_request = :get_environment_variable
6
+ self.collection_root = "environment_variables"
7
+ self.collection_request = :get_environment_variables
8
+ end
@@ -6,4 +6,8 @@ class Ey::Core::Client::Servers < Ey::Core::Collection
6
6
  self.model_request = :get_server
7
7
  self.collection_root = "servers"
8
8
  self.collection_request = :get_servers
9
+
10
+ def discover(options={})
11
+ self.connection.requests.new(self.connection.discover_server(Cistern::Hash.stringify_keys(options)).body["request"])
12
+ end
9
13
  end
@@ -1,3 +1,5 @@
1
+ require 'hashie'
2
+
1
3
  class Ey::Core::Client::Account < Ey::Core::Model
2
4
  extend Ey::Core::Associations
3
5
 
@@ -67,4 +69,12 @@ class Ey::Core::Client::Account < Ey::Core::Model
67
69
  else raise NotImplementedError # update
68
70
  end
69
71
  end
72
+
73
+ # Get authorization data for an Amazon ECR registry.
74
+ # @param [String] location_id Aws region
75
+ # @return [Hashie::Mash]
76
+ def retrieve_docker_registry_credentials(location_id)
77
+ result = self.connection.retrieve_docker_registry_credentials(self.id, location_id).body
78
+ ::Hashie::Mash.new(result['docker_registry_credentials'])
79
+ end
70
80
  end