Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
OPENSHIFT COOKBOOK

You're reading from   OPENSHIFT COOKBOOK Over 100 hands-on recipes that will help you create, deploy, manage, and scale OpenShift applications

Arrow left icon
Product type Paperback
Published in Oct 2014
Publisher Packt
ISBN-13 9781783981205
Length 430 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Shekhar Gulati Shekhar Gulati
Author Profile Icon Shekhar Gulati
Shekhar Gulati
Arrow right icon
View More author details
Toc

Table of Contents (14) Chapters Close

Preface 1. Getting Started with OpenShift FREE CHAPTER 2. Managing Domains 3. Creating and Managing Applications 4. Using MySQL with OpenShift Applications 5. Using PostgreSQL with OpenShift Applications 6. Using MongoDB and Third-party Database Cartridges with OpenShift Applications 7. OpenShift for Java Developers 8. OpenShift for Python Developers 9. OpenShift for Node.js Developers 10. Continuous Integration for OpenShift Applications 11. Logging and Scaling Your OpenShift Applications A. 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 openshift.cookbook@gmail.com 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 user@example.com

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
You have been reading a chapter from
OPENSHIFT COOKBOOK
Published in: Oct 2014
Publisher: Packt
ISBN-13: 9781783981205
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image