blob: 3ed5e59fbb3d3dc656e66ddac3eb4568f2662aae [file] [log] [blame]
Matteo Scandoloddce4ec2016-09-26 13:11:03 -07001from xosresource import XOSResource
Zack Williamsc8e14622016-10-05 17:59:56 -07002from service import XOSService
3from services.metronetwork.models import *
Matteo Scandolo770c49f2016-09-23 15:07:38 -07004
Matteo Scandolo9563aeb2016-09-28 16:07:58 -07005class XOSMetroNetworkSystem(XOSResource):
6 provides = "tosca.nodes.MetroNetworkSystem"
7 xos_model = MetroNetworkSystem
8 copyin_props = ["name", "administrativeState", "restUrl"]
Matteo Scandoloddce4ec2016-09-26 13:11:03 -07009
10class MetroNetworkDevice(XOSResource):
11 provides = "tosca.nodes.MetroNetworkDevice"
12 xos_model = NetworkDevice
Matteo Scandolo9563aeb2016-09-28 16:07:58 -070013 copyin_props = ["id", "name", "administrativeState", "username", "password", "authType", "restCtrlUrl"]
Andrea Campanellae92c9092017-03-17 10:44:37 +010014
15class VnodGlobalService(XOSService):
16 provides = "tosca.nodes.VNodGlobalService"
17 xos_model = VnodGlobalService
18 copyin_props = ["view_url", "icon_url", "enabled", "published", "public_key", "versionNumber"]
19
20 def get_xos_args(self):
21 args = super(VnodGlobalService, self).get_xos_args()
22
23 profile = self.get_requirement("tosca.relationships.UsesBandwidthProfile", throw_exception=False)
24 if profile:
25 profile = self.get_xos_object(BandwidthProfile, name=profile)
26 args["bandwidthProfile"] = profile
27 return args
28
29class XOSMetronetBandwithProficle(XOSResource):
30 provides = "tosca.nodes.EcordBandwidthProfile"
31 xos_model = BandwidthProfile
32 copyin_props = ['bwpcfgcbs','bwpcfgebs','bwpcfgcir','bwpcfgeir','name']