58 Commits

Author SHA1 Message Date
Hao Liu
229dbe0905 Add ui_next to /api/v2/config
- Add ui_next to /api/v2/config
- enable banner to show up for normal user since /api/v2/settings is only available to admin users
2023-03-16 23:34:30 -04:00
Elijah DeLee
752289e175 create new bulk host create endpoint
allow system admins, org admins, and inventory admins to bulk create
hosts.

Testing on an "open" licensed awx as system admin, I created 1000 hosts with 6 queries in ~ 0.15 seconds
Testing on an "open" licensed awx as organization admin, I created 1000 hosts with 11 queries in ~ 0.15 seconds

fix org max host check

also only do permission denied if license is a trial

add /api/v2/bulk to list bulk apis available

add api description templates

One motiviation to not take a list of hosts with mixed inventories is to
keep things simple re: RBAC and keeping a constant number of queries.

If there is great clamor for accepting list of hosts to insert into
arbitrary different inventories, we could probably make it happen - we'd
need to pop the inventory off of each of the hosts, run the
HostSerializer validate, then in top level BulkHostCreateSerializer
fetch all the inventories/check permissions/org host limits for those
inventories/etc. But that makes this that much more complicated.

add test for rbac access

test also helped me find a bug in a query, fixed that

add test to assert num queries scales as expected

also move other test to dedicated file

also test with super user like I meant to

record activity stream for the inventory

this records that a certain number of hosts were added by a certain user
we could consider if there is any other additional information we want
to include
2023-03-08 12:58:12 -05:00
Alan Rominger
f5785976be
Update to comply with new black rules 2023-02-01 14:59:38 -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
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
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
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
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
Alan Rominger
21aa1fc11f
Handle inventory types where Automation Hub collection names differ
Move imports added by Bill to be in-line, because utils should not import models at top

Remove more get_licenser inline imports
2021-06-16 13:39:52 -04:00
softwarefactory-project-zuul[bot]
b64f966db1
Merge pull request #10090 from rebeccahhh/custom_venv_command
add a new awx-manage command `custom_venvs`

add an awx-manage command that gets pip freeze data from custom_venv and outputs to command line stdout
SUMMARY

part of #7062  - this command is a glorified pip freeze + some extra stuff, people could navigate to each of their custom virtual environments themselves and run a pip freeze, but this allows them to not, and everyone likes their life to be easier. The extra stuff allows users to see the connections that their existing virtual envs have in awx to things like organizations, jobs, inventory updates, and projects.

ISSUE TYPE


Feature Pull Request

COMPONENT NAME


API

AWX VERSION

awx: 19.1.0

ADDITIONAL INFORMATION

This is built off of existing code and there is a line that gets custom venv paths from the settings module, that line does not seem to be working. I have written around that but want to make a note of it.

Reviewed-by: Alan Rominger <arominge@redhat.com>
Reviewed-by: Rebeccah Hunter <rhunter@redhat.com>
Reviewed-by: Jeff Bradberry <None>
Reviewed-by: Shane McDonald <me@shanemcd.com>
Reviewed-by: Elijah DeLee <kdelee@redhat.com>
2021-06-04 18:44:52 +00:00
Ryan Petrello
b19bcdd882 remove the global /api/v2/job_events/ endpoint 2021-06-04 09:17:07 -07:00
Rebeccah
baade775ab
remove changes to root.py to keep the custom virtualenvs listed in api/config 2021-06-04 09:11:23 -04:00
Rebeccah
550ab82f63
add the conditionals for incorrect paths and helpful info for if a user does that
and remove unused import
2021-06-04 09:11:22 -04:00
Rebeccah
cece7ff741
add a -q flag to make scripting easier and general improvements for readability 2021-06-04 09:11:22 -04:00
Rebeccah
779ca8b260
split the one command into two for clarity and remove unused imports 2021-06-04 09:11:21 -04:00
Rebeccah
dfaa69be51
add an awx-manage command that gets pip freeze data from custom_venvs and outputs to command line stdout
remove analytics tests for counts of custom venvs, bump collector version, and remove list of custom venvs from API
2021-06-04 09:11:16 -04:00
Christian M. Adams
909cdc2425
Remove explicit eula acceptance 2021-05-27 09:26:32 -04:00
Alan Rominger
67f7998ab9
Modify formatting in response to black update 2021-04-26 10:51:27 -04:00
Alan Rominger
38352063e8
Remove custom inventory script API 2021-04-22 08:36:46 -04:00
Ryan Petrello
db20bbe682
remove ansible_version from the API config and metrics endpoints
AWX no longer includes Ansible on the control plane and there is no
"default" version of Ansible aside from what's configured at the
Execution Environment level

