Commit Graph

1481 Commits

Author SHA1 Message Date
Matthew Jones
52fa9410f2 Merge pull request #6084 from cchurch/paginate_this
Add custom paginator to avoid separate COUNT(*) query
2017-04-25 16:05:48 -04:00
Ryan Petrello
7037daa799 Merge pull request #6096 from ryanpetrello/api_new_in_v2
refactor API v2 version detection
2017-04-25 10:48:00 -04:00
Ryan Petrello
f0f859f553 Merge pull request #6088 from ryanpetrello/v1_custom_credentials
for /api/v1/ requests, filter out v2 (custom) credentials
2017-04-25 10:30:02 -04:00
Ryan Petrello
80df1523b0 refactor API v2 version detection and feature inclusion 2017-04-25 09:35:03 -04:00
Alan Rominger
34b697ce17 Fix 500 error in ProjectScmInventorySources 2017-04-24 16:54:17 -04:00
Ryan Petrello
83dc4f6757 for /api/v1/ requests, filter out v2 (custom) credentials
see: #5877
2017-04-24 15:21:30 -04:00
Ryan Petrello
7e64a6fd60 add "added_in_api_version" metadata to OPTIONS requests 2017-04-21 15:42:27 -04:00
Ryan Petrello
ba259e0ad4 Introduce a new CredentialTemplate model
Credentials now have a required CredentialType, which defines inputs
(i.e., username, password) and injectors (i.e., assign the username to
SOME_ENV_VARIABLE at job runtime)

This commit only implements the model changes necessary to support the
new inputs model, and includes code for the credential serializer that
allows backwards-compatible support for /api/v1/credentials/; tasks.py
still needs to be updated to actually respect CredentialType injectors.

This change *will* break the UI for credentials (because it needs to be
updated to use the new v2 endpoint).

see: #5877
see: #5876
see: #5805
2017-04-21 15:42:26 -04:00
Chris Church
9f1f770ebe Add custom paginator to use PostgreSQL window function instead of needing a separate COUNT(*) query. 2017-04-20 16:45:14 -04:00
AlanCoding
d1698ece34 Add back group summary_field for v1 InvSrc 2017-04-20 08:43:56 -04:00
AlanCoding
a066905997 fix InvSrc validation Organization requirement for new sources 2017-04-19 14:00:19 -04:00
Chris Meyers
a64f8a7660 Merge pull request #6045 from chrismeyersfsu/fix-hosts_list
return count, results, next, prev
2017-04-18 09:08:05 -04:00
Chris Meyers
70a8ccef0f return count, results, next, prev
* This returns /api/vx/hosts/ to having all the nice response items like
count, results, next, prev. I had "chopped" that off by explicitly only
returning result.
2017-04-17 16:43:29 -04:00
Alan Rominger
1011e54689 Merge pull request #5985 from AlanCoding/scm_inv5
SCM file-based inventory sources
2017-04-17 16:22:24 -04:00
Alan Rominger
6ff6948688 Merge pull request #6043 from AlanCoding/v1_group_fixes
Group V1 serializer fixes from QE feedback
2017-04-17 15:44:35 -04:00
AlanCoding
6d92c56da5 SCM Inventory model, view, and task system changes
Inventory source file-type combined with a linked project
will allow the inventory source to be updated when the
project is updated. The inventory update runs in the
post-run hook of the project update.
2017-04-17 15:01:19 -04:00
Chris Meyers
2c34aef661 Merge pull request #6041 from chrismeyersfsu/feature-jsonsearch
remove facts_latest in favor of ansible_facts
2017-04-17 14:52:02 -04:00
AlanCoding
29de1056e7 Group V1 serializer fixes from QE feedback
Straightforward bug fixes and edits to be more consistent with
the 3.1 v1 API structure
 - remove `inventory_source` as a field from group
 - add inventory source as a group summary field
 - fix user_capabilities bug for group start permission
 - fix 500 error on /inventory_sources/N/update/
