Merge pull request #3805 from beeankha/cli_approval_notification_support

Enable Approval Notification Support for CLI
This commit is contained in:
Ryan Petrello
2019-10-16 13:09:22 -04:00
committed by GitHub
2 changed files with 22 additions and 1 deletions

View File

@@ -225,6 +225,7 @@ class AssociationMixin(object):
def __init__(self, connection, resource):
self.conn = connection
self.resource = {
'approval_notification': 'notification_templates',
'start_notification': 'notification_templates',
'success_notification': 'notification_templates',
'failure_notification': 'notification_templates',
@@ -299,11 +300,21 @@ JobTemplateNotificationDisAssociation.targets.update({
class WorkflowJobTemplateNotificationAssociation(NotificationAssociateMixin, CustomAction):
resource = 'workflow_job_templates'
action = 'associate'
targets = NotificationAssociateMixin.targets.copy()
class WorkflowJobTemplateNotificationDisAssociation(NotificationAssociateMixin, CustomAction):
resource = 'workflow_job_templates'
action = 'disassociate'
targets = NotificationAssociateMixin.targets.copy()
WorkflowJobTemplateNotificationAssociation.targets.update({
'approval_notification': ['notification_templates_approvals', 'notification_template'],
})
WorkflowJobTemplateNotificationDisAssociation.targets.update({
'approval_notification': ['notification_templates_approvals', 'notification_template'],
})
class ProjectNotificationAssociation(NotificationAssociateMixin, CustomAction):
@@ -329,11 +340,21 @@ class InventorySourceNotificationDisAssociation(NotificationAssociateMixin, Cust
class OrganizationNotificationAssociation(NotificationAssociateMixin, CustomAction):
resource = 'organizations'
action = 'associate'
targets = NotificationAssociateMixin.targets.copy()
class OrganizationNotificationDisAssociation(NotificationAssociateMixin, CustomAction):
resource = 'organizations'
action = 'disassociate'
targets = NotificationAssociateMixin.targets.copy()
OrganizationNotificationAssociation.targets.update({
'approval_notification': ['notification_templates_approvals', 'notification_template'],
})
OrganizationNotificationDisAssociation.targets.update({
'approval_notification': ['notification_templates_approvals', 'notification_template'],
})
class SettingsList(CustomAction):

View File

@@ -1,7 +1,7 @@
AWX Command Line Interface
==========================
awx is the official command-line client for AWX. It:
`awx` is the official command-line client for AWX. It:
* Uses naming and structure consistent with the AWX HTTP API
* Provides consistent output formats with optional machine-parsable formats