Class: Ey::Core::Client::Real

Inherits:
Object
  • Object
show all
Includes:
Shared
Defined in:
lib/ey-core/client/real.rb,
lib/ey-core/requests/signup.rb,
lib/ey-core/requests/get_gem.rb,
lib/ey-core/requests/get_log.rb,
lib/ey-core/requests/get_logs.rb,
lib/ey-core/requests/get_task.rb,
lib/ey-core/requests/get_user.rb,
lib/ey-core/requests/get_addon.rb,
lib/ey-core/requests/get_alert.rb,
lib/ey-core/requests/get_costs.rb,
lib/ey-core/requests/get_tasks.rb,
lib/ey-core/requests/get_token.rb,
lib/ey-core/requests/get_users.rb,
lib/ey-core/requests/create_log.rb,
lib/ey-core/requests/get_addons.rb,
lib/ey-core/requests/get_alerts.rb,
lib/ey-core/requests/get_server.rb,
lib/ey-core/requests/get_tokens.rb,
lib/ey-core/requests/get_volume.rb,
lib/ey-core/requests/create_task.rb,
lib/ey-core/requests/create_user.rb,
lib/ey-core/requests/get_account.rb,
lib/ey-core/requests/get_address.rb,
lib/ey-core/requests/get_billing.rb,
lib/ey-core/requests/get_feature.rb,
lib/ey-core/requests/get_keypair.rb,
lib/ey-core/requests/get_message.rb,
lib/ey-core/requests/get_request.rb,
lib/ey-core/requests/get_servers.rb,
lib/ey-core/requests/get_storage.rb,
lib/ey-core/requests/get_volumes.rb,
lib/ey-core/requests/upload_file.rb,
lib/ey-core/requests/create_addon.rb,
lib/ey-core/requests/create_alert.rb,
lib/ey-core/requests/create_token.rb,
lib/ey-core/requests/destroy_user.rb,
lib/ey-core/requests/get_accounts.rb,
lib/ey-core/requests/get_contacts.rb,
lib/ey-core/requests/get_features.rb,
lib/ey-core/requests/get_firewall.rb,
lib/ey-core/requests/get_keypairs.rb,
lib/ey-core/requests/get_messages.rb,
lib/ey-core/requests/get_metadata.rb,
lib/ey-core/requests/get_provider.rb,
lib/ey-core/requests/get_requests.rb,
lib/ey-core/requests/get_storages.rb,
lib/ey-core/requests/update_addon.rb,
lib/ey-core/requests/update_alert.rb,
lib/ey-core/requests/create_server.rb,
lib/ey-core/requests/destroy_addon.rb,
lib/ey-core/requests/download_file.rb,
lib/ey-core/requests/get_addresses.rb,
lib/ey-core/requests/get_api_token.rb,
lib/ey-core/requests/get_blueprint.rb,
lib/ey-core/requests/get_component.rb,
lib/ey-core/requests/get_firewalls.rb,
lib/ey-core/requests/get_providers.rb,
lib/ey-core/requests/reboot_server.rb,
lib/ey-core/requests/update_server.rb,
lib/ey-core/requests/attach_address.rb,
lib/ey-core/requests/cancel_account.rb,
lib/ey-core/requests/create_account.rb,
lib/ey-core/requests/create_address.rb,
lib/ey-core/requests/create_keypair.rb,
lib/ey-core/requests/create_message.rb,
lib/ey-core/requests/create_storage.rb,
lib/ey-core/requests/destroy_server.rb,
lib/ey-core/requests/detach_address.rb,
lib/ey-core/requests/enable_feature.rb,
lib/ey-core/requests/get_blueprints.rb,
lib/ey-core/requests/get_components.rb,
lib/ey-core/requests/get_deployment.rb,
lib/ey-core/requests/get_membership.rb,
lib/ey-core/requests/reset_password.rb,
lib/ey-core/requests/update_address.rb,
lib/ey-core/requests/update_billing.rb,
lib/ey-core/requests/create_firewall.rb,
lib/ey-core/requests/create_provider.rb,
lib/ey-core/requests/destroy_storage.rb,
lib/ey-core/requests/disable_feature.rb,
lib/ey-core/requests/get_application.rb,
lib/ey-core/requests/get_backup_file.rb,
lib/ey-core/requests/get_deployments.rb,
lib/ey-core/requests/get_environment.rb,
lib/ey-core/requests/get_memberships.rb,
lib/ey-core/requests/get_plan_usages.rb,
lib/ey-core/requests/boot_environment.rb,
lib/ey-core/requests/destroy_firewall.rb,
lib/ey-core/requests/destroy_provider.rb,
lib/ey-core/requests/get_applications.rb,
lib/ey-core/requests/get_backup_files.rb,
lib/ey-core/requests/get_current_user.rb,
lib/ey-core/requests/get_environments.rb,
lib/ey-core/requests/get_legacy_alert.rb,
lib/ey-core/requests/get_server_event.rb,
lib/ey-core/requests/get_storage_user.rb,
lib/ey-core/requests/request_callback.rb,
lib/ey-core/requests/update_blueprint.rb,
lib/ey-core/requests/update_connector.rb,
lib/ey-core/requests/create_membership.rb,
lib/ey-core/requests/destroy_blueprint.rb,
lib/ey-core/requests/get_account_trial.rb,
lib/ey-core/requests/get_firewall_rule.rb,
lib/ey-core/requests/get_legacy_alerts.rb,
lib/ey-core/requests/get_load_balancer.rb,
lib/ey-core/requests/get_server_events.rb,
lib/ey-core/requests/get_server_usages.rb,
lib/ey-core/requests/get_storage_users.rb,
lib/ey-core/requests/get_support_trial.rb,
lib/ey-core/requests/update_membership.rb,
lib/ey-core/requests/authorized_channel.rb,
lib/ey-core/requests/create_application.rb,
lib/ey-core/requests/create_backup_file.rb,
lib/ey-core/requests/create_environment.rb,
lib/ey-core/requests/get_firewall_rules.rb,
lib/ey-core/requests/get_load_balancers.rb,
lib/ey-core/requests/get_token_by_login.rb,
lib/ey-core/requests/timeout_deployment.rb,
lib/ey-core/requests/update_environment.rb,
lib/ey-core/requests/create_storage_user.rb,
lib/ey-core/requests/destroy_environment.rb,
lib/ey-core/requests/get_database_server.rb,
lib/ey-core/requests/get_ssl_certificate.rb,
lib/ey-core/requests/apply_server_updates.rb,
lib/ey-core/requests/create_firewall_rule.rb,
lib/ey-core/requests/create_load_balancer.rb,
lib/ey-core/requests/destroy_storage_user.rb,
lib/ey-core/requests/get_database_servers.rb,
lib/ey-core/requests/get_database_service.rb,
lib/ey-core/requests/get_logical_database.rb,
lib/ey-core/requests/get_ssl_certificates.rb,
lib/ey-core/requests/get_untracked_server.rb,
lib/ey-core/requests/blueprint_environment.rb,
lib/ey-core/requests/create_password_reset.rb,
lib/ey-core/requests/destroy_firewall_rule.rb,
lib/ey-core/requests/destroy_load_balancer.rb,
lib/ey-core/requests/get_account_referrals.rb,
lib/ey-core/requests/get_database_services.rb,
lib/ey-core/requests/get_logical_databases.rb,
lib/ey-core/requests/get_provider_location.rb,
lib/ey-core/requests/get_untracked_servers.rb,
lib/ey-core/requests/create_database_server.rb,
lib/ey-core/requests/create_ssl_certificate.rb,
lib/ey-core/requests/get_keypair_deployment.rb,
lib/ey-core/requests/get_load_balancer_node.rb,
lib/ey-core/requests/get_provider_locations.rb,
lib/ey-core/requests/update_ssl_certificate.rb,
lib/ey-core/requests/create_database_service.rb,
lib/ey-core/requests/create_logical_database.rb,
lib/ey-core/requests/create_untracked_server.rb,
lib/ey-core/requests/deprovision_environment.rb,
lib/ey-core/requests/destroy_database_server.rb,
lib/ey-core/requests/destroy_ssl_certificate.rb,
lib/ey-core/requests/get_application_archive.rb,
lib/ey-core/requests/get_keypair_deployments.rb,
lib/ey-core/requests/get_load_balancer_nodes.rb,
lib/ey-core/requests/get_operational_contact.rb,
lib/ey-core/requests/update_untracked_server.rb,
lib/ey-core/requests/create_untracked_address.rb,
lib/ey-core/requests/destroy_database_service.rb,
lib/ey-core/requests/destroy_logical_database.rb,
lib/ey-core/requests/discover_database_server.rb,
lib/ey-core/requests/get_account_cancellation.rb,
lib/ey-core/requests/get_application_archives.rb,
lib/ey-core/requests/get_database_plan_usages.rb,
lib/ey-core/requests/get_operational_contacts.rb,
lib/ey-core/requests/apply_environment_updates.rb,
lib/ey-core/requests/create_keypair_deployment.rb,
lib/ey-core/requests/get_alerting_environments.rb,
lib/ey-core/requests/get_load_balancer_service.rb,
lib/ey-core/requests/bootstrap_logical_database.rb,
lib/ey-core/requests/create_application_archive.rb,
lib/ey-core/requests/discover_provider_location.rb,
lib/ey-core/requests/get_application_deployment.rb,
lib/ey-core/requests/get_database_server_usages.rb,
lib/ey-core/requests/get_load_balancer_services.rb,
lib/ey-core/requests/update_application_archive.rb,
lib/ey-core/requests/get_application_deployments.rb,
lib/ey-core/requests/get_environment_plan_usages.rb,
lib/ey-core/requests/get_database_server_snapshot.rb,
lib/ey-core/requests/get_database_server_revisions.rb,
lib/ey-core/requests/get_database_server_snapshots.rb,
lib/ey-core/requests/change_environment_maintenance.rb,
lib/ey-core/requests/deploy_environment_application.rb,
lib/ey-core/requests/get_database_servers_firewalls.rb,
lib/ey-core/requests/run_cluster_application_action.rb,
lib/ey-core/requests/upload_recipes_for_environment.rb,
lib/ey-core/requests/get_possible_provider_locations.rb,
lib/ey-core/requests/restart_environment_app_servers.rb,
lib/ey-core/requests/create_database_service_snapshot.rb,
lib/ey-core/requests/destroy_database_server_snapshot.rb,
lib/ey-core/requests/get_environment_database_services.rb,
lib/ey-core/requests/get_environment_logical_databases.rb,
lib/ey-core/requests/discover_database_server_snapshots.rb,
lib/ey-core/requests/run_environment_application_action.rb

