Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 

README.md

openshift-api-swagger

Visualization of the OpenShift V3 Rest API using Swagger

Overview

This application provides an interface to the OpenShift V3 Rest API. It can be run either on a local machine, deployed to an Application server or within Docker.

The Swagger UI communicates to OpenShift via REST.

Authentication

The base endpoints and a selection of method invocations do not require any form of authentication. However, to take advantage of invoking additional methods, an authentication token for a user associated within OpenShift needs to be retrieved and configured in the Swagger UI

Retrieving an Authentication Token

The OpenShift CLI can be used to obtain an authentication token that can used in the Swagger UI. If you do not have the CLI installed, go here to download the client for your particular platform

First, make sure your user is logged in

oc login <server>

Once your user has been logged in, you can obtain the authentication token from this session

oc whoami -t

This will print out the authentication token which you can input into the Swagger UI in a subsequent step.

Running

The easiest way to get started is to clone this repository to your local machine and launching the index.html page

At the top of the page, you are presented with two input fields:

  • OpenShift Master URL - HTTP endpoint for OpenShift Master. For example https://master.ose.example.com
  • OAuth Token - Enter the value of the token for the authenticated user obtained in the previous step

Hit the Explore to begin traversing the API. Consult the Swagger Documentationon how to use the Swagger UI.

If the Swagger spec fails to load, you may need to configure OpenShift to support cross-origin requests. Additional steps are found in the OpenShift documentation.

Deployment to OpenShift

A template is available for a streamlined deployment to OpenShift. Use the following steps to deploy the application:

Login to a cluster and create a new project:

oc new-project <project-name>

Instantiate the openshift-api-swagger template:

oc apply -f openshift-api-swagger-template.yml | oc apply -f-

Navigate to host specified in the route that has been created:

oc get routes openshift-api-swagger

About

Swagger UI for the OpenShift API

Resources

Releases

No releases published

Packages

No packages published

Languages

You can’t perform that action at this time.