How do we return raw output of an entity?

Asked by Chelsea Winfree

In barbican, we are using the show.ShowOne class to get a secret; however, we'd like to return the payload without any description around it.

As an abbreviated example:

$ barbican secret get <secret uri>
+---------+-------+
| Field | Value |
+---------+-------+
| Payload | boop |
+---------+-------+

The ascii table is returned here. I noticed there was also a -f shell format which returns:

$ barbican secret get <secret uri> -f shell
payload="boop"

My question is, I wish to be able to call this command and only receive the payload:

$ barbican secret get <secret uri> -f simple
boop

Is there something like i've structured above? I've been in the documentation and havent been able to find anything specific to that.

TL;DR: I just want to return the simple entity using the take_action function inheriting from show.ShowOne, how do i do this?

Question information

Language:
English Edit question
Status:
Solved
For:
python-openstackclient Edit question
Assignee:
No assignee Edit question
Solved by:
Doug Hellmann
Solved:
Last query:
Last reply:
Revision history for this message
Best Doug Hellmann (doug-hellmann) said :
#1

It sounds like you want to use the "value" formatter, which prints only the string representation of the data passed to it.

Revision history for this message
Chelsea Winfree (chelsea-winfree) said :
#2

Thats it! thank you so much!