Giter VIP home page Giter VIP logo

cf-java-client's Introduction

Java Cloud Foundry Client Sample

This is a small Java sample application showing how to use the Cloud Foundry client library to connect to and interact with a Cloud Foundry instance.

To build the program, follow these steps:

$ git clone https://github.com/scottfrederick/cf-java-client
$ cd cf-java-client
$ ./gradlew assemble

The program can be run a few different ways.

Authenticating with username and password

You can authenticate to Cloud Foundry with a username and password by passing those as parameters along with the target when the program is launched:

$ java -jar build/libs/cf-java-client-1.0.jar -t https://api.run.pivotal.io -s development -u <username> -p <password>

Authenticating with OAuth tokens

You can authenticate to Cloud Foundry with a pair of OAuth tokens granted via an OAuth registration process. If you have an OAuth access token and refresh token and a client ID attached to the tokens, you can pass these as parameters to the program:

$ java -jar build/libs/cf-java-client-1.0.jar -t https://api.run.pivotal.io -s development -c <client ID> -a <access token> -r <refresh token>

Authenticating with saved tokens

You can run the program using tokens saved by the cf command line tool instead of providing a username and password. To do this, you need to target and log into a Cloud Foundry service using cf. See the Getting Started guide for Pivotal's Cloud Foundry instance for further information. Using cf to target and log in will save account credentials in a file ~/.cf/tokens.yml.

After targeting and logging in with cf, you can run the program and target a specific Cloud Foundry service using tokens from ~/.cf/tokens.yml:

$ java -jar build/libs/cf-java-client-1.0.jar -t https://api.run.pivotal.io -s development

cf-java-client's People

Contributors

scottfrederick avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.