add a new field to the instance model for use with receptor changes (incoming)

This commit is contained in:
Rebeccah
2021-07-26 15:48:26 -04:00
parent 57fa2c03f7
commit 706f3f97ea
3 changed files with 25 additions and 0 deletions

View File

@@ -4799,6 +4799,7 @@ class InstanceSerializer(BaseSerializer):
"mem_capacity",
"enabled",
"managed_by_policy",
"node_type",
)
def get_related(self, obj):

View File

@@ -0,0 +1,22 @@
# Generated by Django 2.2.20 on 2021-07-26 19:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0151_rename_managed_by_tower'),
]
operations = [
migrations.AddField(
model_name='instance',
name='node_type',
field=models.CharField(
choices=[('control', 'Control plane node'), ('execution', 'Execution plane node'), ('hybrid', 'Controller and execution')],
default='hybrid',
max_length=16,
),
),
]

View File

@@ -86,6 +86,8 @@ class Instance(HasPolicyEditsMixin, BaseModel):
default=0,
editable=False,
)
NODE_TYPE_CHOICES = [("control", "Control plane node"), ("execution", "Execution plane node"), ("hybrid", "Controller and execution")]
node_type = models.CharField(default='hybrid', choices=NODE_TYPE_CHOICES, max_length=16)
class Meta:
app_label = 'main'