fabric-service-broker

module
v0.0.0-...-5cf5000 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 24, 2017 License: Apache-2.0

README

Fabric service broker

This repo is for service broker used to provision/deprovision hyperledger fabric block chain.

Running service broker

  1. Install and start Bosh lite

  2. Build and upload fabric bosh release

  3. Update the cloud config on bosh director as described here

  4. Fetch the repo

    go get github.com/predix/fabric-service-broker
    

    This will fetch the source under $GOPATH/src directory.

  5. Execute following command to run the service broker

    cd $GOPATH/src/github.com/predix/fabric-service-broker
    go run cmd/fabric-broker/main.go --boshStemcellName bosh-warden-boshlite-ubuntu-trusty-go_agent --boshDirectorUuid $(bosh status --uuid) --boshVmType small --boshNetworks "peer, peer1,peer2, peer3" --peerDataDir "/var/vcap/data/hyperledger/production" --dockerDataDir "/var/vcap/data/docker"
    

Testing service broker

Once service broker is up and running as described above execute following curl commands to test it out

Provision
curl -v localhost:8999/v2/service_instances/2A98FB4C-B774-45BD-9D5B-7C427933F812?accepts_incomplete=true -X PUT -H "Content-Type: application/json" -d '{
	"organization_guid": "org-guid",
    "plan_id":           "15175506-D9F6-4CD8-AA1E-8F0AAFB99C07",
    "service_id":        "05FC7A18-5B52-4701-A475-5995B79DF2AD",
    "space_guid":        "space-guid"
}'
Last operation
curl  localhost:8999/v2/service_instances/2A98FB4C-B774-45BD-9D5B-7C427933F812/last_operation?operation=<task id>

<task id> is value of operation in response from provision operation.

Bind
curl -v  localhost:8999/v2/service_instances/2A98FB4C-B774-45BD-9D5B-7C427933F812/service_bindings/37E1D618-8EBC-4258-99D8-971E67CAAA64 -X PUT -H "Content-Type: application/json" -d '
{
	"plan_id":      "15175506-D9F6-4CD8-AA1E-8F0AAFB99C07",
    "service_id":   "05FC7A18-5B52-4701-A475-5995B79DF2AD",
    "app_guid":     "app-guid"
}'
Unbind
curl -v  localhost:8999/v2/service_instances/2A98FB4C-B774-45BD-9D5B-7C427933F812/service_bindings/37E1D618-8EBC-4258-99D8-971E67CAAA64 -X DELETE
Deprovision
curl -v localhost:8999/v2/service_instances/2A98FB4C-B774-45BD-9D5B-7C427933F812?accepts_incomplete=true -X DELETE

Directories

Path Synopsis
Godeps
_workspace/src/github.com/cloudfoundry-community/go-cfenv
Package cfenv provides information about the current app deployed on Cloud Foundry, including any bound service(s).
Package cfenv provides information about the current app deployed on Cloud Foundry, including any bound service(s).
_workspace/src/github.com/gorilla/context
Package context stores values shared during a request lifetime.
Package context stores values shared during a request lifetime.
_workspace/src/github.com/gorilla/mux
Package mux implements a request router and dispatcher.
Package mux implements a request router and dispatcher.
_workspace/src/github.com/jinzhu/inflection
Package inflection pluralizes and singularizes English nouns.
Package inflection pluralizes and singularizes English nouns.
_workspace/src/github.com/lib/pq
Package pq is a pure Go Postgres driver for the database/sql package.
Package pq is a pure Go Postgres driver for the database/sql package.
_workspace/src/github.com/lib/pq/listen_example
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
Below you will find a self-contained Go program which uses the LISTEN / NOTIFY mechanism to avoid polling the database while waiting for more work to arrive.
_workspace/src/github.com/lib/pq/oid
Package oid contains OID constants as defined by the Postgres server.
Package oid contains OID constants as defined by the Postgres server.
_workspace/src/github.com/mitchellh/mapstructure
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
The mapstructure package exposes functionality to convert an abitrary map[string]interface{} into a native Go structure.
_workspace/src/github.com/op/go-logging
Package logging implements a logging infrastructure for Go.
Package logging implements a logging infrastructure for Go.
_workspace/src/gopkg.in/go-playground/assert.v1
Package assert provides some basic assertion functions for testing and also provides the building blocks for creating your own more complex validations.
Package assert provides some basic assertion functions for testing and also provides the building blocks for creating your own more complex validations.
_workspace/src/gopkg.in/yaml.v2
Package yaml implements YAML support for the Go language.
Package yaml implements YAML support for the Go language.
cmd
db

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL