Feature #10922

puppet node_aws list should have the ability to filter on state

Added by Garrett Honeycutt over 1 year ago. Updated about 1 year ago.

Status:Needs More InformationStart date:11/17/2011
Priority:NormalDue date:
Assignee:Garrett Honeycutt% Done:

0%

Category:awsSpent time:-
Target version:-
Keywords: Roadmapped:No
Branch:

Description

Would like the ability to filter on state of instance, so that I could only list instances in a given state, such as running.

Would like to add —state as shown below. Not sure what all the possible states are.

# puppet help node_aws list 
USAGE: puppet node_aws list [--platform=] [--region=] NONE

The list action obtains a list of instances from the cloud provider and
displays them on the console output.  For EC2 instances, only the instances in
a specific region are provided.

RETURNS: Array of attribute hashes containing information about each EC2 instance.

OPTIONS:
  --mode MODE                    - The run mode to use (user, agent, or master).
  --render-as FORMAT             - The rendering format to use.
  --verbose                      - Whether to log verbosely.
  --debug                        - Whether to log debug information.
  --platform=                    - Platform used to create machine instance
                                   (only supports AWS).
  --region=                      - The geographic region of the instance.
                                   Defaults to us-east-1.
  --state=                       - The state of the instance (running, terminated, shutting-down, ... )

History

#1 Updated by Daniel Pittman over 1 year ago

  • Category set to aws
  • Status changed from Unreviewed to Needs Decision
  • Assignee set to Jeff McCune

This seems like a reasonable feature request; Jeff, can you make sure that there is enough technical detail in this, then move it to product for the final decision. Thanks.

#2 Updated by Jeff McCune over 1 year ago

  • Status changed from Needs Decision to Needs More Information
  • Assignee changed from Jeff McCune to Garrett Honeycutt

I don’t think more options are the way to go here.

Instead, I’d like to make sure the output of the face works with Unix pipelines.

Garrett, is there a reason grep doesn’t fulfill this need?

If there is a performance need to limit the return data, e.g. thousands of instances, I’d like to see that implemented as another action. e.g. puppet node_aws find and I’d like that new action to have a filter argument rather than specific options for each thing we want to filter on.

-Jeff

#3 Updated by Garrett Honeycutt over 1 year ago

I like Unix pipes :)

As I recall, the output spans multiple lines, so you cannot grep for a status and then derive other useful info, such as the node name.

Perhaps the real fix is to change out the output instead of needing a —state filter.

#4 Updated by Rob Terhaar about 1 year ago

Additionally, the “notice:” messages are sent to stdout along with useful data. So even if you wanted to use pipes, you have to deal with a lot of notice noise.

Also available in: Atom PDF