-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: add image search actions #277
Open
anish-mudaraddi
wants to merge
11
commits into
main
Choose a base branch
from
image-search-action
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
7ebed1f
Added image action files
Neonbluestoplight a372a3c
Added content for image search by property action
Neonbluestoplight d9f45e5
Removed image_id from group by field
Neonbluestoplight b24c7e5
Added content to image search by property action
Neonbluestoplight c0a4bf4
Added content - searching image by datetime action
Neonbluestoplight 1ce3ecf
Added content - search image by expression action
Neonbluestoplight 0f69490
Fixed description tag in image.search.by.datetime
Neonbluestoplight a822f34
Fixed lib_entry default - image.search.by.datetime
Neonbluestoplight 27be38b
Fixes to image actions
Neonbluestoplight 43c1861
Added requested changes to image search actions
Neonbluestoplight 325d1ed
Removed image_id and image_name from group_by
Neonbluestoplight File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,153 @@ | ||
--- | ||
description: Query images based on a datetime property (e.g. created-at or last-updated) | ||
enabled: true | ||
entry_point: src/openstack_actions.py | ||
name: image.search.by.datetime | ||
parameters: | ||
timeout: | ||
default: 5400 | ||
lib_entry_point: | ||
default: workflows.search_by_datetime.search_by_datetime | ||
immutable: true | ||
type: string | ||
query_type: | ||
default: ImageQuery | ||
immutable: true | ||
type: string | ||
as_admin: | ||
default: True | ||
immutable: true | ||
type: boolean | ||
cloud_account: | ||
description: "The clouds.yaml account to use whilst performing this action" | ||
required: true | ||
type: string | ||
default: "dev" | ||
enum: | ||
- "dev" | ||
- "prod" | ||
properties_to_select: | ||
default: | ||
- "image_creation_date" | ||
- "image_creation_progress" | ||
- "image_id" | ||
- "image_last_updated_date" | ||
- "image_minimum_ram" | ||
- "image_minimum_disk" | ||
- "image_name" | ||
- "image_size" | ||
- "image_status" | ||
type: array | ||
description: " | ||
A comma-spaced list of image properties to display for the resulting images - leave empty for all properties. One of: | ||
- 'image_creation_date' | ||
- 'image_creation_progress' | ||
- 'image_id' | ||
- 'image_last_updated_date' | ||
- 'image_minimum_ram' | ||
- 'image_minimum_disk' | ||
- 'image_name' | ||
- 'image_size' | ||
- 'image_status' | ||
Anything else will raise an error" | ||
required: false | ||
output_type: | ||
default: "to_string" | ||
type: string | ||
enum: | ||
- "to_html" | ||
- "to_objects" | ||
- "to_props" | ||
- "to_string" | ||
description: " | ||
A string representing how to return the results of the query | ||
- 'to_html' - a tabulate table (in html) | ||
- 'to_props' - properties dicts as a python list | ||
- 'to_objects - as a list of openstack resources | ||
- 'to_string' - a tabulate table" | ||
required: true | ||
property_to_search_by: | ||
description: "choose datetime property to base the query on" | ||
default: "image_creation_date" | ||
type: string | ||
required: true | ||
enum: | ||
- "image_creation_date" | ||
- "image_last_updated_date" | ||
search_mode: | ||
description: "what to mode to use to search by" | ||
default: "older_than" | ||
type: string | ||
required: true | ||
enum: | ||
- "older_than" | ||
- "older_than_or_equal_to" | ||
- "younger_than" | ||
- "younger_than_or_equal_to" | ||
days: | ||
description: "(Optional) Number of relative days from now" | ||
type: integer | ||
default: 0 | ||
required: false | ||
hours: | ||
description: "(Optional) Number of relative hours from now" | ||
type: integer | ||
default: 0 | ||
required: false | ||
minutes: | ||
description: "(Optional) Number of relative minutes from now" | ||
type: integer | ||
default: 0 | ||
required: false | ||
seconds: | ||
description: "(Optional) Number of relative seconds from now" | ||
type: integer | ||
default: 0 | ||
required: false | ||
from_projects: | ||
description: "(Optional) comma-spaced list of projects id/names to limit query to, if not provided, runs against all projects" | ||
type: array | ||
default: null | ||
required: false | ||
all_projects: | ||
type: boolean | ||
description: "tick to search in all projects - default True" | ||
required: true | ||
default: true | ||
group_by: | ||
description: "(Optional) image property to group unique results by" | ||
type: string | ||
required: false | ||
default: null | ||
enum: | ||
- null | ||
- "image_creation_date" | ||
- "image_creation_progress" | ||
- "image_last_updated_date" | ||
- "image_minimum_ram" | ||
- "image_minimum_disk" | ||
- "image_size" | ||
- "image_status" | ||
sort_by: | ||
description: "(Optional) comma-spaced list of image properties to sort by (by ascending only) | ||
- multiple of the same property will be ignored. | ||
Any of: | ||
- 'image_creation_date' | ||
- 'image_creation_progress' | ||
- 'image_id' | ||
- 'image_last_updated_date' | ||
- 'image_minimum_ram' | ||
- 'image_minimum_disk' | ||
- 'image_name' | ||
- 'image_size' | ||
- 'image_status' | ||
Anything else will raise an error" | ||
type: array | ||
required: false | ||
default: null | ||
webhook: | ||
description: "Optional string representing a stackstorm webhook url path, can't be used alongside group_by" | ||
default: null | ||
type: string | ||
required: false | ||
runner_type: python-script |
Neonbluestoplight marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
--- | ||
description: Search for images with a selected expression | ||
enabled: true | ||
entry_point: src/openstack_actions.py | ||
name: image.search.by.expression | ||
parameters: | ||
timeout: | ||
default: 5400 | ||
lib_entry_point: | ||
default: workflows.search_by_expression.search_by_expression | ||
immutable: true | ||
type: string | ||
query_type: | ||
default: ImageQuery | ||
immutable: true | ||
type: string | ||
as_admin: | ||
default: True | ||
immutable: true | ||
type: boolean | ||
cloud_account: | ||
description: The clouds.yaml account to use whilst performing this action | ||
required: true | ||
type: string | ||
default: "dev" | ||
enum: | ||
- "dev" | ||
- "prod" | ||
output_type: | ||
default: "to_string" | ||
type: string | ||
enum: | ||
- "to_html" | ||
- "to_objects" | ||
- "to_props" | ||
- "to_string" | ||
description: " | ||
A string representing how to return the results of the query | ||
- 'to_html' - a tabulate table (in html) | ||
- 'to_props' - properties dicts as a python list | ||
- 'to_objects - as a list of openstack resources | ||
- 'to_string' - a tabulate table" | ||
required: true | ||
property_to_search_by: | ||
default: "image_creation_progress" | ||
description: "choose property to search by (acts as OR for each)" | ||
enum: | ||
- "image_creation_progress" | ||
- "image_minimum_ram" | ||
- "image_minimum_disk" | ||
- "image_size" | ||
type: string | ||
required: true | ||
search_mode: | ||
description: "what to mode to use to search by" | ||
default: "LESS_THAN" | ||
type: string | ||
required: true | ||
enum: | ||
- "LESS_THAN" | ||
- "LESS_THAN_OR_EQUAL_TO" | ||
- "GREATER_THAN" | ||
- "GREATER_THAN_OR_EQUAL_TO" | ||
value: | ||
description: "A number to compare the property against" | ||
required: true | ||
type: integer | ||
properties_to_select: | ||
default: | ||
- "image_creation_date" | ||
- "image_creation_progress" | ||
- "image_id" | ||
- "image_last_updated_date" | ||
- "image_minimum_ram" | ||
- "image_minimum_disk" | ||
- "image_name" | ||
- "image_size" | ||
- "image_status" | ||
type: array | ||
description: " | ||
A comma-spaced list of image properties to display for the resulting images - leave empty for all properties. One of: | ||
- 'image_creation_date' | ||
- 'image_creation_progress' | ||
- 'image_id' | ||
- 'image_last_updated_date' | ||
- 'image_minimum_ram' | ||
- 'image_minimum_disk' | ||
- 'image_name' | ||
- 'image_size' | ||
- 'image_status' | ||
Anything else will raise an error" | ||
required: false | ||
from_projects: | ||
description: "(Optional) comma-spaced list of projects id/names to limit query to, if not provided, runs against all projects" | ||
type: array | ||
default: null | ||
required: false | ||
all_projects: | ||
type: boolean | ||
description: "tick to search in all projects - default True" | ||
required: true | ||
default: true | ||
group_by: | ||
description: "(Optional) image property to group unique results by" | ||
type: string | ||
required: false | ||
default: null | ||
enum: | ||
- null | ||
- "image_creation_date" | ||
- "image_creation_progress" | ||
- "image_last_updated_date" | ||
- "image_minimum_ram" | ||
- "image_minimum_disk" | ||
- "image_size" | ||
- "image_status" | ||
sort_by: | ||
description: "(Optional) comma-spaced list of image properties to sort by (by ascending only) | ||
- multiple of the same property will be ignored. | ||
Any of: | ||
- 'image_creation_date' | ||
- 'image_creation_progress' | ||
- 'image_id' | ||
- 'image_last_updated_date' | ||
- 'image_minimum_ram' | ||
- 'image_minimum_disk' | ||
- 'image_name' | ||
- 'image_size' | ||
- 'image_status' | ||
Anything else will raise an error" | ||
type: array | ||
required: false | ||
default: null | ||
webhook: | ||
description: "Optional string representing a stackstorm webhook url path, can't be used alongside group_by" | ||
default: null | ||
type: string | ||
required: false | ||
runner_type: python-script |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anish-mudaraddi Is all_projects needed if when from_projects is not provided it runs against all projects?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this if from_projects and all_projects are false the it will default to searching the admin project
Might be worth changing the from_projects description to something along the lines of:
(Optional) comma-spaced list of projects id/names to limit query to, if not provided, runs against all projects when all_projects is true