Instance Attribute Summary

Attributes included from Shared

#authentication, #cache, #url

Instance Method Summary collapse

Methods included from Shared

#metadata, #require_argument, #require_argument!, #require_arguments, #require_parameters, #setup, #url_for

Constructor Details

#initialize(options = {}) ⇒ Real

Returns a new instance of Real.



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/ey-core/client/real.rb', line 4

def initialize(options={})
  setup(options)
  adapter            = options[:adapter] || Faraday.default_adapter
  connection_options = options[:connection_options] || {}

  @connection = Faraday.new({url: @url}.merge(connection_options)) do |builder|
    # response
    builder.response :json, content_type: /json/

    builder.use Ey::Core::ResponseCache, cache: @cache if @cache

    # request
    builder.request :multipart
    builder.request :json

    # request
    builder.request :retry,
      :max                 => 5,
      :interval            => 1,
      :interval_randomness => 0.05,
      :backoff_factor      => 2

    unless @authentication == :none
      if @token
        builder.use Ey::Core::TokenAuthentication, @token
      else
        builder.use :hmac, @auth_id, @auth_key
      end
    end

    builder.use Ey::Core::Logger, @logger

    if options[:builder]
      options[:builder].call(builder)
    end

    builder.adapter(*adapter)
  end
end

Instance Method Details

#accept_typeObject



84
85
86
# File 'lib/ey-core/client/real.rb', line 84

def accept_type
  "application/vnd.engineyard.v3+json"
end

#apply_environment_updates(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/apply_environment_updates.rb', line 3

def apply_environment_updates(options={})
  id  = options.delete("id")
  url = options.delete("url")

  request(
    :path   => "environments/#{id}/apply",
    :method => :post,
    :url    => url,
    :body   => options,
  )
end

#apply_server_updates(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/apply_server_updates.rb', line 3

def apply_server_updates(options={})
  id  = options.delete("id")
  url = options.delete("url")

  request(
    :path   => "servers/#{id}/apply",
    :method => :post,
    :url    => url,
    :body   => options,
  )
end

#attach_address(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/attach_address.rb', line 3

def attach_address(params={})
  id = params.delete("id")

  request(
    :method => :put,
    :path   => "addresses/#{id}/attach",
    :params => params,
  )
end

#authorized_channel(path) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/authorized_channel.rb', line 3

def authorized_channel(path)
  request(
    :path   => "/channels",
    :params => {"channel" => {"path" => path}}
  )
end

#blueprint_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/blueprint_environment.rb', line 3

def blueprint_environment(params={})
  id = params.delete("id")
  url = params.delete("url")

  request(
    :body   => params,
    :method => :post,
    :path   => "environments/#{id}/blueprint",
    :url    => url,
  )
end

#boot_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/boot_environment.rb', line 3

def boot_environment(params={})
  id = params.delete("id")

  request(
    :path   => "/environments/#{id}/boot",
    :method => :post,
    :body   => params
  )
end

#bootstrap_logical_database(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/bootstrap_logical_database.rb', line 3

