Other Op Functions

Updated 3 days ago by Shoreline

Function

Description

auth

auth <url> - authenticates users via Okta to access Shoreline.

Valid auth url: https://<customer>.<region>.api.shoreline-<cluster>.io

Ex:  https://cust1.us.api.shoreline-prod.io

auth <url><token> - allows manual import of an authorization token (e.g. when a browser is not available

auth list - list all stored auth credentia

auth refresh - update the current auth credential

auth switch - select different stored auth credential

auth vars - variables that can be used to set custom cli prompt or custom cli window title.

Ex:  config set cli.prompt "op:${{auth.customer}}-${{auth-region}}-${{auth.cluster}}>"

Ex:  config set cli.title "op:${{auth.user}}-${{auth.customer}}-${{auth-region}}-${{auth.cluster}}>"

columns

Shows available columns that you can show or hide in the cli for the resource that you are querying. There is a corresponding config setting for each available column for you to bring in to the cli

Ex: columns host | .pod

config

config list - list all available config settings

config get - list a single config setting

Ex:  config get timer

config set - change the config setting

Ex:  config set table.sections.linux_cmd.format.stdout '{type: string, spec: "%s", width_max: 200, width_style: wrap }'

config show <section.column_name> - display the specified column

Ex:  config show resources.fields.instance_type

config hide - hide the specified column

Ex:  config hide resources.fields.az

config shell “<path-to-shell>” - set the shell for remote execution

Ex: config shell “/bin/sh”

get_user_sessions

Get active user sessions in Shoreline. Output includes user, agent (cli or web), active time, and session id

help

List help for commands and symbols

help <command> - prints help for single command

history

List commands executed in order during the current session

log

log true - enables logging to “op-session.log” in the current directory. All commands and responses are written to the file, as well as the console

log false - disables logging

log <file name> - enables logging to a specific destination file

op

op replay - re-displays the output for the last Op command, applying any config changes. Does not re-execute the command

op save <jsonfile> - saves the returned JSON result for the last Op command to a file

op load <jsonfile> - loads a saved JSON result from a file to replay.

source

Run the op commands sequentially in a flat file, aborting on any errors

Ex: source maintenance_script

version

Print the version of the cli


How did we do?