Matteo Scandolo | ddce4ec | 2016-09-26 13:11:03 -0700 | [diff] [blame] | 1 | from xosresource import XOSResource |
Zack Williams | c8e1462 | 2016-10-05 17:59:56 -0700 | [diff] [blame] | 2 | from service import XOSService |
| 3 | from services.metronetwork.models import * |
Matteo Scandolo | 770c49f | 2016-09-23 15:07:38 -0700 | [diff] [blame] | 4 | |
Matteo Scandolo | 9563aeb | 2016-09-28 16:07:58 -0700 | [diff] [blame] | 5 | class XOSMetroNetworkSystem(XOSResource): |
| 6 | provides = "tosca.nodes.MetroNetworkSystem" |
| 7 | xos_model = MetroNetworkSystem |
| 8 | copyin_props = ["name", "administrativeState", "restUrl"] |
Matteo Scandolo | ddce4ec | 2016-09-26 13:11:03 -0700 | [diff] [blame] | 9 | |
| 10 | class MetroNetworkDevice(XOSResource): |
| 11 | provides = "tosca.nodes.MetroNetworkDevice" |
| 12 | xos_model = NetworkDevice |
Matteo Scandolo | 9563aeb | 2016-09-28 16:07:58 -0700 | [diff] [blame] | 13 | copyin_props = ["id", "name", "administrativeState", "username", "password", "authType", "restCtrlUrl"] |
Andrea Campanella | e92c909 | 2017-03-17 10:44:37 +0100 | [diff] [blame] | 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 |
Andrea Campanella | 1123755 | 2017-03-21 17:21:20 +0100 | [diff] [blame] | 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'] |