class Ey::Core::Client::Account

Attributes

name_prefix[RW]
plan[RW]

Public Instance Methods

cancel!(params = {}) click to toggle source
# File lib/ey-core/models/account.rb, line 43
def cancel!(params = {})
  result = self.connection.cancel_account(self.id, params[:requested_by].id).body
  Ey::Core::Client::AccountCancellation.new(result["cancellation"])
end
retrieve_docker_registry_credentials(location_id) click to toggle source

Get authorization data for an Amazon ECR registry. @param [String] location_id Aws region @return [Hashie::Mash]

# File lib/ey-core/models/account.rb, line 76
def retrieve_docker_registry_credentials(location_id)
  result = self.connection.retrieve_docker_registry_credentials(self.id, location_id).body
  ::Hashie::Mash.new(result['docker_registry_credentials'])
end
save!() click to toggle source
# File lib/ey-core/models/account.rb, line 48
def save!
  requires_one :name, :name_prefix

  params = {
    "account" => {
      "plan" => self.plan || "standard-20140130",
    },
    "owner" => self.owner_id,
  }

  if self.name
    params["account"]["name"] = self.name
  elsif self.name_prefix
    params["account"]["name_prefix"] = self.name_prefix
  end

  params["account"]["signup_via"] = self.signup_via if self.signup_via
  params["account"]["type"]       = self.type       if self.type

  if new_record?
    merge_attributes(self.connection.create_account(params).body["account"])
  else raise NotImplementedError # update
  end
end