Service instantiation #31

Merged
rixx merged 37 commits from 24-service-instantiation into main 2025-04-04 10:57:29 +00:00
Showing only changes of commit 26a3a4942f - Show all commits

View file

@ -404,3 +404,35 @@ class ServiceOffering(ServalaModelMixin, models.Model):
return _("{service_name} at {provider_name}").format(
service_name=self.service.name, provider_name=self.provider.name
)
class ServiceInstance(ServalaModelMixin, models.Model):
"""
The source of truth for service instances is Kubernetes.
The Django model only contains metadata, all other information is queried
on the fly.
"""
name = models.CharField(max_length=100, verbose_name=_("Name"))
organization = models.ForeignKey(
to="core.Organization",
on_delete=models.PROTECT,
verbose_name=_("Organization"),
related_name="service_instances",
)
created_by = models.ForeignKey(
to="core.User",
on_delete=models.SET_NULL,
null=True,
blank=True,
related_name="created_service_instances",
)
context = models.ForeignKey(
to="core.ServiceOfferingControlPlane",
related_name="service_instances",
on_delete=models.PROTECT,
)
class Meta:
verbose_name = _("Service instance")
verbose_name_plural = _("Service instances")