hula 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6fee1e28cab3a4e660f276a9f00438eae658c7db
4
- data.tar.gz: 43bb95a4e06de67de6496abbbd5a1453b57626cd
3
+ metadata.gz: 0b4c38be76de983b5aaac31968971f1adab49693
4
+ data.tar.gz: 4d2e150bf75735b6ad6acf12d8a2da6f59806db7
5
5
  SHA512:
6
- metadata.gz: db1ea04312e050770d2cc0404225afcf196155aab82954b368bc80dc80c4fd32b75e1978e5ff6a33318aef16ac4df690385ae565044f9f26057b8a6068f4c293
7
- data.tar.gz: 525b83c7c3787536f1ccfb053ac51fd91f67015205e44b703f4fc577a19518bc9507816c14163c08d8e3ef77bc0753c3b2c462d7fc626ba3770d7429495d82cc
6
+ metadata.gz: c2da7c1a0d091c6a03c06e3fff8f3c6424e21b71bd37eab7b367bf6ecacce0cd91445ffce55509410b1458d4522fb91926fc8a52c9059e855e70631a71010b17
7
+ data.tar.gz: 31421bf4cf6bf5ba0b56321a0335111e1096855043c26f6746fb5d177bdfb09fc634de85f5ae816ff8e40fb2656dd27fdecda380d3297eedf0757fc868c15a20
@@ -52,10 +52,12 @@ module Hula
52
52
  http_deprovision_service(service_instance_id: service_instance.id, plan_id: plan.id, service_id: plan.service_id)
53
53
  end
54
54
 
55
- def bind_instance(service_instance, binding_id: SecureRandom.uuid)
55
+ def bind_instance(service_instance, plan, binding_id: SecureRandom.uuid)
56
56
  result = http_bind_instance(
57
57
  service_instance_id: service_instance.id,
58
- binding_id: binding_id
58
+ binding_id: binding_id,
59
+ service_id: plan.service_id,
60
+ plan_id: plan.id
59
61
  )
60
62
 
61
63
  InstanceBinding.new(
@@ -105,10 +107,13 @@ module Hula
105
107
  )
106
108
  end
107
109
 
108
- def http_bind_instance(service_instance_id:, binding_id:)
110
+ def http_bind_instance(service_instance_id:, binding_id:, service_id:, plan_id:)
109
111
  http_client.put(
110
112
  url_for("/v2/service_instances/#{service_instance_id}/service_bindings/#{binding_id}"),
111
- body: {},
113
+ body: {
114
+ service_id: service_id,
115
+ plan_id: plan_id,
116
+ },
112
117
  auth: { username: username, password: password },
113
118
  headers: { 'X-Broker-Api-Version': @broker_api_version }
114
119
  )
@@ -32,8 +32,10 @@ module Hula
32
32
 
33
33
  def provision_and_bind(service_name, plan_name, &block)
34
34
  raise Error, 'no block given' unless block_given?
35
+ plan = catalog.service_plan(service_name, plan_name)
36
+
35
37
  provision_instance(service_name, plan_name) do |service_instance|
36
- bind_instance(service_instance, &block)
38
+ bind_instance(service_instance, plan, &block)
37
39
  end
38
40
  end
39
41
 
@@ -49,8 +51,8 @@ module Hula
49
51
  end
50
52
  end
51
53
 
52
- def bind_instance(service_instance, &block)
53
- binding = api.bind_instance(service_instance)
54
+ def bind_instance(service_instance, plan, &block)
55
+ binding = api.bind_instance(service_instance, plan)
54
56
  return binding unless block
55
57
 
56
58
  begin
data/lib/hula/version.rb CHANGED
@@ -9,5 +9,5 @@
9
9
  #
10
10
 
11
11
  module Hula
12
- VERSION = '0.13.0'
12
+ VERSION = '0.14.0'
13
13
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hula
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Will Pragnell
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-26 00:00:00.000000000 Z
11
+ date: 2018-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler