blob: 372337fec1cd4e7e77814eb2f288cac7a8071b55 [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
Andrea Campanella11237552017-03-21 17:21:20 +010032 copyin_props = ['bwpcfgcbs','bwpcfgebs','bwpcfgcir','bwpcfgeir','name']
33
34class XOSMetronetUNI(XOSResource):
35 provides = "tosca.nodes.EcordUserNetworkInterface"
36 xos_model = UserNetworkInterface
37 copyin_props = ['enabled','capacity','bw_used','vlanIds', 'location', 'latlng', 'name']