def bootstrap_logical_database(params={})
  request(
    :method => :post,
    :path   => "/logical-databases/bootstrap",
    :url    => params.delete("url"),
    :body   => params,
  )
end

#cancel_account(resource_id, requested_by_id) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/cancel_account.rb', line 3

def (resource_id, requested_by_id)
  request(
    :method => :post,
    :path   => "account_cancellations",
    :params => {"requested_by_id" => requested_by_id, "account_id" => resource_id},
  )
end

#change_environment_maintenance(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/change_environment_maintenance.rb', line 3

def change_environment_maintenance(options={})
  id  = options.delete("id")
  url = options.delete("url")

  request(
    :body   => options,
    :method => :put,
    :path   => "environments/#{id}/maintenance",
    :url    => url,
  )
end

#create_account(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/create_account.rb', line 3

def (params={})
  request(
    :method => :post,
    :path   => "/accounts",
    :params => params,
  )
end

#create_addon(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_addon.rb', line 3

def create_addon(params={})
  url = params.delete("url") or raise "URL needed"
  request(
    :method => :post,
    :url    => url,
    :params => params,
  )
end

#create_address(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/create_address.rb', line 3

def create_address(params={})
  request(
    :method => :post,
    :path   => "/addresses",
    :params => params,
  )
end

#create_alert(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_alert.rb', line 3

def create_alert(params={})
  url = params.delete("url")

  request(
    :method => :post,
    :path   => "/alerts",
    :body   => params,
    :url    => url,
  )
end

#create_application(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_application.rb', line 3

def create_application(params={})
  url = params.delete("url")

  request(
    :method => :post,
    :path   => "/applications",
    :params => params,
    :url    => url,
  )
end

#create_application_archive(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_application_archive.rb', line 3

def create_application_archive(params={})
  application_id = params["application"]
  url            = params.delete("url")

  request(
    :method => :post,
    :path   => "/applications/#{application_id}/archives",
    :params => params,
    :url    => url,
  )
end

#create_backup_file(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_backup_file.rb', line 3

def create_backup_file(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :method => :post,
    :path   => "backup_files/#{id}",
    :url    => url,
    :body   => params,
  )
end

#create_database_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_database_server.rb', line 3

def create_database_server(params={})
  request(
    :method => :post,
    :path   => "/database-servers",
    :url    => params.delete("url"),
    :body   => params,
  )
end

#create_database_service(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_database_service.rb', line 3

def create_database_service(params={})
  request(
    :method => :post,
    :path   => "/database-services",
    :url    => params.delete("url"),
    :body   => params,
  )
end

#create_database_service_snapshot(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_database_service_snapshot.rb', line 3

def create_database_service_snapshot(params={})
  (url = params.delete("url")) || (name = params.fetch("name"))

  request(
    :method => :post,
    :path   => "/database-services/#{name}/snapshot",
    :url    => url,
    :body   => params,
  )
end

#create_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_environment.rb', line 3

def create_environment(params={})
    = params["account"]
  url         = params.delete("url")

  request(
    :body   => params,
    :method => :post,
    :path   => "/accounts/#{}/environments",
    :url    => url,
  )
end

#create_firewall(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_firewall.rb', line 3

def create_firewall(params={})
  url = params.delete("url")

  request(
    :method => :post,
    :path   => "/firewalls",
    :url    => url,
    :body   => params,
  )
end

#create_firewall_rule(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_firewall_rule.rb', line 3

def create_firewall_rule(params={})
  firewall = params.delete("firewall")
  url      = params.delete("url")

  request(
    :method => :post,
    :path   => "/firewalls/#{firewall}/rules",
    :url    => url,
    :body   => params,
  )
end

#create_keypair(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_keypair.rb', line 3

def create_keypair(params={})
  url = params.delete("url")

  request(
    :body   => params,
    :method => :post,
    :path   => "/keypairs",
    :url    => url,
  )
end

#create_keypair_deployment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_keypair_deployment.rb', line 3

def create_keypair_deployment(params={})
  url            = params.delete("url")
  keypair_id     = params["keypair"]
  environment_id = params["environment"]

  request(
    :method => :post,
    :path   => "/environments/#{environment_id}/keypairs/#{keypair_id}",
    :url    => url,
  )
end

#create_load_balancer(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_load_balancer.rb', line 3

def create_load_balancer(params={})
  url = params.delete("url")

  request(
    :method => :post,
    :path   => "/load-balancers",
    :url    => url,
    :body   => params,
  )
end

#create_log(params = {}) ⇒ Object

Create a log.

params - A hash of log params:

component_action_id - A component action id (required).
log - A hash of log attributes:
  file - File body.
  filename - The name of the log file.
  mime_type - The file mime type.

Returns the created log.



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/ey-core/requests/create_log.rb', line 13

def create_log(params={})
  query_params = {"log" => params["log"]}
  component_action_id = params["component_action_id"]
  body = query_params.to_json

  request(
    :method => :post,
    :path   => "/component-actions/#{component_action_id}/logs",
    :body => body
  )
end

#create_logical_database(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_logical_database.rb', line 3

def create_logical_database(params={})
  request(
    :method => :post,
    :path   => "/logical-databases",
    :url    => params.delete("url"),
    :body   => params,
  )
end

#create_membership(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/create_membership.rb', line 3

def create_membership(params={})
  query_params = {"membership" => params["membership"]}
  body = query_params.to_json

  request(
    :method => :post,
    :path   => "/memberships",
    :body => body
  )
end

#create_message(_params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/create_message.rb', line 3

def create_message(_params={})
  params, _ = require_arguments(_params, "url")

  request(
    :method => :post,
    :url    => params.delete("url"),
    :body   => params,
  )
end

#create_password_reset(params) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/create_password_reset.rb', line 3

def create_password_reset(params)
  request(
    :method => :post,
    :path   => "/password-resets",
    :body   => {
      :password_reset => params
    }
  )
end

#create_provider(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/ey-core/requests/create_provider.rb', line 3

def create_provider(params={})
  if  = params["account"]
    request(
      :method => :post,
      :path   => "/accounts/#{}/providers",
      :body   => params,
    )
  elsif url = params.delete("url")
    request(
      :method => :post,
      :url    => url,
      :body   => params,
    )
  else
    raise "Need params for either Account ID (account) or URL"
  end
end

#create_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_server.rb', line 3

def create_server(params={})
  request(
    :method => :post,
    :path   => "/servers",
    :url    => params.delete("url"),
    :body   => params,
  )
end

#create_ssl_certificate(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_ssl_certificate.rb', line 3

def create_ssl_certificate(params={})
    = params["account"]
  url         = params.delete("url")

  request(
    :method => :post,
    :url    => url,
    :path   => "/accounts/#{}/ssl_certificates",
    :body   => params
  )
end

#create_storage(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_storage.rb', line 3

