mirror of
				https://github.com/retspen/webvirtcloud
				synced 2025-07-31 12:41:08 +00:00 
			
		
		
		
	Instances overhaul
This commit is contained in:
		
							parent
							
								
									f23e6b000f
								
							
						
					
					
						commit
						47009d47ca
					
				
					 69 changed files with 5011 additions and 4127 deletions
				
			
		
							
								
								
									
										23
									
								
								instances/migrations/0004_auto_20200618_0817.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								instances/migrations/0004_auto_20200618_0817.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| # Generated by Django 2.2.13 on 2020-06-18 08:17 | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('instances', '0003_auto_20200615_0637'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='instance', | ||||
|             name='name', | ||||
|             field=models.CharField(db_index=True, max_length=120, verbose_name='name'), | ||||
|         ), | ||||
|         migrations.AlterField( | ||||
|             model_name='instance', | ||||
|             name='uuid', | ||||
|             field=models.CharField(db_index=True, max_length=36, verbose_name='uuid'), | ||||
|         ), | ||||
|     ] | ||||
							
								
								
									
										23
									
								
								instances/migrations/0005_flavor.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										23
									
								
								instances/migrations/0005_flavor.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,23 @@ | |||
| # Generated by Django 2.2.13 on 2020-06-23 12:12 | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('instances', '0004_auto_20200618_0817'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.CreateModel( | ||||
|             name='Flavor', | ||||
|             fields=[ | ||||
|                 ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||||
|                 ('label', models.CharField(max_length=12, verbose_name='label')), | ||||
|                 ('memory', models.IntegerField(verbose_name='memory')), | ||||
|                 ('vcpu', models.IntegerField(verbose_name='vcpu')), | ||||
|                 ('disk', models.IntegerField(verbose_name='disk')), | ||||
|             ], | ||||
|         ), | ||||
|     ] | ||||
							
								
								
									
										35
									
								
								instances/migrations/0006_addFlavors.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								instances/migrations/0006_addFlavors.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,35 @@ | |||
| # Generated by Django 2.2.10 on 2020-01-28 07:01 | ||||
| 
 | ||||
| from django.db import migrations | ||||
| 
 | ||||
| 
 | ||||
| def add_flavors(apps, schema_editor): | ||||
|     Flavor = apps.get_model("instances", "Flavor") | ||||
|     add_flavor = Flavor(label="micro", vcpu="1", memory="512", disk="20") | ||||
|     add_flavor.save() | ||||
|     add_flavor = Flavor(label="mini", vcpu="2", memory="1024", disk="30") | ||||
|     add_flavor.save() | ||||
|     add_flavor = Flavor(label="small", vcpu="2", memory="2048", disk="40") | ||||
|     add_flavor.save() | ||||
|     add_flavor = Flavor(label="medium", vcpu="2", memory="4096", disk="60") | ||||
|     add_flavor.save() | ||||
|     add_flavor = Flavor(label="large", vcpu="4", memory="8192", disk="80") | ||||
|     add_flavor.save() | ||||
|     add_flavor = Flavor(label="xlarge", vcpu="8", memory="16384", disk="160") | ||||
|     add_flavor.save() | ||||
| 
 | ||||
| 
 | ||||
| def del_flavors(apps, schema_editor): | ||||
|     Flavor = apps.get_model("instances", "Flavor") | ||||
|     Flavor.objects.all().delete() | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('instances', '0005_flavor'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.RunPython(add_flavors, del_flavors), | ||||
|     ] | ||||
							
								
								
									
										18
									
								
								instances/migrations/0007_auto_20200624_0821.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								instances/migrations/0007_auto_20200624_0821.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| # Generated by Django 2.2.13 on 2020-06-24 08:21 | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('instances', '0006_addFlavors'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='flavor', | ||||
|             name='label', | ||||
|             field=models.CharField(max_length=12, unique=True, verbose_name='label'), | ||||
|         ), | ||||
|     ] | ||||
							
								
								
									
										18
									
								
								instances/migrations/0008_auto_20200708_0950.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								instances/migrations/0008_auto_20200708_0950.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,18 @@ | |||
| # Generated by Django 2.2.13 on 2020-07-08 09:50 | ||||
| 
 | ||||
| from django.db import migrations, models | ||||
| 
 | ||||
| 
 | ||||
| class Migration(migrations.Migration): | ||||
| 
 | ||||
|     dependencies = [ | ||||
|         ('instances', '0007_auto_20200624_0821'), | ||||
|     ] | ||||
| 
 | ||||
|     operations = [ | ||||
|         migrations.AlterField( | ||||
|             model_name='instance', | ||||
|             name='created', | ||||
|             field=models.DateTimeField(auto_now_add=True, verbose_name='created'), | ||||
|         ), | ||||
|     ] | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue