forked from pulp/pulpcore
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding PulpExporter model and endpoints
Also adding a new Export model and refactoring existing Exporters. fixes #6328 https://pulp.plan.io/issues/6328 Required PR: pulp/pulp_file#366
- Loading branch information
David Davis
committed
Mar 23, 2020
1 parent
4a20566
commit 95ac1f4
Showing
17 changed files
with
417 additions
and
58 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 @@ | ||
Added a new APIs for PulpExorpters and Exports. |
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 @@ | ||
Added a new Export model, serializer, and viewset. |
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,3 @@ | ||
Changed master model from FileSystemExporter to Exporter. Plugins will still need to extend | ||
FileSystemExporter but the master table is now core_exporter. This will require that plugins drop | ||
and recreate their filesystem exporter tables. |
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,82 @@ | ||
# Generated by Django 2.2.6 on 2020-03-17 19:43 | ||
|
||
import django.contrib.postgres.fields.jsonb | ||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
import uuid | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('contenttypes', '0002_remove_content_type_name'), | ||
('core', '0022_rename_last_version'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='Export', | ||
fields=[ | ||
('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('pulp_created', models.DateTimeField(auto_now_add=True)), | ||
('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)), | ||
('params', django.contrib.postgres.fields.jsonb.JSONField(null=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='ExportedResource', | ||
fields=[ | ||
('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('pulp_created', models.DateTimeField(auto_now_add=True)), | ||
('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)), | ||
('object_id', models.UUIDField()), | ||
('content_type', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='contenttypes.ContentType')), | ||
('export', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='exported_resources', to='core.Export')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='Exporter', | ||
fields=[ | ||
('pulp_id', models.UUIDField(default=uuid.uuid4, editable=False, primary_key=True, serialize=False)), | ||
('pulp_created', models.DateTimeField(auto_now_add=True)), | ||
('pulp_last_updated', models.DateTimeField(auto_now=True, null=True)), | ||
('pulp_type', models.TextField(default=None)), | ||
('name', models.TextField(db_index=True, unique=True)), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.DeleteModel( | ||
name='FileSystemExporter', | ||
), | ||
migrations.AddField( | ||
model_name='export', | ||
name='exporter', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='core.Exporter'), | ||
), | ||
migrations.AddField( | ||
model_name='export', | ||
name='task', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to='core.Task'), | ||
), | ||
migrations.CreateModel( | ||
name='PulpExporter', | ||
fields=[ | ||
('exporter_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, related_name='core_pulp_exporter', serialize=False, to='core.Exporter')), | ||
('path', models.TextField()), | ||
('last_export', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='core_pulp_exporter', to='core.Export')), | ||
('repositories', models.ManyToManyField(related_name='core_pulp_exporter', to='core.Repository')), | ||
], | ||
options={ | ||
'default_related_name': '%(app_label)s_pulp_exporter', | ||
}, | ||
bases=('core.exporter',), | ||
), | ||
] |
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
Oops, something went wrong.