def create_storage(params={})
  provider_id = params.delete("provider")
  url         = params.delete("url")

  request(
    :body   => params,
    :method => :post,
    :path   => "/providers/#{provider_id}/storages",
    :url    => url,
  )
end

#create_storage_user(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_storage_user.rb', line 3

def create_storage_user(params={})
  storage_id = params.delete("storage")
  url        = params.delete("url")

  request(
    :body   => params,
    :method => :post,
    :path   => "/storages/#{storage_id}/users",
    :url    => url,
  )
end

#create_task(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/create_task.rb', line 3

def create_task(params={})
  cluster_component_id  = params.delete("cluster_component")
  url = params.delete("url")

  request(
    :body   => params,
    :method => :post,
    :path   => "/cluster_components/#{cluster_component_id}/tasks",
    :url    => url,
  )
end

#create_token(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_token.rb', line 3

def create_token(params={})

  request(
    :method => :post,
    :path   => "tokens",
    :params => params,
  )
end

#create_untracked_address(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_untracked_address.rb', line 3

def create_untracked_address(params={})
  request(
    :body   => params,
    :method => :post,
    :path   => "/untracked-addresses",
    :url    => params.delete("url"),
  )
end

#create_untracked_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/create_untracked_server.rb', line 3

def create_untracked_server(params={})
  request(
    :body   => params,
    :method => :post,
    :path   => "/untracked-servers",
    :url    => params.delete("url"),
  )
end

#create_user(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/create_user.rb', line 3

def create_user(params={})
  request(
    :method => :post,
    :path   => "/users",
    :body   => params,
  )
end

#deploy_environment_application(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/deploy_environment_application.rb', line 3

def deploy_environment_application(options={})
  id = options.delete("id")

  request(
    :path   => "/environments/#{id}/deploy",
    :method => :post,
    :body   => options,
  )
end

#deprovision_environment(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/deprovision_environment.rb', line 3

def deprovision_environment(options={})
  id = options.delete("id")

  request(
    :method => :put,
    :path   => "/environments/#{id}/deprovision",
  )
end

#destroy_addon(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/destroy_addon.rb', line 3

def destroy_addon(params={})
  url = params.delete("url") or raise "URL needed"
  request(
    :method => :delete,
    :url    => url,
  )
end

#destroy_blueprint(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/destroy_blueprint.rb', line 3

def destroy_blueprint(params={})
  id = params.delete("id")

  request(
    :path   => "blueprints/#{id}",
    :method => :delete
  )
end

#destroy_database_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_database_server.rb', line 3

def destroy_database_server(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/database_servers/#{id}",
    :url    => url,
    :method => :delete,
  )
end

#destroy_database_server_snapshot(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/destroy_database_server_snapshot.rb', line 3

def destroy_database_server_snapshot(params={})
  (url = params["url"]) || (id = params.fetch("id"))

  request(
    :method => :delete,
    :url    => url,
    :path   => "/database-server-snapshots/#{id}",
  )
end

#destroy_database_service(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_database_service.rb', line 3

def destroy_database_service(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/database-services/#{id}",
    :url    => url,
    :method => :delete,
  )
end

#destroy_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_environment.rb', line 3

def destroy_environment(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :method => :delete,
    :url    => url,
    :path   => "/environments/#{id}",
  )
end

#destroy_firewall(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_firewall.rb', line 3

def destroy_firewall(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/firewalls/#{id}",
    :url    => url,
    :method => :delete,
  )
end

#destroy_firewall_rule(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_firewall_rule.rb', line 3

def destroy_firewall_rule(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/firewall-rules/#{id}",
    :url    => url,
    :method => :delete,
  )
end

#destroy_load_balancer(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_load_balancer.rb', line 3

def destroy_load_balancer(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/load-balancers/#{id}",
    :url    => url,
    :method => :delete,
  )
end

#destroy_logical_database(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_logical_database.rb', line 3

def destroy_logical_database(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/logical-databases/#{id}",
    :url    => url,
    :method => :delete,
  )
end

#destroy_provider(id) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/destroy_provider.rb', line 3

def destroy_provider(id)
  request(
    :method => :delete,
    :path   => "/providers/#{id}",
  )
end

#destroy_server(id) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/destroy_server.rb', line 3

def destroy_server(id)
  request(
    :method => :delete,
    :path => "/servers/#{id}"
  )
end

#destroy_ssl_certificate(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_ssl_certificate.rb', line 3

def destroy_ssl_certificate(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :method => :delete,
    :path => "ssl_certificates/#{id}",
    :url  => url,
  )
end

#destroy_storage(id) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/destroy_storage.rb', line 3

def destroy_storage(id)
  request(
    :method => :delete,
    :path   => "/storages/#{id}",
  )
end

#destroy_storage_user(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/destroy_storage_user.rb', line 3

def destroy_storage_user(params={})
  id         = params.delete("id")

  request(
    :method => :delete,
    :path   => "/storage-users/#{id}",
  )
end

#destroy_user(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/destroy_user.rb', line 3

def destroy_user(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path   => "/users/#{id}",
    :url    => url,
    :method => :delete
  )
end

#detach_address(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/detach_address.rb', line 3

def detach_address(params={})
  id = params["id"]

  request(
    :method => :put,
    :path   => "addresses/#{id}/detach",
  )
end

#disable_feature(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/disable_feature.rb', line 3

def disable_feature(params={})
  feature_id = params["feature"]["id"]
   = params["account"]

  request(
    :method => :delete,
    :path   => "accounts/#{}/features/#{feature_id}",
  )
end

#discover_database_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/discover_database_server.rb', line 3

def discover_database_server(params={})
  id = params.delete("id")

  request(
    :method => :post,
    :path   => "/database-servers/#{id}/discover",
  )
end

#discover_database_server_snapshots(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/discover_database_server_snapshots.rb', line 3

def discover_database_server_snapshots(params={})
  url      = params.delete("url")
  provider = params.delete("provider")

  request(
    :method => :post,
    :url    => url,
    :params => params,
    :path   => "/providers/#{provider}/database-server-snapshots/discover",
  )
end

#discover_provider_location(url, location_id) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/discover_provider_location.rb', line 3

def discover_provider_location(url, location_id)
  id          = url.split("/")[-2]
  location_id = URI.escape(location_id)

  request(
    :method => :put,
    :path   => "/providers/#{id}/locations/#{location_id}/discover",
  )
end

#download_file(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/download_file.rb', line 3

def download_file(params={})
  url = params["url"]

  request(
    :method => :get,
    :url    => url,
  )
end

#enable_feature(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/enable_feature.rb', line 3

def enable_feature(params={})
   = params["account"]
  feature_id = params["feature"]["id"]

  request(
    :method => :post,
    :path   => "accounts/#{}/features/#{feature_id}"
  )
end

#get_account(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_account.rb', line 3

