Changes in posting constraints due to rescoping to OCP/K8S-only

- node_state is now read only
- node_state gets set automatically to Installed in the create view
- raise a validation error when creating on non-K8S
- allow SystemAdministrator the 'add' permission for Instances
- expose the new listener_port field
This commit is contained in:
Jeff Bradberry
2022-07-28 14:29:31 -04:00
parent 350efc12f5
commit e4518f7b13
3 changed files with 41 additions and 48 deletions

View File

@@ -367,6 +367,9 @@ class InstanceList(ListCreateAPIView):
search_fields = ('hostname',)
ordering = ('id',)
def perform_create(self, serializer):
serializer.save(node_state=models.Instance.States.INSTALLED)
class InstanceDetail(RetrieveUpdateAPIView):