see: https://github.com/ansible/awx/issues/9472
2021-03-25 11:09:47 -04:00
Ryan Petrello
c2ef0a6500 move code linting to a stricter pep8-esque auto-formatting tool, black 2021-03-23 09:39:58 -04:00
Jeff Bradberry
61cbd34586 Add in the basic list and detail api views 2021-03-03 18:52:53 -05:00
Ryan Petrello
94b6b31185
fix a minor bug in the way we report certain license upload errors 2020-10-30 16:40:02 -04:00
Ryan Petrello
e50c2c2867
warn about legacy license usage in the licensing UI 2020-10-30 16:40:00 -04:00
Bill Nottingham
393e1b75e9
Return more user-friendly errors for assorted manifest failures 2020-10-30 16:39:59 -04:00
Christian M. Adams
05de875ace
Fix flake8 2020-10-30 16:39:59 -04:00
Ryan Petrello
3bb930c769
cleanup up some unused code/comments, and simplify the license migration 2020-10-30 16:39:57 -04:00
Ryan Petrello
ef43d85271
remove Organization label from RHSM/Sat6 license form 2020-10-30 16:39:57 -04:00
Ryan Petrello
927b055e65
change license uploading to parse RHSM manifests
Co-authored-by: Christian Adams <chadams@redhat.com>
2020-10-30 16:39:57 -04:00
Ryan Petrello
4445d096f5
reimplement licensing to work with RHSM and entitlement uploads
Co-authored-by: Christian Adams <chadams@redhat.com>
2020-10-30 16:39:57 -04:00
Bill Nottingham
1c4b06fe1e Refactor analytics collectors.
- Only have one registration class
- Add description fields
- Add automation collector information to /api/v2/config
2020-09-09 17:10:14 -04:00
Bill Nottingham
71ef7cdec1 Use AWX_TASK_ENV when connecting to Red Hat services 2020-02-07 14:29:42 -05:00
Ryan Petrello
c7c899375b
when a license is installed, only set TOWER_URL_BASE if necessary
it's possible for users to set this manually in /etc/tower/conf.d
prior to license application
2020-01-30 16:23:25 -05:00
Graham Mainwaring
9c9496a683 Expose login redirect URL in unauthenticated /api view 2019-12-11 17:21:02 -05:00
mabashian
113622c05e
Moves initial system settings rest call out to resolve 2019-09-13 12:14:31 -04:00
Ryan Petrello
29fd399b06
introduce a new API for generating licenses from candlepin creds 2019-09-13 12:14:29 -04:00
Ryan Petrello
846e67ee6a
update trial license enforcement logic 2019-09-13 12:14:25 -04:00
beeankha
294d6551b9
Polishing up work on new endpoint 2019-08-27 15:30:48 -04:00
beeankha
320284267c
Add new endpoint for creation of approval nodes 2019-08-27 15:30:47 -04:00
beeankha
9024a514a6
Add API endpoints for workflow approvals 2019-08-27 15:30:39 -04:00
Jeff Bradberry
f94959d120 Remove the custom get_view_name function
It appeared to not be doing anything that we were making use of that
couldn't already be done, slightly differently, using DRF's built-in
one.
2019-06-12 14:12:59 -04:00
Ryan Petrello
6da445f7c0
remove /api/v1 and deprecated credential fields 2019-06-06 12:23:00 -04:00
AlanCoding
dbc65baa43
apply optimizations via standard method
This addresses the top-level resources in the v2
root view, focusing in order of priority,
reflecting use by the UI.

In several cases get_queryset logic from the view
is moved into the access class.

Most other cases involve adding a straightforward
select_related or prefetch_related entry.

All additional confirmed to be effective with the
django debug toolbar.
2019-05-24 13:09:55 -04:00
softwarefactory-project-zuul[bot]
e8de7bc845
Merge pull request #3673 from rooftopcellist/metrics_uuids
add uuids to ping and metrics

Reviewed-by: https://github.com/softwarefactory-project-zuul[bot]
2019-04-13 11:45:47 +00:00
Christian Adams
40393e201f add uuids to ping and metrics 2019-04-12 18:37:40 -04:00
beeankha
de34a64115 Basic License feature gating changes 2019-04-12 11:28:27 -04:00
Wayne Witzel III
c3812de3d6 initial prometheus commit
Co-authored-by: Wayne Witzel III <wayne@riotousliving.com>
Co-authored-by: Christian Adams <rooftopcellist@gmail.com>
2019-04-08 02:47:56 -04:00