def (params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "accounts/#{id}",
    :url  => url,
  )
end

#get_account_cancellation(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/get_account_cancellation.rb', line 3

def (params={})
  url = params["url"]
  request(
    :url  => url,
  )
end

#get_account_referrals(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/get_account_referrals.rb', line 3

def (params={})
  request(
    :url => params.delete("url"),
    :path => "/account-referrals",
  )
end

#get_account_trial(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/get_account_trial.rb', line 3

def (params={})
  url = params["url"]
  request(
    :url => url,
  )
end

#get_accounts(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_accounts.rb', line 3

def get_accounts(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/accounts",
    :query  => query,
    :url    => url,
  )
end

#get_addon(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/get_addon.rb', line 3

def get_addon(params={})
  url   = params.delete("url") or raise "URL needed"
  request(
    :params => params,
    :url    => url,
  )
end

#get_addons(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/get_addons.rb', line 3

def get_addons(params={})
  url   = params.delete("url") or raise "URL needed"
  request(
    :params => params,
    :url    => url,
  )
end

#get_address(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_address.rb', line 3

def get_address(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "addresses/#{id}",
    :url  => url
  )
end

#get_addresses(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_addresses.rb', line 3

def get_addresses(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/addresses",
    :query  => query,
    :url    => url,
  )
end

#get_alert(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_alert.rb', line 3

def get_alert(params={})
  id = params["id"]
  url = params["url"]

  request(
    :path => "/alerts/#{id}",
    :url  => url,
  )
end

#get_alerting_environments(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_alerting_environments.rb', line 3

def get_alerting_environments(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/environments/alerting",
    :url    => url,
  )
end

#get_alerts(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_alerts.rb', line 3

def get_alerts(params={})
  url   = params.delete("url")
  query = Ey::Core.paging_parameters(params)

  request(
    :params => params,
    :query  => query,
    :path   => "/alerts",
    :url    => url,
  )
end

#get_api_token(username, password) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/get_api_token.rb', line 3

def get_api_token(username, password)
  request(
    :path   => "tokens",
    :method => :post,
    :body   => {email: username, password: password},
  )
end

#get_application(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_application.rb', line 3

def get_application(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "applications/#{id}",
    :url  => url
  )
end

#get_application_archive(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_application_archive.rb', line 3

def get_application_archive(params={})
  id  = params["id"]
  url = params.delete("url")

  request(
    :path => "/application-archives/#{id}",
    :url  => url
  )
end

#get_application_archives(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ey-core/requests/get_application_archives.rb', line 3

def get_application_archives(params={})
  query          = Ey::Core.paging_parameters(params)
  url            = params.delete("url")
  application_id = params["application"]

  request(
    :params => params,
    :path   => "/applications/#{application_id}/archives",
    :query  => query,
    :url    => url
  )
end

#get_application_deployment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_application_deployment.rb', line 3

def get_application_deployment(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "application-deployments/#{id}",
    :url  => url
  )
end

#get_application_deployments(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_application_deployments.rb', line 3

def get_application_deployments(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/application-deployments",
    :query  => query,
    :url    => url
  )
end

#get_applications(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_applications.rb', line 3

def get_applications(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/applications",
    :query  => query,
    :url    => url
  )
end

#get_backup_file(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_backup_file.rb', line 3

def get_backup_file(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "backup_files/#{id}",
    :url  => url,
  )
end

#get_backup_files(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_backup_files.rb', line 3

def get_backup_files(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/backup_files",
    :query  => query,
    :url    => url,
  )
end

#get_billing(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/get_billing.rb', line 3

def get_billing(params={})
  id  = params["id"]
  request(
    :path => "accounts/#{id}/billing",
  )
end

#get_blueprint(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_blueprint.rb', line 3

def get_blueprint(params={})
  id  = params.delete("id")
  url = params.delete("url")

  request(
    :path => "blueprints/#{id}",
    :url  => url,
  )
end

#get_blueprints(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_blueprints.rb', line 3

def get_blueprints(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :path   => "/blueprints",
    :params => params,
    :query  => query,
    :url    => url,
  )
end

#get_component(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_component.rb', line 3

def get_component(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/components/#{id}",
    :url  => url,
  )
end

#get_components(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_components.rb', line 3

def get_components(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/components",
    :url    => url,
  )
end

#get_contacts(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_contacts.rb', line 3

def get_contacts(params={})
  request(
    :params => params,
    :query  => Ey::Core.paging_parameters(params),
    :path   => "/contacts",
    :url    => params.delete("url"),
  )
end

#get_costs(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/get_costs.rb', line 3

def get_costs(params={})
  url = params.delete("url")
   = params.delete("id")

  request(
    url:   url,
    path:  "/accounts/#{}/costs",
    query: params
  )
end

#get_current_user(params = {}) ⇒ Object



3
4
5
6
7
# File 'lib/ey-core/requests/get_current_user.rb', line 3

def get_current_user(params={})
  request(
    :path => "/users/current",
  )
end

#get_database_plan_usages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_database_plan_usages.rb', line 3

def get_database_plan_usages(params={})
      = params["account_id"]
  billing_month = params.fetch("billing_month", Date.today.strftime("%Y-%m"))

  request(
    :path => "accounts/#{}/database-plan-usages/#{billing_month}"
  )
end

#get_database_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_database_server.rb', line 3

def get_database_server(params={})
  id = params["id"]
  url = params["url"]

  request(
    :path => "/database-servers/#{id}",
    :url  => url,
  )
end

#get_database_server_revisions(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/get_database_server_revisions.rb', line 3

def get_database_server_revisions(params={})
  database_server = params.delete("database_server")

  request(
    :body  => params,
    :query => Ey::Core.paging_parameters(params),
    :path  => "/database-servers/#{database_server}/revisions",
    :url   => params.delete("url"),
  )
end

#get_database_server_snapshot(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_database_server_snapshot.rb', line 3

def get_database_server_snapshot(params={})
  identity, url = require_argument(params, "id", "url")

  request(
    :path => identity && "/database-server-snapshots/#{identity}",
    :url  => url,
  )
end

#get_database_server_snapshots(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ey-core/requests/get_database_server_snapshots.rb', line 3

def get_database_server_snapshots(params={})
  database_server  = params.delete("database_server")
  database_service = params.delete("database_service")
  provider         = params.delete("provider")

  path = if database_server
           "/database-servers/#{database_server}/snapshots"
         elsif database_service
           "/database-services/#{database_service}/snapshots"
         elsif provider
           "/providers/#{provider}/database-server-snapshots"
         else
           "/database-server-snapshots"
         end

  request(
    :body  => params,
    :query => Ey::Core.paging_parameters(params),
    :path  => path,
    :url   => params.delete("url"),
  )
end

#get_database_server_usages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_database_server_usages.rb', line 3

