CORD-1249 implement ServiceDependency models
Change-Id: I0eba647d0d97b8a50ba80f1e5798ed1276aec71d
diff --git a/xos/core/admin.py b/xos/core/admin.py
index 9cc03d6..5b357e7 100644
--- a/xos/core/admin.py
+++ b/xos/core/admin.py
@@ -940,8 +940,8 @@
extra = 0
suit_classes = 'suit-tab suit-tab-servicetenants'
fk_name = 'provider_service'
- verbose_name = 'provided tenant'
- verbose_name_plural = 'provided tenants'
+ verbose_name = 'provided dependency'
+ verbose_name_plural = 'provided dependencies'
class SubscriberDependencyInline(XOSTabularInline):
@@ -950,8 +950,8 @@
extra = 0
suit_classes = 'suit-tab suit-tab-servicetenants'
fk_name = 'subscriber_service'
- verbose_name = 'subscribed tenant'
- verbose_name_plural = 'subscribed tenants'
+ verbose_name = 'subscribed dependency'
+ verbose_name_plural = 'subscribed dependencies'
class ServiceAttrAsTabInline(XOSTabularInline):
model = ServiceAttribute
@@ -984,7 +984,7 @@
suit_form_tabs = (('general', 'Service Details'),
('slices', 'Slices'),
('serviceattrs', 'Additional Attributes'),
- ('servicetenants', 'Tenancy'),
+ ('servicetenants', 'Dependencies'),
('serviceprivileges', 'Privileges'),
('servicemonitoringagents', 'Monitoring Agents')
)
diff --git a/xos/core/models/attic/servicedependency_model.py b/xos/core/models/attic/servicedependency_model.py
deleted file mode 100644
index b2d2da6..0000000
--- a/xos/core/models/attic/servicedependency_model.py
+++ /dev/null
@@ -1,13 +0,0 @@
-KIND="coarse"
-
-def save(self, *args, **kwargs):
- if (not self.subscriber_service):
- raise XOSValidationError("subscriber_service cannot be null", {'subscriber service' : 'subscriber_service cannot be null'})
- if (self.subscriber_tenant):
- raise XOSValidationError("subscriber_tenant must be null", {'subscriber tenant' : 'subscriber_tenant must be null'})
- if (self.subscriber_user):
- raise XOSValidationError("subscriber_user must be null", {'subscriber user' : 'subscriber_user must be null'})
-
-
- super(ServiceDependency, self).save()
-
diff --git a/xos/core/models/core.xproto b/xos/core/models/core.xproto
index adb5842..1a77eee 100644
--- a/xos/core/models/core.xproto
+++ b/xos/core/models/core.xproto
@@ -338,7 +338,10 @@
}
-message ServiceDependency (Tenant) {
+message ServiceDependency (XOSBase) {
+ required manytoone provider_service->Service:providedDependencies = 1 [help_text = "The service that provides this dependency", null=False, db_index = True, blank=False];
+ required manytoone subscriber_service->Service:subscribedDependencies = 2 [help_text = "The services that subscribes to this dependency", null=False, db_index=True, blank=False];
+ required string connect_method = 3 [max_length = 30, help_text = "method to connect the two services", null=False, blank=False, default="none", choices = "(('none', 'None'), ('private', 'Private'), ('public', 'Public'))"];
}