Add peers readonly api and instancelink constraint (#13916)

Add Disconnected link state

introspect_receptor_connections is a periodic
task that examines active receptor connections
and cross-checks it with the InstanceLink info.

Any links that should be active but are not
will be put into a Disconnected state. If
active, it will be in an Established state.

UI - Add hop creation and peers mgmt (#13922)

* add UI for mgmt peers, instance edit and add

* add peer info on detail and bug fix on detail

* remove unused chip and change peer label

* rename lookup, put Instance type disable on edit

---------

Co-authored-by: tanganellilore <lorenzo.tanagnelli@hotmail.it>
This commit is contained in:
Lorenzo Tanganelli
2023-04-27 00:34:26 +02:00
committed by Seth Foster
parent d8abd4912b
commit f7fdb7fe8d
29 changed files with 1068 additions and 83 deletions

View File

@@ -39,6 +39,7 @@ from awx.main.models import (
Host,
Instance,
InstanceGroup,
InstanceLink,
Inventory,
InventorySource,
InventoryUpdate,
@@ -2949,6 +2950,22 @@ class WorkflowApprovalTemplateAccess(BaseAccess):
return self.model.objects.filter(workflowjobtemplatenodes__workflow_job_template__in=WorkflowJobTemplate.accessible_pk_qs(self.user, 'read_role'))
class PeersAccess(BaseAccess):
model = InstanceLink
def can_add(self, data):
return False
def can_change(self, obj, data):
return False
def can_delete(self, obj):
return True
def can_copy(self, obj):
return False
for cls in BaseAccess.__subclasses__():
access_registry[cls.model] = cls
access_registry[UnpartitionedJobEvent] = UnpartitionedJobEventAccess