def get_database_server_usages(params={})
      = params["account_id"]
  billing_month = params.fetch("billing_month", Date.today.strftime("%Y-%m"))

  request(
    :path => "accounts/#{}/database-server-usages/#{billing_month}"
  )
end

#get_database_servers(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_database_servers.rb', line 3

def get_database_servers(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/database-servers",
    :url    => url,
  )
end

#get_database_servers_firewalls(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ey-core/requests/get_database_servers_firewalls.rb', line 3

def get_database_servers_firewalls(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")
  id = params["database_server_id"]

  request(
    :params => params,
    :query  => query,
    :path   => "/database-servers/#{id}/firewalls",
    :url    => url,
  )
end

#get_database_service(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_database_service.rb', line 3

def get_database_service(params={})
  params["url"] || (id = require_parameters(params, "id"))

  request(
    :path => "/database-services/#{id}",
    :url  => params["url"],
  )
end

#get_database_services(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_database_services.rb', line 3

def get_database_services(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/database-services",
    :url    => url,
  )
end

#get_deployment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_deployment.rb', line 3

def get_deployment(params={})
  id  = params.delete("id")
  url = params.delete("url")

  request(
    :path => "deployments/#{id}",
    :url  => url,
  )
end

#get_deployments(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_deployments.rb', line 3

def get_deployments(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/deployments",
    :query  => params,
    :url    => url,
  )
end

#get_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_environment.rb', line 3

def get_environment(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "environments/#{id}",
    :url  => url,
  )
end

#get_environment_database_services(params = {}) ⇒ Object



4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_environment_database_services.rb', line 4

def get_environment_database_services(params={})
  params["url"] || (environment_id = require_parameters(params, "environment_id"))

  request(
    :path => "/environments/#{environment_id}/database-services",
    :url  => params["url"],
  )
end

#get_environment_logical_databases(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_environment_logical_databases.rb', line 3

def get_environment_logical_databases(params={})
  params["url"] || (environment_id = require_parameters(params, "environment_id"))

  request(
    :path => "/environments/#{environment_id}/logical-databases",
    :url  => params["url"],
  )
end

#get_environment_plan_usages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_environment_plan_usages.rb', line 3

def get_environment_plan_usages(params={})
      = params["account_id"]
  billing_month = params.fetch("billing_month", Date.today.strftime("%Y-%m"))

  request(
    :path => "accounts/#{}/environment-plan-usages/#{billing_month}"
  )
end

#get_environments(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_environments.rb', line 3

def get_environments(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/environments",
    :url    => url,
  )
end

#get_feature(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_feature.rb', line 3

def get_feature(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "features/#{id}",
    :url => url,
  )
end

#get_features(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_features.rb', line 3

def get_features(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/features",
    :url    => url,
  )
end

#get_firewall(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_firewall.rb', line 3

def get_firewall(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "firewalls/#{id}",
    :url  => url,
  )
end

#get_firewall_rule(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_firewall_rule.rb', line 3

def get_firewall_rule(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/firewall-rules/#{id}",
    :url  => url,
  )
end

#get_firewall_rules(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_firewall_rules.rb', line 3

def get_firewall_rules(params={})
  query       = Ey::Core.paging_parameters(params)
  url         = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/firewall-rules",
    :url    => url,
  )
end

#get_firewalls(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_firewalls.rb', line 3

def get_firewalls(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/firewalls",
    :url    => url,
  )
end

#get_gem(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/get_gem.rb', line 3

def get_gem(params={})
  id = params.delete("id")

  request(
    :path => "gems/#{id}",
  )
end

#get_keypair(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_keypair.rb', line 3

def get_keypair(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "keypairs/#{id}",
    :url  => url,
  )
end

#get_keypair_deployment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_keypair_deployment.rb', line 3

def get_keypair_deployment(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "keypair-deployments/#{id}",
    :url  => url,
  )
end

#get_keypair_deployments(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_keypair_deployments.rb', line 3

def get_keypair_deployments(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/keypair-deployments",
    :url    => url,
  )
end

#get_keypairs(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_keypairs.rb', line 3

def get_keypairs(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/keypairs",
    :url    => url,
  )
end

#get_legacy_alert(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_legacy_alert.rb', line 3

def get_legacy_alert(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/legacy-alerts/#{id}",
    :url  => url,
  )
end

#get_legacy_alerts(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_legacy_alerts.rb', line 3

def get_legacy_alerts(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/legacy-alerts",
    :url    => url,
  )
end

#get_load_balancer(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_load_balancer.rb', line 3

def get_load_balancer(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/load-balancers/#{id}",
    :url  => url,
  )
end

#get_load_balancer_nodes(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_load_balancer_node.rb', line 3

def get_load_balancer_nodes(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/load-balancer-nodes/#{id}",
    :url  => url,
  )
end

#get_load_balancer_service(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_load_balancer_service.rb', line 3

def get_load_balancer_service(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/load-balancer-services/#{id}",
    :url  => url,
  )
end

#get_load_balancer_services(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/ey-core/requests/get_load_balancer_services.rb', line 3

def get_load_balancer_services(params={})
  query            = Ey::Core.paging_parameters(params)
  load_balancer_id = params.delete("load_balancer_id")
  url              = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/load-balancers/#{load_balancer_id}/services",
    :url    => url,
  )
end

#get_load_balancers(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_load_balancers.rb', line 3

def get_load_balancers(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/load-balancers",
    :url    => url,
  )
end

#get_log(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_log.rb', line 3

def get_log(params={})
  id = params["id"]
  url = params["url"]

  request(
    :path => "logs/#{id}",
    :url => url
  )
end

#get_logical_database(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_logical_database.rb', line 3

def get_logical_database(params={})
  params["url"] || (id = require_parameters(params, "id"))

  request(
    :path => "/logical-databases/#{id}",
    :url  => params["url"],
  )
end

#get_logical_databases(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_logical_databases.rb', line 3

def get_logical_databases(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/logical-databases",
    :url    => url,
  )
end

#get_logs(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_logs.rb', line 3

def get_logs(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/logs",
    :url    => url
  )
end

#get_membership(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_membership.rb', line 3

def get_membership(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "memberships/#{id}",
    :url  => url,
  )
end

#get_memberships(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_memberships.rb', line 3

def get_memberships(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :url    => params.delete("url"),
    :path   => "/memberships",
    :params => params,
    :query  => query,
  )
end

#get_message(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_message.rb', line 3

def get_message(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "messages/#{id}",
    :url  => url
  )
end

#get_messages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/get_messages.rb', line 3

def get_messages(params={})
  query = Ey::Core.paging_parameters(params)
  require_parameters(params, "url")

  request(
    :params => params,
    :query  => query,
    :url    => params.delete("url"),
  )
end

#get_metadata(params = {}) ⇒ Object



3
4
5
# File 'lib/ey-core/requests/get_metadata.rb', line 3

def (params={})
  request(path: "metadata")
end

