Skip to content

Commit

Permalink
Merge pull request #102 from engineyard/fix/EYPP156-VPC-EIP
Browse files Browse the repository at this point in the history
Fix: EYPP-1156: add support for address.scope parameter for EIP
  • Loading branch information
ddiachkov authored Apr 4, 2018
2 parents cae9234 + 36f0a15 commit 8fc75b1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/ey-core/models/address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ class Ey::Core::Client::Address < Ey::Core::Model
attribute :ip_address
attribute :provisioned_id
attribute :location
attribute :scope
attribute :disappeared_at, type: :time

has_one :provider
Expand Down Expand Up @@ -37,6 +38,7 @@ def save!
"provider" => self.provider_id,
"address" => {
"location" => self.location,
"scope" => self.scope,
},
}

Expand Down
1 change: 1 addition & 0 deletions lib/ey-core/requests/create_address.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ def create_address(params={})
request_id = self.uuid
resource_id = self.serial_id
provider_id = params["provider"]
scope = params["scope"] || "standard"

self.find(:providers, provider_id)

Expand Down
2 changes: 1 addition & 1 deletion lib/ey-core/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module Ey
module Core
VERSION = "3.4.4"
VERSION = "3.4.5"
end
end
3 changes: 2 additions & 1 deletion spec/addresses_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@
let!(:provider) { create_provider(account: account) }

it "creates an address" do
request = client.addresses.create!(provider: provider, location: "us-west-2")
request = client.addresses.create!(provider: provider, location: "us-west-2", scope: "vpc")
address = request.resource!
expect(address.id).not_to be_nil
expect(address.ip_address).not_to be_nil
expect(address.provisioned_id).not_to be_nil
expect(address.provider).to eq(provider)
expect(address.scope).to eq("vpc")
end

context "with an address" do
Expand Down

0 comments on commit 8fc75b1

Please sign in to comment.