Oc: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 20: Line 20:
=Output=
=Output=


oc ... -o json
In general, all oc commands can be configured to send their output in either JSON or YAML format, rather than execute the command.


creates a JSON output of the requested action, rather than executing the command.
This is achieved with


  oc ... -o yaml
  oc ... -o json|yaml


creates a YAML output of the requested action, rather than executing the command.
In case of [[oc get]], the output of the server execution is rendered in JSON/YAML.


=Logging and Debugging=
=Logging and Debugging=

Revision as of 02:55, 6 July 2017

External

Internal

Overview

oc is the OpenShift remote client that talks with the master API server.

Installation

RHEL: oc can be installed with the atomic-openshift-clients package.

Mac: Download from https://access.redhat.com/downloads/content/290, choose "OpenShift v3.5 MacOSX Client". Then extract the content and place "oc" in PATH.

Output

In general, all oc commands can be configured to send their output in either JSON or YAML format, rather than execute the command.

This is achieved with

oc ... -o json|yaml

In case of oc get, the output of the server execution is rendered in JSON/YAML.

Logging and Debugging

oc ... --loglevel=8

This log level shows the API requests made with each command.

Commands