2017-04-17 14:43:17 -04:00
Chris Meyers
55268a8ff0 remove facts_latest in favor of ansible_facts
* Closer align our facts data structure with ansible facts data
structure for purposes of ... wait for it ... 2-way fact caching
2017-04-17 14:27:33 -04:00
Chris Meyers
880f4a77a4 Merge pull request #6036 from chrismeyersfsu/fix-hosts_v2
run host listing through v1 vs. v2 logic
2017-04-17 12:12:24 -04:00
Chris Meyers
775093294e run host listing through v1 vs. v2 logic
* api/v1/hosts related fields were getting v2 in the related urls. The
context is now included in the serializer instantiation.
2017-04-17 11:43:44 -04:00
Alan Rominger
14a03d2cb5 Merge pull request #6029 from AlanCoding/group_v1
Group serializer special v1 functionality
2017-04-17 11:37:26 -04:00
AlanCoding
7223177684 Group serializer special v1 functionality
Returns a related `inventory_source` and related link for groups
if accessed from /api/v1/, but not for API v2.
Also inserts corresponding fields to inventory source serializer.
Keep migrated manual sources and auto-create in API v1.
2017-04-17 10:30:07 -04:00
Chris Meyers
bd1f8b088f 400 on invalid host filter query instead of 500 2017-04-13 09:40:11 -04:00
Wayne Witzel III
91f3e665cb group -> deprecated_group, added migrations, added/removed tests 2017-04-11 14:09:04 -04:00
Wayne Witzel III
7458788562 More updates for InventorySource changes 2017-04-11 14:04:25 -04:00
Wayne Witzel III
c784c96449 Initial removal of InventorySource.group 2017-04-11 14:04:25 -04:00
Chris Meyers
ee09bca558 change facts_recent to facts_latest 2017-04-05 16:50:38 -04:00
Chris Meyers
f7fb541fe2 add facts recent endpoints
* Hang most recent listing of facts per-host off of /hosts/n/
2017-04-04 17:54:02 -04:00
Chris Meyers
a8213661fd basic fact search grammar
* Establish a base grammar for handling json path specification and
value matching. With boolean logic support and parenthesis grouping
i.e. (a.b.c="value") and ((a.b="foo") or (a="bar"))
* generate Q() results for passing to Host.objects.filter()
* Hooked up via /api/v1/hosts?host_filter=...
* DynamicFilterField added to store host filter as string with grammar
parser attached as static methods for later use by DynamicInventory &
continued use by host_filter=...
2017-04-03 15:32:21 -04:00
Ryan Petrello
95ea370e5e add API versioning for /api/v2/ 2017-03-30 15:11:12 -04:00
AlanCoding
99fc0e8264 Use consistent error message when vars are not parsed correctly 2017-03-22 16:37:20 -04:00
Alan Rominger
83bc654b15 Merge pull request #5812 from AlanCoding/no_loops_for_hackers
Block loops in querystring filters
2017-03-21 10:50:35 -04:00
Ryan Petrello
a69dfced74 Merge remote-tracking branch 'origin/release_3.1.2' into devel 2017-03-21 10:39:16 -04:00
AlanCoding
925712e3ec block users from making looping filters which can DoS Tower 2017-03-21 10:16:49 -04:00
Ryan Petrello
ba0e9ab775 copy extra_vars when relaunching ad-hoc commands
see: #1744
2017-03-21 09:45:30 -04:00
Aaron Tan
2edd4b338d Add functional test to gurarantee consistent behavior of provisioning callback with jt launch. 2017-03-17 15:40:55 -04:00
Aaron Tan
6083e9482e Refactor job template callback post to mimic the behavior of normal jt launch. 2017-03-17 13:04:45 -04:00
Wayne Witzel III
ea1c4ee1d5 correct unintentional stripping of - from order by fields 2017-03-13 18:13:55 -04:00
Ryan Petrello
bad9670a0b Merge remote-tracking branch 'origin/release_3.1.2' into devel 2017-03-10 10:57:03 -05:00
Ryan Petrello
f4d4c43d94 prohibit order_by= for sensitive fields
see: #5526
2017-03-10 08:49:59 -05:00
Ryan Petrello
8c1de7f109 add an API endpoint for testing external log aggregrator connectivity
see: #5164
2017-03-09 13:19:56 -05:00
Wayne Witzel III
27fc64eb56 value_to_python should encode lookup fields as ascii 2017-03-08 12:30:30 -05:00
Aaron Tan
b105e2b9b6 Remove unicode marker from filter error message. 2017-03-07 16:48:51 -05:00
Chris Meyers
1fc40d38c7 jobs/<id>/job_events?search= searches stdout field 2017-03-07 16:48:48 -05:00
Ryan Petrello
d97ff57cda prohibit API payloads that represent something other than a JSON object
The JSON serializer for our API uses ``json.loads``, which permits *any*
valid JSON (including bare integers, boolean values, etc).  Lots of our
code, however, assumes that inbound JSON content will be a dict.

see: #4756
2017-02-28 13:23:03 -05:00
Matthew Jones
1fefa4cfdd Merge branch 'stable' into devel
* stable: (275 commits)
  Install correct rpm-sign package in RPM builder
  Updating changelog for 3.1 release
  Switch job_type to check from sync when detecting delete_on_update
  use Unicode apostrophes - not single quotes - for French i18n strings
  pin appdirs==1.4.2
  only cancel deps if we can cancel the inv update
  fixing module_name check and adding support for the debug module
  cancel jobs dependent on inv update
  update tests
  CSS tweaks to workflow results panels
  like inventory updates, check if project update deps already processed
  Revert "Merge pull request #5553 from chrismeyersfsu/fix-waiting_blocked"
  Add awx/ui/client/languages to .gitignore
  Delete awx/ui/client/languages/*.json
  refactor based on review
  Add missing permission check.
  Make current_groups a set to easily avoid duplicates, update asgi-amqp requirement
  avoid duplicated related search fields
  Fix workflow audit items
  fixing module name, json blob, and stdout-for-yum-module on host event
  ...
2017-02-28 11:37:05 -05:00
Wayne Witzel III
c919f1ef30 Merge pull request #5487 from wwitzel3/issue-5341
explicit ordering in workflow_nodes views
2017-02-27 10:06:58 -05:00
Aaron Tan
fe3605ccdd Merge pull request #5534 from jangsutsr/3551_restore_original_behavior_of_group_children_unattach
Restore original behavior of group children unattach
2017-02-27 10:05:15 -05:00
Wayne Witzel III
a04411817f refactor based on review 2017-02-24 17:12:40 -05:00