Skip to content
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

Awxkit api endpoints #6386

Merged
merged 3 commits into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions awx/api/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1251,6 +1251,7 @@ def get_related(self, obj):
res.update(dict(
projects = self.reverse('api:organization_projects_list', kwargs={'pk': obj.pk}),
inventories = self.reverse('api:organization_inventories_list', kwargs={'pk': obj.pk}),
job_templates = self.reverse('api:organization_job_templates_list', kwargs={'pk': obj.pk}),
workflow_job_templates = self.reverse('api:organization_workflow_job_templates_list', kwargs={'pk': obj.pk}),
users = self.reverse('api:organization_users_list', kwargs={'pk': obj.pk}),
admins = self.reverse('api:organization_admins_list', kwargs={'pk': obj.pk}),
Expand Down
8 changes: 8 additions & 0 deletions awxkit/awxkit/api/pages/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,3 +366,11 @@ class Credentials(page.PageList, Credential):
resources.job_extra_credentials,
resources.job_template_extra_credentials],
Credentials)


class CredentialCopy(base.Base):

pass


page.register_page(resources.credential_copy, CredentialCopy)
8 changes: 8 additions & 0 deletions awxkit/awxkit/api/pages/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,3 +682,11 @@ class InventoryUpdateCancel(base.Base):


page.register_page(resources.inventory_update_cancel, InventoryUpdateCancel)


class InventoryCopy(base.Base):

pass


page.register_page(resources.inventory_copy, InventoryCopy)
8 changes: 8 additions & 0 deletions awxkit/awxkit/api/pages/job_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,3 +244,11 @@ class JobTemplateLaunch(base.Base):


page.register_page(resources.job_template_launch, JobTemplateLaunch)


class JobTemplateCopy(base.Base):

pass


page.register_page([resources.job_template_copy], JobTemplateCopy)
17 changes: 15 additions & 2 deletions awxkit/awxkit/api/pages/notification_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ def _associate(self, resource, job_result='any', disassociate=False):
(resources.notification_templates, 'post'),
(resources.notification_template_copy, 'post'),
resources.notification_template_any,
resources.notification_template_started,
resources.notification_template_error,
resources.notification_template_success], NotificationTemplate)
resources.notification_template_success,
resources.notification_template_approval], NotificationTemplate)


class NotificationTemplates(page.PageList, NotificationTemplate):
Expand All @@ -219,12 +221,23 @@ class NotificationTemplates(page.PageList, NotificationTemplate):


page.register_page([resources.notification_templates,
resources.related_notification_templates,
resources.notification_templates_any,
resources.notification_templates_started,
resources.notification_templates_error,
resources.notification_templates_success],
resources.notification_templates_success,
resources.notification_templates_approvals],
NotificationTemplates)


class NotificationTemplateCopy(base.Base):

pass


page.register_page(resources.notification_template_copy, NotificationTemplateCopy)


class NotificationTemplateTest(base.Base):

pass
Expand Down
8 changes: 8 additions & 0 deletions awxkit/awxkit/api/pages/projects.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,14 @@ class ProjectUpdateCancel(base.Base):
page.register_page(resources.project_update_cancel, ProjectUpdateCancel)


class ProjectCopy(base.Base):

pass


page.register_page(resources.project_copy, ProjectCopy)


class Playbooks(base.Base):

pass
Expand Down
1 change: 1 addition & 0 deletions awxkit/awxkit/api/pages/teams.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,5 @@ class Teams(page.PageList, Team):


page.register_page([resources.teams,
resources.credential_owner_teams,
resources.related_teams], Teams)
1 change: 1 addition & 0 deletions awxkit/awxkit/api/pages/users.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ class Users(page.PageList, User):
page.register_page([resources.users,
resources.organization_admins,
resources.related_users,
resources.credential_owner_users,
resources.user_admin_organizations], Users)


Expand Down
3 changes: 2 additions & 1 deletion awxkit/awxkit/api/pages/workflow_job_templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@ class WorkflowJobTemplates(page.PageList, WorkflowJobTemplate):
pass


page.register_page([resources.workflow_job_templates], WorkflowJobTemplates)
page.register_page([resources.workflow_job_templates,
resources.related_workflow_job_templates], WorkflowJobTemplates)


class WorkflowJobTemplateLaunch(base.Base):
Expand Down
4 changes: 4 additions & 0 deletions awxkit/awxkit/api/resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,18 @@ class Resources(object):
_notification = r'notifications/\d+/'
_notification_template = r'notification_templates/\d+/'
_notification_template_any = r'\w+/\d+/notification_templates_any/\d+/'
_notification_template_started = r'\w+/\d+/notification_templates_started/\d+/'
_notification_template_copy = r'notification_templates/\d+/copy/'
_notification_template_error = r'\w+/\d+/notification_templates_error/\d+/'
_notification_template_success = r'\w+/\d+/notification_templates_success/\d+/'
_notification_template_approval = r'\w+/\d+/notification_templates_approvals/\d+/'
_notification_template_test = r'notification_templates/\d+/test/'
_notification_templates = 'notification_templates/'
_notification_templates_any = r'\w+/\d+/notification_templates_any/'
_notification_templates_started = r'\w+/\d+/notification_templates_started/'
_notification_templates_error = r'\w+/\d+/notification_templates_error/'
_notification_templates_success = r'\w+/\d+/notification_templates_success/'
_notification_templates_approvals = r'\w+/\d+/notification_templates_approvals/'
_notifications = 'notifications/'
_object_activity_stream = r'[^/]+/\d+/activity_stream/'
_org_projects = r'organizations/\d+/projects/'
Expand Down