cloudfoundry/routing-api-cli

Name: routing-api-cli

Owner: Cloud Foundry

Description: null

Created: 2015-04-07 21:51:01.0

Updated: 2018-01-02 22:05:55.0

Pushed: 2018-04-05 17:36:24.0

Homepage: null

Size: 1123

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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.

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
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
list [args]
Register Route(s)
register [args] [routes]
Unregister Route(s)
unregister [args] [routes]
Subscribe to Events
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.

rt RTR_TRACE=true
list [args]

Notes:

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

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}]'

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"}]'

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.