Andrea Campanella | 65e91e6 | 2017-05-22 17:50:37 +0200 | [diff] [blame] | 1 | from xosresource import XOSResource |
| 2 | from service import XOSService |
| 3 | from services.metronetwork.models import * |
| 4 | |
| 5 | class XOSMetroNetworkSystem(XOSResource): |
| 6 | provides = "tosca.nodes.MetroNetworkSystem" |
| 7 | xos_model = MetroNetworkSystem |
| 8 | copyin_props = ["name", "administrativeState", "restUrl"] |
| 9 | |
| 10 | class MetroNetworkDevice(XOSResource): |
| 11 | provides = "tosca.nodes.MetroNetworkDevice" |
| 12 | xos_model = NetworkDevice |
| 13 | copyin_props = ["id", "name", "administrativeState", "username", "password", "authType", "restCtrlUrl"] |
| 14 | |
| 15 | class 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 | |
| 29 | class XOSMetronetBandwithProficle(XOSResource): |
| 30 | provides = "tosca.nodes.EcordBandwidthProfile" |
| 31 | xos_model = BandwidthProfile |
| 32 | copyin_props = ['bwpcfgcbs','bwpcfgebs','bwpcfgcir','bwpcfgeir','name'] |
| 33 | |
| 34 | class XOSMetronetUNI(XOSResource): |
| 35 | provides = "tosca.nodes.EcordUserNetworkInterface" |
| 36 | xos_model = UserNetworkInterface |
| 37 | copyin_props = ['enabled','capacity','bw_used','vlanIds', 'location', 'latlng', 'name'] |