#get_operational_contact(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_operational_contact.rb', line 3

def get_operational_contact(params={})
  id = params["id"]
  url = params["url"]

  request(
    :path => "/contacts/#{id}",
    :url  => url,
  )
end

#get_operational_contacts(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_operational_contacts.rb', line 3

def get_operational_contacts(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/contacts",
    :url    => url,
  )
end

#get_plan_usages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_plan_usages.rb', line 3

def get_plan_usages(params={})
      = params["account_id"]
  billing_month = params.fetch("billing_month", Date.today.strftime("%Y-%m"))

  request(
    :path => "accounts/#{}/plan-usages/#{billing_month}"
  )
end

#get_possible_provider_locations(type) ⇒ Object



3
4
5
6
7
# File 'lib/ey-core/requests/get_possible_provider_locations.rb', line 3

def get_possible_provider_locations(type)
  request(
    :path => "/providers/#{type}/locations"
  )
end

#get_provider(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_provider.rb', line 3

def get_provider(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "providers/#{id}",
    :url  => url,
  )
end

#get_provider_location(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_provider_location.rb', line 3

def get_provider_location(params={})
  id  = params.delete("id")
  url = params.delete("url")

  request(
    :path => "/provider-locations/#{id}",
    :url  => url
  )
end

#get_provider_locations(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/get_provider_locations.rb', line 3

def get_provider_locations(params={})
  query       = Ey::Core.paging_parameters(params)
  url         = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :url    => url,
  )
end

#get_providers(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_providers.rb', line 3

def get_providers(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/providers",
    :url    => url,
  )
end

#get_request(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_request.rb', line 3

def get_request(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "requests/#{id}",
    :url  => url,
  )
end

#get_requests(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_requests.rb', line 3

def get_requests(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :path   => "/requests",
    :url    => url,
    :params => params,
    :query  => query,
  )
end

#get_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_server.rb', line 3

def get_server(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "servers/#{id}",
    :url  => url,
  )
end

#get_server_event(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_server_event.rb', line 3

def get_server_event(params={})
  url   = params.delete("url")
  id    = params.delete("id")

  request(
    :path => "/server-events/#{id}",
    :url  => url,
  )
end

#get_server_events(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_server_events.rb', line 3

def get_server_events(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/server-events",
    :url    => url,
  )
end

#get_server_usages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_server_usages.rb', line 3

def get_server_usages(params={})
      = params["account_id"]
  billing_month = params.fetch("billing_month", Date.today.strftime("%Y-%m"))

  request(
    :path => "accounts/#{}/server-usages/#{billing_month}"
  )
end

#get_servers(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_servers.rb', line 3

def get_servers(params={})
  request(
    :params => params,
    :query  => Ey::Core.paging_parameters(params),
    :path   => "/servers",
    :url    => params.delete("url"),
  )
end

#get_ssl_certificate(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_ssl_certificate.rb', line 3

def get_ssl_certificate(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "ssl_certificates/#{id}",
    :url  => url,
  )
end

#get_ssl_certificates(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_ssl_certificates.rb', line 3

def get_ssl_certificates(params={})
  query = Ey::Core.paging_parameters(params)
  url = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/ssl_certificates",
    :url    => url,
  )
end

#get_storage(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_storage.rb', line 3

def get_storage(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/storages/#{id}",
    :url  => url,
  )
end

#get_storage_user(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_storage_user.rb', line 3

def get_storage_user(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/storage-users/#{id}",
    :url  => url,
  )
end

#get_storage_users(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_storage_users.rb', line 3

def get_storage_users(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query => query,
    :path  => "/storage-users",
    :url   => url,
  )
end

#get_storages(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_storages.rb', line 3

def get_storages(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query => query,
    :path  => "/storages",
    :url   => url,
  )
end

#get_support_trial(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/get_support_trial.rb', line 3

def get_support_trial(params={})
  url = params["url"]
  request(
    :url => url,
  )
end

#get_task(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_task.rb', line 3

def get_task(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "/tasks/#{id}",
    :url  => url,
  )
end

#get_tasks(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_tasks.rb', line 3

def get_tasks(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query => query,
    :path  => "/tasks",
    :url   => url,
  )
end

#get_token(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_token.rb', line 3

def get_token(options={})
  id  = options.delete("id")
  url = options.delete("url")

  request(
    :path => "tokens/#{id}",
    :url  => url,
  )
end

#get_token_by_login(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_token_by_login.rb', line 3

def (params={})
  url = params.delete("url")

  request(
    :authenticated => false,
    :body          => params,
    :method        => :post,
    :path          => "/tokens",
    :url           => url,
  )
end

#get_tokens(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_tokens.rb', line 3

def get_tokens(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :query  => query,
    :path   => "/tokens",
    :url    => url,
  )
end

#get_untracked_server(params = {}) ⇒ Object



3
4
5
6
7
8
# File 'lib/ey-core/requests/get_untracked_server.rb', line 3

def get_untracked_server(params={})
  request(
    :path => "/untracked-servers/#{params.fetch("id")}",
    :url  => params.delete("url"),
  )
end

#get_untracked_servers(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/get_untracked_servers.rb', line 3

def get_untracked_servers(params={})
  request(
    :params => params,
    :query  => Ey::Core.paging_parameters(params),
    :path   => "/untracked-servers",
    :url    => params.delete("url"),
  )
end

#get_user(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_user.rb', line 3

def get_user(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "users/#{id}",
    :url  => url,
  )
end

#get_users(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_users.rb', line 3

