Skip to content

How to Make a Shareable Service Instance

Eric Promislow edited this page Feb 7, 2018 · 6 revisions

Setup

  1. Create org org, spaces space1 and space2
  2. Log in as admin on space space1
  3. cf enable-feature-flag service_instance_sharing
  4. In cats/assets/service_broker, modify the data.json file as follows:
"requires": [
  "route_forwarding" <----- REMOVE
],
...
"metadata": {
"shareable": true    <----- ADD
}

Deploy Broker and Create Service

  1. z cf-acceptance-tests && cd assets/service_broker
  2. ruby setup_new_broker.rb async-broker TARGET.capi.land
  3. cf marketplace to get service name FSNAME
  4. cf cs FSNAME fake-plan fs1

Verify Unshared Behavior

  1. cf create-user joe joe
  2. cf set-space-role joe org space2 SpaceDeveloper
  3. cf auth joe joe
  4. cf target -o org -s space2
  5. cf service fs1 should not find service fs1

Share the Service Instance

  1. cf auth admin ADMINPASSWORD # or target_cf
  2. cf target -o org -s space1
  3. service="$(cf service fs1 --guid)"
  4. space2="$(cf space space2 --guid)"
  5. cf curl -X POST /v3/service_instances/$service/relationships/shared_spaces -d '{"data": [ { "guid": "'$space2'" } ] }'

Verify Shared Behavior

  1. cf auth joe joe
  2. cf target -o org -s space2
  3. cf service fs1 should give details on service fs1

Unshare a Service Instance

  1. cf curl -X DELETE /v3/service_instances/$service/relationships/shared_spaces/$(cf space TARGET_SPACE --guid)
Clone this wiki locally