Book Image

OpenShift Cookbook

By : Shekhar Gulati
Book Image

OpenShift Cookbook

By: Shekhar Gulati

Overview of this book

Table of Contents (19 chapters)
OpenShift Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Running OpenShift on a Virtual Machine
Index

Viewing the account details using rhc


In this recipe, you will learn how to view your account details using rhc.

Getting ready

To complete this recipe, you will need to have rhc installed on your machine. Refer to the Installing the OpenShift rhc command-line client recipe for instructions.

How to do it…

To view the account details, run the rhc account command as follows:

$ rhc account

This is all you need to do to view the account details.

How it works…

The rhc account command shows details about the currently logged-in user. When you run the command, it makes a REST call to the OpenShift REST API using the authentication token generated during rhc setup. The REST API returns a JSON response, which rhc will render in a human-readable format:

$ rhc account
Login [email protected] on openshift.redhat.com
----------------------------------------------------------
  ID:                 52b8112ae0b8cdc308000018
  Plan:               Free
  Gears Used:         0
  Gears Allowed:      3
  Domains Allowed:    1
  Allowed Gear Sizes: small
  SSL Certificates:   no

The account details include whom you are logged in as, which OpenShift server you are connected to, your OpenShift user ID, the OpenShift plan you are using, the number of gears as well as the gear size used and allowed, the number of domains allowed, and whether you can use SSL certificates or not.

You can also view the account details in the web console by navigating to the account web page at https://openshift.redhat.com/app/account.

There's more…

You can also view details of any of your other OpenShift accounts by passing the -l or --rhlogin option. The -l or --rhlogin option is a global option available with every command. When you use -l or --rhlogin, you force the rhc client to use the user-specified login:

$ rhc account --rhlogin [email protected]

You can log out from your current session on the server by using the rhc account-logout command. This ends the user's current session and deletes the authorization token files in the .openshift folder at ~/.openshift:

$ rhc account-logout

You can also use rhc logout as a short alternative to rhc account-logout.

See also

  • The Setting up an OpenShift account using rhc recipe