cloud-gov / cf-service-connect

Cloud Foundry CLI Service Connection Plugin
Other
18 stars 6 forks source link

add support for Elasticsearch #49

Open afeld opened 6 years ago

afeld commented 6 years ago

Closes #10. Builds on #45 - diff.

Terminal 1:

$ cf services
Getting services in org sandbox-gsa / space aidan.feldman as aidan.feldman@gsa.gov...
OK

name           service           plan           bound apps   last operation
es             elasticsearch24   1x                          create succeeded
$ cf connect-to-service myapp es
Finding the service instance details...
Setting up SSH tunnel...
SSH tunnel created.
Falling back to `-no-client` behavior.
Skipping call to client CLI. Connection information:

Host: localhost
Port: 57895
Username: myuser
Password: mypass
Name:

Connection URI (note this may vary slightly by client):

    http://myuser:mypass@localhost:57895

Leave this terminal open while you want to use the SSH tunnel. Press Control-C to stop.

Terminal 2:

$ curl http://myuser:mypass@localhost:57895
{
  "name" : "Man Mountain Marko",
  "cluster_name" : "XXXXX",
  "cluster_uuid" : "XXXXXXXXXXXXXXX",
  "version" : {
    "number" : "2.4.1",
    "build_hash" : "c67dc32e24162035d18d6fe1e952c4cbcbe79d16",
    "build_timestamp" : "2016-09-27T18:57:55Z",
    "build_snapshot" : false,
    "lucene_version" : "5.5.2"
  },
  "tagline" : "You Know, for Search"
}

/cc @yozlet

yozlet commented 6 years ago

Would be good to add the example in your comment to the docs.

yozlet commented 6 years ago

... or, at least, something in the doc that says that Elasticsearch falls back to -no-client behaviour, and sets up a tunnel through which one can use an HTTP client such as curl.