GithubHelp home page GithubHelp logo

routing-api-cli's Introduction

Build Status

Routing API CLI

The Routing API CLI lets you list, register, and unregister routes with the Cloud Foundry Routing API.

Note: This repository should be imported as code.cloudfoundry.org/routing-api-cli.

Note: This repository was built as an internal tool and is not actively maintained. Your mileage may vary.

Dependencies

The Routing API uses OAuth tokens to authenticate clients. To obtain a token from UAA an OAuth client must first be created for the API client in UAA. For instructions on registering OAuth clients, see Routing API Server Configuration.

Installation

Download Binaries

Download the binary at Releases. Move the binary to a directory in your $PATH. Run rtr -v to confirm that the Routing API CLI is working properly.

Compile

  • Go should be installed and in the PATH

  • Checkout code and set GOPATH based on routing-release

  • Build the binary, and place it in your gopath:

    cd $GOPATH/src/code.cloudfoundry.org/routing-api-cli
    go build -o $GOPATH/bin/rtr

Usage

Each command has required arguments and route structure.

Required arguments:

--api: the routing API endpoint, e.g. http://api.10.244.0.34.xip.io
--client-id: the id of the client registered with your OAuth provider with the proper authorities, e.g. routing_api_client
--client-secret: your OAuth client secret, e.g. route_secret
--oauth-url: the OAuth provider endpoint with optional port, e.g. http://uaa.10.244.0.34.xip.io

Optional arguments: --skip-tls-verification: Skip TLS verification when talking to UAA and Routing API.

Routes are described as JSON: '[{"route":"foo.com","port":65340,"ip":"1.2.3.4","ttl":60, "route_service_url":"https://route-service.example.cf-app.com"}]'

List Routes

rtr list [args]

Register Route(s)

rtr register [args] [routes]

Unregister Route(s)

rtr unregister [args] [routes]

Subscribe to Events

rtr events [args]

Tracing Requests and Responses

By specifying the environment variable RTR_TRACE=true, rtr will output the HTTP requests and responses that it makes and receives.

export RTR_TRACE=true
rtr list [args]

Notes:

  • Route "ttl" definition is ignored for unregister.
  • CLI will appear successful when unregistering routes that do not exist.
  • The route_service_url is an optional value, and must be a HTTPS url.

###Examples

rtr list --api https://api.example.com --client-id admin --client-secret admin-secret --oauth-url https://uaa.example.com

rtr register --api https://api.example.com --client-id admin --client-secret admin-secret --oauth-url https://uaa.example.com '[{"route":"mynewroute.com","port":12345,"ip":"1.2.3.4","ttl":60}]'

rtr unregister --api https://api.example.com --client-id admin --client-secret admin-secret --oauth-url https://uaa.example.com '[{"route":"undesiredroute.com","port":12345,"ip":"1.2.3.4"}]'

routing-api-cli's People

Contributors

crhino avatar utako avatar leochu avatar flawedmatrix avatar markstgodard avatar zaksoup avatar atulkc avatar dpb587 avatar shalako avatar mdelillo avatar christianang avatar fordaz avatar jpalermo avatar msmykowski avatar tylerschultz avatar yuzhangcmu avatar abbyachau 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.