From 39f05e2f11390d74573baa55d2ce058357651a9a Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Thu, 7 Apr 2016 10:36:12 -0400 Subject: [PATCH 1/2] Update user roles list API documentation --- awx/api/metadata.py | 4 ++++ awx/api/templates/api/user_roles_list.md | 12 ++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 awx/api/templates/api/user_roles_list.md diff --git a/awx/api/metadata.py b/awx/api/metadata.py index 7391fece6b..b121d74863 100644 --- a/awx/api/metadata.py +++ b/awx/api/metadata.py @@ -183,4 +183,8 @@ class RoleMetadata(Metadata): metadata = super(RoleMetadata, self).determine_metadata(request, view) if 'actions' in metadata: metadata['actions'].pop('POST') + metadata['actions']['POST'] = { + "id": {"type": "integer", "label": "ID", "help_text": "Database ID for this role."}, + "disassociate": {"type": "integer", "label": "Disassociate", "help_text": "Provide to remove this role."}, + } return metadata diff --git a/awx/api/templates/api/user_roles_list.md b/awx/api/templates/api/user_roles_list.md new file mode 100644 index 0000000000..b4f6e3a9af --- /dev/null +++ b/awx/api/templates/api/user_roles_list.md @@ -0,0 +1,12 @@ +# List Roles for this User: + +Make a GET request to this resource to retrieve a list of roles associated with the selected user. + +{% include "api/_list_common.md" %} + +# Associate Roles with this User: + +Make a POST request to this resource to add or remove a role from this user. The following fields may be modified: + + * `id`: Required. The Role ID to add to the user. + * `disassociate`: Optional. Provide if you want to remove the role. From 5b366e095564291ba22512c8556e8bbd1f719e97 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Thu, 7 Apr 2016 10:38:09 -0400 Subject: [PATCH 2/2] update API documentation for Team roles --- awx/api/templates/api/team_roles_list.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 awx/api/templates/api/team_roles_list.md diff --git a/awx/api/templates/api/team_roles_list.md b/awx/api/templates/api/team_roles_list.md new file mode 100644 index 0000000000..a764cf8a14 --- /dev/null +++ b/awx/api/templates/api/team_roles_list.md @@ -0,0 +1,12 @@ +# List Roles for this Team: + +Make a GET request to this resource to retrieve a list of roles associated with the selected team. + +{% include "api/_list_common.md" %} + +# Associate Roles with this Team: + +Make a POST request to this resource to add or remove a role from this team. The following fields may be modified: + + * `id`: Required. The Role ID to add to the team. + * `disassociate`: Optional. Provide if you want to remove the role.