Update Tosca to follow the new modeling
Change-Id: I48cb2404762ecaad085fdc9ed3e2f146ddb5b6b0
diff --git a/xos/metronet.m4 b/xos/metronet.m4
index 784af54..60796f9 100644
--- a/xos/metronet.m4
+++ b/xos/metronet.m4
@@ -7,7 +7,7 @@
node_types:
- tosca.nodes.MetroNetworkService:
+ tosca.nodes.MetroNetworkSystem:
derived_from: tosca.nodes.Root
description: >
CORD: The Metro Network Service.
@@ -15,7 +15,13 @@
xos_base_service_caps
properties:
xos_base_props
- xos_base_service_props
+ administrativeState:
+ type: string
+ required: true
+ restUrl:
+ type: string
+ required: false
+
tosca.nodes.MetroNetworkDevice:
derived_from: tosca.nodes.Root
@@ -38,3 +44,6 @@
authType:
type: string
required: false
+ id:
+ type: string
+ required: true
diff --git a/xos/metronet.yaml b/xos/metronet.yaml
index 368cb42..b59e971 100644
--- a/xos/metronet.yaml
+++ b/xos/metronet.yaml
@@ -22,7 +22,7 @@
node_types:
- tosca.nodes.MetroNetworkService:
+ tosca.nodes.MetroNetworkSystem:
derived_from: tosca.nodes.Root
description: >
CORD: The Metro Network Service.
@@ -48,37 +48,13 @@
type: string
required: false
descrption: Replaces/renames this object
- kind:
+ administrativeState:
type: string
- default: generic
- description: Type of service.
- view_url:
+ required: true
+ restUrl:
type: string
required: false
- description: URL to follow when icon is clicked in the Service Directory.
- icon_url:
- type: string
- required: false
- description: ICON to display in the Service Directory.
- enabled:
- type: boolean
- default: true
- published:
- type: boolean
- default: true
- description: If True then display this Service in the Service Directory.
- public_key:
- type: string
- required: false
- description: Public key to install into Instances to allows Services to SSH into them.
- private_key_fn:
- type: string
- required: false
- description: Location of private key file
- versionNumber:
- type: string
- required: false
- description: Version number of Service.
+
tosca.nodes.MetroNetworkDevice:
derived_from: tosca.nodes.Root
@@ -116,3 +92,6 @@
authType:
type: string
required: false
+ id:
+ type: string
+ required: true
diff --git a/xos/tosca/resources/metronetservice.py b/xos/tosca/resources/metronetservice.py
index 7d898c3..f615bf3 100644
--- a/xos/tosca/resources/metronetservice.py
+++ b/xos/tosca/resources/metronetservice.py
@@ -5,19 +5,18 @@
sys.path.append("/opt/tosca")
from translator.toscalib.tosca_template import ToscaTemplate
-from services.metronetwork.models import MetroNetworkService, NetworkDevice
+from services.metronetwork.models import *
from service import XOSService
from xosresource import XOSResource
-class XOSMetroNetworkService(XOSService):
- provides = "tosca.nodes.MetroNetworkService"
- xos_model = MetroNetworkService
- copyin_props = ["view_url", "icon_url", "enabled", "published", "versionNumber"]
-
+class XOSMetroNetworkSystem(XOSResource):
+ provides = "tosca.nodes.MetroNetworkSystem"
+ xos_model = MetroNetworkSystem
+ copyin_props = ["name", "administrativeState", "restUrl"]
class MetroNetworkDevice(XOSResource):
provides = "tosca.nodes.MetroNetworkDevice"
xos_model = NetworkDevice
- copyin_props = ["name", "administrativeState", "username", "password", "authType", "restCtrlUrl"]
+ copyin_props = ["id", "name", "administrativeState", "username", "password", "authType", "restCtrlUrl"]