Make the bulk endpoint templates work in API browser

Various fixes

- Don't skip checking resource RBAC permissions for admins
Necessary to handle bad input, e.g. providing a
unified_job_template id that doesn't exit

- In awxkit, only "walk" if we get 'url' in the result

- Bulk host create should return url pointing to inventory,
not inventory/hosts

dont do org check for superuser
This commit is contained in:
Alan Rominger
2023-02-17 09:39:39 -05:00
committed by Elijah DeLee
parent 9358d59f20
commit 7cb16ef91d
5 changed files with 71 additions and 76 deletions

View File

@@ -15,7 +15,10 @@ page.register_page([resources.bulk, (resources.bulk, 'get')], Bulk)
class BulkJobLaunch(base.Base):
def post(self, payload={}):
result = self.connection.post(self.endpoint, payload)
return self.walk(result.json()['url'])
if 'url' in result.json():
return self.walk(result.json()['url'])
else:
return self.page_identity(result, request_json={})
page.register_page(resources.bulk_job_launch, BulkJobLaunch)