summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArtsiom Musin <artyom.musin@gmail.com>2022-11-08 15:11:56 +0100
committerArtsiom Musin <artyom.musin@gmail.com>2022-11-08 15:42:25 +0100
commit9b047c2af6a268af35eee42ea073876d87b59247 (patch)
treea4ccbd97d81ea89ed38ff70e01cc7232ae7b2f85
parentMake canceling view non-atomic to fix 500 errors with job bursts (#13072) (diff)
downloadawx-9b047c2af6a268af35eee42ea073876d87b59247.tar.xz
awx-9b047c2af6a268af35eee42ea073876d87b59247.zip
Add multiple assert export for awx cli
-rw-r--r--awx_collection/plugins/modules/export.py28
-rw-r--r--awxkit/awxkit/api/pages/api.py2
2 files changed, 18 insertions, 12 deletions
diff --git a/awx_collection/plugins/modules/export.py b/awx_collection/plugins/modules/export.py
index 09c75cd923..958c8e0d8d 100644
--- a/awx_collection/plugins/modules/export.py
+++ b/awx_collection/plugins/modules/export.py
@@ -28,51 +28,51 @@ options:
default: 'False'
organizations:
description:
- - organization name to export
+ - organization names to export
type: str
users:
description:
- - user name to export
+ - user names to export
type: str
teams:
description:
- - team name to export
+ - team names to export
type: str
credential_types:
description:
- - credential type name to export
+ - credential type names to export
type: str
credentials:
description:
- - credential name to export
+ - credential names to export
type: str
execution_environments:
description:
- - execution environment name to export
+ - execution environment names to export
type: str
notification_templates:
description:
- - notification template name to export
+ - notification template names to export
type: str
inventory_sources:
description:
- - inventory soruce to export
+ - inventory soruces to export
type: str
inventory:
description:
- - inventory name to export
+ - inventory names to export
type: str
projects:
description:
- - project name to export
+ - project names to export
type: str
job_templates:
description:
- - job template name to export
+ - job template names to export
type: str
workflow_job_templates:
description:
- - workflow name to export
+ - workflow names to export
type: str
requirements:
- "awxkit >= 9.3.0"
@@ -94,6 +94,10 @@ EXAMPLES = '''
export:
job_templates: "My Template"
credential: 'all'
+
+- name: Export two or more inventories with a comma separated list of names
+ export:
+ inventory: "My Inventory1,My Inventory2"
'''
import logging
diff --git a/awxkit/awxkit/api/pages/api.py b/awxkit/awxkit/api/pages/api.py
index cd600d9dc4..c757efdf1f 100644
--- a/awxkit/awxkit/api/pages/api.py
+++ b/awxkit/awxkit/api/pages/api.py
@@ -218,6 +218,8 @@ class ApiV2(base.Base):
return endpoint.get(id=int(value))
options = self._cache.get_options(endpoint)
identifier = next(field for field in options['search_fields'] if field in ('name', 'username', 'hostname'))
+ if len(value.split(',')) > 0:
+ identifier += '__in'
return endpoint.get(**{identifier: value}, all_pages=True)
def export_assets(self, **kwargs):