def get_users(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params.delete("url")

  request(
    :params => params,
    :path   => "/users",
    :query  => query,
    :url    => url,
  )
end

#get_volume(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/get_volume.rb', line 3

def get_volume(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :path => "volumes/#{id}",
    :url  => url
  )
end

#get_volumes(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/get_volumes.rb', line 3

def get_volumes(params={})
  query = Ey::Core.paging_parameters(params)
  url   = params["url"]

  request(
    :params => params,
    :query  => query,
    :path   => "/volumes",
    :url    => url,
  )
end

#reboot_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/ey-core/requests/reboot_server.rb', line 3

def reboot_server(params={})
  id  = params["id"]
  url = params["url"]

  request(
    :method => :post,
    :path   => "servers/#{id}/reboot",
    :url    => url,
  )
end

#request(options = {}) ⇒ Object



44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
# File 'lib/ey-core/client/real.rb', line 44

def request(options={})
  method  = options[:method]             || :get
  url     = options[:url]                || File.join(@url, options[:path] || "/")
  #@todo query is a band-aid
  query   = options[:query]              || {}
  params  = query.merge(options[:params] || {})
  body    = options[:body]
  headers = options[:headers]            || {}

  default_content_type = if !body && !params.empty?
                           "application/x-www-form-urlencoded"
                         else
                           "application/json"
                         end
  headers = {
    "Content-Type" => default_content_type,
    "Accept"       => accept_type,
  }.merge(headers)

  response = @connection.send(method) do |req|
    req.url(url)
    req.headers.merge!(headers)
    req.params.merge!(params)
    req.body = body
  end

  Ey::Core::Response.new(
    :status  => response.status,
    :headers => response.headers,
    :body    => response.body,
    :request => {
      :method  => method,
      :url     => url,
      :headers => headers,
      :body    => body,
      :params  => params,
    }
  ).raise!
end

#request_callback(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/request_callback.rb', line 3

def request_callback(options={})
  (url = options["url"]) || (id = options.fetch("id"))

  request(
    :path   => "/requests/#{id}/callback",
    :method => :post,
    :url    => url,
  )
end

#reset!Object



88
89
90
91
92
# File 'lib/ey-core/client/real.rb', line 88

def reset!
  request(method: :post, path: "/client/reset")
rescue Ey::Core::Response::NotFound # allow me to test against something real where this route doesn't exist
  nil
end

#reset_password(_params) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/ey-core/requests/reset_password.rb', line 3

def reset_password(_params)
  params = Cistern::Hash.stringify_keys(_params)

  request(
    :method => :put,
    :path   => "/password-resets/#{params["reset_token"]}",
    :body   => {
      :password_reset => {
        :password => params["password"]
      }
    },
  )
end

#restart_environment_app_servers(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/restart_environment_app_servers.rb', line 3

def restart_environment_app_servers(params={})
  id = params.delete("id")
  url = params.delete("url")

  request(
    :body   => params,
    :method => :put,
    :path   => "environments/#{id}/app_restart",
    :url    => url,
  )
end

#run_cluster_application_action(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/run_cluster_application_action.rb', line 3

def run_cluster_application_action(params={})
  cluster_id     = params.delete("cluster")
  application_id = params.delete("application")
  action         = params.delete("action")

  request(
    :body   => params,
    :method => :post,
    :path   => "/clusters/#{cluster_id}/applications/#{application_id}/actions/#{action}",
  )
end

#run_environment_application_action(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/run_environment_application_action.rb', line 3

def run_environment_application_action(params={})
  environment_id = params.delete("environment")
  application_id = params.delete("application")
  action         = params.delete("action")

  request(
    :body   => params,
    :method => :post,
    :path   => "/environments/#{environment_id}/applications/#{application_id}/actions/#{action}"
  )
end

#signup(_params) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/signup.rb', line 3

def (_params)
  params = Cistern::Hash.stringify_keys(_params)

  request(
    :method => :post,
    :path   => "/signups",
    :body   => params,
  )
end

#timeout_deployment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/timeout_deployment.rb', line 3

def timeout_deployment(params={})
  id  = params.delete("id")
  url = params.delete("url")

  request(
    :body   => params,
    :method => :put,
    :path   => "deployments/#{id}/timeout",
    :url    => url,
  )
end

#update_addon(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/update_addon.rb', line 3

def update_addon(params={})
  url = params.delete("url") or raise "URL needed"
  request(
    :method => :put,
    :url    => url,
    :params => params,
  )
end

#update_address(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/update_address.rb', line 3

def update_address(params={})
  id = params["id"]

  request(
    :method => :put,
    :path   => "addresses/#{id}",
    :body   => {"address" => params.fetch("address")}
  )
end

#update_alert(_params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/ey-core/requests/update_alert.rb', line 3

def update_alert(_params={})
  params = Cistern::Hash.stringify_keys(_params)
  id = params.delete("id")
  body = { alert: params["alert"] }

  request(
    :method => :put,
    :path   => "/alerts/#{id}",
    :body   => body,
  )
end

#update_application_archive(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/update_application_archive.rb', line 3

def update_application_archive(params={})
  id             = params.delete("id")
  application_id = params["application"]
  request(
    :method => :put,
    :path   => "/applications/#{application_id}/archives/#{id}",
    :body   => params,
  )
end

#update_billing(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/update_billing.rb', line 3

def update_billing(params={})
  id = params.delete("id") or raise "ID needed"
  request(
    :method => :put,
    :path   => "/accounts/#{id}/billing",
    :params => params,
  )
end

#update_blueprint(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/update_blueprint.rb', line 3

def update_blueprint(params={})
  id = params.delete("id")

  request(
    :path   => "blueprints/#{id}",
    :body   => params,
    :method => :put
  )
end

#update_connector(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/update_connector.rb', line 3

def update_connector(params={})
  request(
    :method => :put,
    :path   => "/connectors/#{params["id"]}",
    :body   => params,
  )
end

#update_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/update_environment.rb', line 3

def update_environment(params={})
  request(
    :method => :put,
    :path   => "/environments/#{params.fetch("id")}",
    :body   => {"environment" => params.fetch("environment")},
  )
end

#update_membership(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
# File 'lib/ey-core/requests/update_membership.rb', line 3

def update_membership(params={})
  id = params.delete("id")
  request(
    :method => :put,
    :path   => "/memberships/#{id}",
    :body   => params,
  )
end

#update_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/update_server.rb', line 3

def update_server(params={})
  request(
    :method => :put,
    :path   => "/servers/#{params.fetch("id")}",
    :body   => {"server" => params.fetch("server")},
  )
end

#update_ssl_certificate(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
# File 'lib/ey-core/requests/update_ssl_certificate.rb', line 3

def update_ssl_certificate(params={})
  id = params.delete("id")

  request(
    :method => :put,
    :path   => "/ssl_certificates/#{id}",
    :body   => params,
  )
end

#update_untracked_server(params = {}) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/ey-core/requests/update_untracked_server.rb', line 3

def update_untracked_server(params={})
  request(
    :method => :put,
    :path   => "/untracked-servers/#{params.delete("id")}",
    :body   => params,
  )
end

#upload_file(_params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/ey-core/requests/upload_file.rb', line 3

def upload_file(_params={})
  params = Cistern::Hash.stringify_keys(_params)

  mime_type  = params["mime_type"]
  upload_url = params["upload_url"]

  if string = params["body"]
    request(
      :method  => :put,
      :headers => {"Content-Type" => mime_type},
      :url     => upload_url,
      :body    => string,
    )
  else
    request(
      :method  => :put,
      :headers => {"Content-Type" => "multipart/form-data"},
      :url     => upload_url,
      :body    => Faraday::UploadIO.new(params.fetch("file"), mime_type),
    )
  end
end

#upload_recipes_for_environment(params = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/ey-core/requests/upload_recipes_for_environment.rb', line 3

def upload_recipes_for_environment(params={})
  file = params.delete("file")
  id   = params.delete("id")
  url  = params.delete("url")


  request(
    :body    => {"file" => Faraday::UploadIO.new(file, "application/x-gzip")},
    :headers => {"Content-Type" => "multipart/form-data" },
    :method  => :post,
    :path    => "environments/#{id}/recipes",
    :url     => url,
  )
end