2872 Commits

Author SHA1 Message Date
Seth Foster
cfd6df7a3b
Add JobJobEventsChildrenSummary endpoint
- returns a special view to output the total number of children (and
grandchildren) events for all parents events for a job
value is the number of total children of that event
- intended to be consumed by the UI, as an efficient way to get the
number of children for a particular event
- see api/templates/api/job_job_events_children_summary.md for more info
2022-04-04 14:25:18 -04:00
Alex Corey
427f6d1687
Merge pull request #11791 from AlexSCorey/11713-PreventDisassociateHybridNodeFromControlplan
Prevents disassociate hybrid node on controlplane instance group
2022-03-31 10:34:21 -04:00
Alex Corey
dc64168ed4 Disallows disassociate of hubrid type instances from controlplane instance group
Introduce new pattern for is_valid_removal

Makes disassociate error message a bit more dynamic
2022-03-30 17:24:24 -04:00
Amol Gautam
8efed4ef62 Adding awx_task_env as wrapper while invoking backend 2022-03-25 10:16:30 -04:00
John Westcott IV
593eebf062
Adding awx_ as well as tower_ variable names for webhooks (#11925)
Adding utility to ease testing webhooks from command line
Modifying all variables to use a constants list of variable names
2022-03-24 11:58:15 -04:00
Jeff Bradberry
ac6a82eee4
Merge pull request #11654 from jbradberry/django-3.2-upgrade
Django 3.2 upgrade
2022-03-17 10:34:22 -04:00
nixocio
ce8b9750c9 Add several changes to Instance Groups
Add several changes to API and UI related to Instance Groups.

* Update summary_fields for DEFAULT_CONTROL_PLANE_QUEUE_NAME, and
  DEFAULT_EXECUTION_QUEUE_NAME. Rely on API validation for those fields.

* Fix Instance Group list RBAC

* Add validation for a couple of fields on the Instance Groups endpoint
	1. is_container_group
	2. policy_instance_percentage
	3. policy_instance_list

See: https://github.com/ansible/awx/issues/11130
Also: https://github.com/ansible/awx/issues/11718
2022-03-14 14:55:59 -04:00
Jeff Bradberry
eb8a1fec49 Make API queries involving json fields cast the fields to text
This restores compatibility with the way it previously worked -- we
never supported proper json operator queries through the API.
2022-03-14 13:19:57 -04:00
Tiago Góes
f1cc808429
Merge pull request #11882 from nixocio/api_issue_11622
Add validation for hop nodes
2022-03-14 11:15:26 -03:00
John Westcott IV
bc783b8f94
Enabling export of applications through awxkit (#11887) 2022-03-10 13:49:18 -05:00
nixocio
53185a4ea5 Add validation for hop nodes
Add validation for hop nodes

See: https://github.com/ansible/awx/issues/11622
2022-03-09 11:04:12 -05:00
Jeff Bradberry
1e625ed58b Fix up deprecation warning about re_path() replacing urls() 2022-03-07 18:11:36 -05:00
Jeff Bradberry
e620bef2a5 Fix Django 3.1 deprecation removal problems
- FieldDoesNotExist now has to be imported from django.core.exceptions
- Django docs specifically say not to import
  django.conf.global_settings, which now has the side-effect of
  triggering one of the check errors
2022-03-07 18:11:36 -05:00
Jeff Bradberry
05142a779d Replace all usage of customized json fields with the Django builtin
The event_data field on event models, however, is getting an
overridden version that retains the underlying text data type for the
column, to avoid a heavy data migration on those tables.

Also, certain of the larger tables are getting these fields with the
NOT NULL constraint turned off, to avoid a long migration.

Remove the django.utils.six monkey patch we did at the beginning of
the upgrade.
2022-03-07 18:11:36 -05:00
Jeff Bradberry
faa12880a9 Squash a few deprecation warnings
- inspect.getargspec() -> inspect.getfullargspec()
- register pytest.mark.fixture_args
- replace use of DRF's deprecated NullBooleanField
- fix some usage of naive datetimes in the tests
- fix some strings with backslashes that ought to be raw strings
2022-03-07 18:11:36 -05:00
Jeff Bradberry
b852baaa39 Fix up logger .warn() calls to use .warning() instead
This is a usage that was deprecated in Python 3.0.
2022-03-07 18:11:36 -05:00
Jeff Bradberry
a3a216f91f Fix up new Django 3.0 deprecations
Mostly text based: force/smart_text, ugettext_*
2022-03-07 18:11:36 -05:00
Kersom
c6209df1e0
Api issue float (#11757)
* Fix integer/float errors in survey

* Add SURVEY_TYPE_MAPPING to constants

Add SURVEY_TYPE_MAPPING to constants, and replace usage in a couple of
files.

Co-authored-by: Alexander Komarov <akomarov.me@gmail.com>
2022-03-04 14:03:17 -05:00
Alex Corey
fe01f13edb
Merge pull request #11790 from AlexSCorey/11712-SelectRelatedQuery
Use select_related on db queries to reduce db calls
2022-03-02 11:33:45 -05:00
John Westcott IV
cb57752903
Changing session cookie name and added a way for clients to know what the name is #11413 (#11679)
* Changing session cookie name and added a way for clients to know what the key name is
* Adding session information to docs
* Fixing how awxkit gets the session id header
2022-02-27 07:27:25 -05:00
Kersom
3ab73ddf84 Fix TypeError when running a command on a host in a smart inventory (#11768)
Fix TypeError when running a command on a host in a smart inventory

See: https://github.com/ansible/awx/issues/11611
2022-02-23 10:32:27 -05:00
Alex Corey
326d12382f
Adds Inventory labels (#11558)
* Adds inventory labels end point

* Adds label field to inventory form
2022-02-14 15:14:08 -05:00
Rebeccah
c2bf9d94be
change the term unhealthy to error 2022-02-11 15:42:33 -05:00
Shane McDonald
489ee30e54 Simplify code that generates named URLS 2022-02-03 19:00:07 -05:00
Shane McDonald
0bca0fabaa Fix bug in named url middleware when running at non-root path
The most notable change here is the removal of the conditional in
process_request. I don't know why we were preferring REQUEST_URI over
PATH_INFO. When the app is running at /, they are always the same as far as I
can tell. However, when using SCRIPT_NAME, this was incorrectly setting path and
path_info to /myprefix/myprefix/.
2022-02-03 19:00:07 -05:00
Alan Rominger
6b25fcaa80
Fix newly-added black rules 2022-01-29 23:17:58 -05:00
Jeff Bradberry
709c439afc
Merge pull request #11591 from ansible/enable-hop-nodes-endpoints
Turn off the filtering of hop nodes from the Instance endpoints
2022-01-25 12:03:23 -05:00
Jeff Bradberry
334c33ca07 Handle receptorctl advertisements for hop nodes
counting it towards their heartbeat.  Also, leave off the link to the
health check endpoint from hop node Instances.
2022-01-24 16:51:45 -05:00
Jeff Bradberry
56f8f8d3f4 Turn off the filtering of hop nodes from the Instance endpoints
except for the health check.
2022-01-21 15:19:59 -05:00
John Westcott IV
5bced09fc5
Handeling different types of response.data (#11576) 2022-01-21 15:16:09 -05:00
John Westcott IV
e63ce9ed08
Api 4XX error msg customization #1236 (#11527)
* Adding API_400_ERROR_LOG_FORMAT setting
* Adding functional tests for API_400_ERROR_LOG_FORMAT
Co-authored-by: nixocio <nixocio@gmail.com>
2022-01-19 11:16:21 -05:00
Kersom
60831cae88
Merge pull request #11539 from nixocio/api_issue_11523
Update ping endpoint to use last_seen
2022-01-19 10:40:02 -05:00
Amol Gautam
a4a3ba65d7 Refactored tasks.py to a package
--- Added 3 new sub-package : awx.main.tasks.system , awx.main.tasks.jobs , awx.main.tasks.receptor
--- Modified the functional tests and unit tests accordingly
2022-01-14 11:55:41 -05:00
nixocio
3d45f31536 Update ping endpoint to use last_seen
Update ping endpoint to use last_seen, instead of `modified` on
instances `heartbeat`.

See: https://github.com/ansible/awx/issues/11523
2022-01-13 16:46:40 -05:00
Jeff Bradberry
8c33d0ecbd Add the mesh_visualizer resource to awxkit 2022-01-13 15:01:54 -05:00
Jeff Bradberry
dea5fd1a9d Fix a problem with IsSystemAdminOrAuditor for anonymous users
It was raising an error, but should really show the message about not
being authenticated.
2022-01-13 14:44:50 -05:00
Jeff Bradberry
6a131f70f0 Require System Admin or Auditor permissions to access the mesh visualizer 2022-01-13 14:13:17 -05:00
Alex Corey
dea53a0dba Creates end point and serializer for receptor mesh 2022-01-11 10:57:57 -05:00
Jeff Bradberry
f340f491dc Control the visibility and use of hop node Instances
- the list, detail, and health check API views should not include them
- the Instance-InstanceGroup association views should not allow them
  to be changed
- the ping view excludes them
- list_instances management command excludes them
- Instance.set_capacity_value sets hop nodes to 0 capacity
- TaskManager will exclude them from the nodes available for job execution
- TaskManager.reap_jobs_from_orphaned_instances will consider hop nodes
  to be an orphaned instance
- The apply_cluster_membership_policies task will not manipulate hop nodes
- get_broadcast_hosts will ignore hop nodes
- active_count also will ignore hop nodes
2021-12-17 14:30:28 -05:00
Jeff Bradberry
1e5231d68b
Enable ActivityStream capture for Instances 2021-11-10 08:50:12 +08:00
Alan Rominger
6a17e5b65b
Allow manually running a health check, and make other adjustments to the health check trigger (#11002)
* Full finalize the planned work for health checks of execution nodes

* Implementation of instance health_check endpoint

* Also do version conditional to node_type

* Do not use receptor mesh to check main cluster nodes health

* Fix bugs from testing health check of cluster nodes, add doc

* Add a few fields to health check serializer missed before

* Light refactoring of error field processing

* Fix errors clearing error, write more unit tests

* Update health check info in docs

* Bump migration of health check after rebase

* Mark string for translation

* Add related health_check link for system auditors too

* Handle health_check cluster node timeout, add errors for peer judgement
2021-09-03 16:37:37 -04:00
beeankha
41a6473782 Sort instance groups by name regardless of upper/lower case 2021-09-03 13:52:12 -04:00
beeankha
2090e46ac2 Add node_type to api/v2/ping/ endpoint 2021-09-03 11:25:05 -04:00
Jeff Bradberry
a2b984a1a5 Validate that control-only Instance nodes cannot change IG membership 2021-08-30 16:00:23 -04:00
Alan Rominger
928c35ede5
Model changes for instance last_seen field to replace modified (#10870)
* Model changes for instance last_seen field to replace modified

* Break up refresh_capacity into smaller units

* Rename execution node methods, fix last_seen clustering

* Use update_fields to make it clear save only affects capacity

* Restructing to pass unit tests

* Fix bug where a PATCH did not update capacity value
2021-08-24 08:41:35 -04:00
Alan Rominger
b09da48835
Remove some diff that we dont want from PoC 2021-08-24 08:40:19 -04:00
Ryan Petrello
05cb876df5
implement an initial development environment for receptor-based clusters 2021-08-24 08:40:18 -04:00
Rebeccah
f11b73da12
update node_type to be read-only 2021-07-26 16:13:57 -04:00
Rebeccah
706f3f97ea
add a new field to the instance model for use with receptor changes (incoming) 2021-07-26 15:53:56 -04:00
Alexander Komarov
27543aed1d Return 404 for ad_hoc_command_events list api. Remove api endtpoint 2021-07-22 15:04:00 +05:00