Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new ExecutionEnvironment model
- Loading branch information
1 parent
66739a5
commit 476171a
Showing
7 changed files
with
136 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
# Generated by Django 2.2.11 on 2020-06-29 15:47 | ||
|
||
from django.conf import settings | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import taggit.managers | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('taggit', '0003_taggeditem_add_unique_index'), | ||
('main', '0117_v400_remove_cloudforms_inventory'), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name='unifiedjob', | ||
name='pull', | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.AddField( | ||
model_name='unifiedjobtemplate', | ||
name='pull', | ||
field=models.BooleanField(default=True), | ||
), | ||
migrations.CreateModel( | ||
name='ExecutionEnvironment', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('created', models.DateTimeField(default=None, editable=False)), | ||
('modified', models.DateTimeField(default=None, editable=False)), | ||
('description', models.TextField(blank=True, default='')), | ||
('name', models.CharField(max_length=512)), | ||
('url', models.CharField(help_text='The registry location where the container is stored.', max_length=1024, verbose_name='URL')), | ||
('managed_by_tower', models.BooleanField(default=False, editable=False)), | ||
('created_by', models.ForeignKey(default=None, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="{'class': 'executionenvironment', 'model_name': 'executionenvironment', 'app_label': 'main'}(class)s_created+", to=settings.AUTH_USER_MODEL)), | ||
('credential', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='executionenvironments', to='main.Credential')), | ||
('modified_by', models.ForeignKey(default=None, editable=False, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name="{'class': 'executionenvironment', 'model_name': 'executionenvironment', 'app_label': 'main'}(class)s_modified+", to=settings.AUTH_USER_MODEL)), | ||
('organization', models.ForeignKey(blank=True, default=None, help_text='The organization used to determine access to this execution environment.', null=True, on_delete=django.db.models.deletion.CASCADE, related_name='executionenvironments', to='main.Organization')), | ||
('tags', taggit.managers.TaggableManager(blank=True, help_text='A comma-separated list of tags.', through='taggit.TaggedItem', to='taggit.Tag', verbose_name='Tags')), | ||
], | ||
options={ | ||
'unique_together': {('organization', 'name')}, | ||
}, | ||
), | ||
migrations.AddField( | ||
model_name='activitystream', | ||
name='execution_environment', | ||
field=models.ManyToManyField(blank=True, to='main.ExecutionEnvironment'), | ||
), | ||
migrations.AddField( | ||
model_name='organization', | ||
name='default_environment', | ||
field=models.ForeignKey(blank=True, default=None, help_text='The default execution environment for jobs run by this organization.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='main.ExecutionEnvironment'), | ||
), | ||
migrations.AddField( | ||
model_name='unifiedjob', | ||
name='execution_environment', | ||
field=models.ForeignKey(blank=True, default=None, help_text='The execution environment used for this job.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='main.ExecutionEnvironment'), | ||
), | ||
migrations.AddField( | ||
model_name='unifiedjobtemplate', | ||
name='execution_environment', | ||
field=models.ForeignKey(blank=True, default=None, help_text='The execution environment used for this job.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='+', to='main.ExecutionEnvironment'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
from django.db import models | ||
from django.utils.translation import ugettext_lazy as _ | ||
|
||
from awx.main.models.base import CommonModelNameNotUnique | ||
|
||
|
||
__all__ = ['ExecutionEnvironment'] | ||
|
||
|
||
class ExecutionEnvironment(CommonModelNameNotUnique): | ||
class Meta: | ||
unique_together = ('organization', 'name') | ||
|
||
organization = models.ForeignKey( | ||
'Organization', | ||
null=True, | ||
default=None, | ||
blank=True, | ||
on_delete=models.CASCADE, | ||
related_name='%(class)ss', | ||
help_text=_('The organization used to determine access to this execution environment.'), | ||
) | ||
url = models.CharField( | ||
max_length=1024, | ||
verbose_name=_('URL'), | ||
help_text=_("The registry location where the container is stored."), | ||
) | ||
managed_by_tower = models.BooleanField(default=False, editable=False) | ||
credential = models.ForeignKey( | ||
'Credential', | ||
related_name='%(class)ss', | ||
blank=True, | ||
null=True, | ||
default=None, | ||
on_delete=models.SET_NULL, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters