Rizwan Haider | 30b3379 | 2016-08-18 02:11:18 -0400 | [diff] [blame] | 1 | from xos.logger import Logger, logging |
Rizwan Haider | eb2cc77 | 2016-09-08 12:14:55 -0400 | [diff] [blame] | 2 | from services.metronetwork.models import * |
Rizwan Haider | 30b3379 | 2016-08-18 02:11:18 -0400 | [diff] [blame] | 3 | |
| 4 | logger = Logger(level=logging.INFO) |
| 5 | |
| 6 | |
| 7 | class MetroNetworkProvider(object): |
| 8 | networkdevice = None |
| 9 | |
| 10 | def __init__(self, networkdevice, **args): |
| 11 | self.networkdevice = networkdevice |
| 12 | pass |
| 13 | |
| 14 | # Methods to support for Synchronization - effectively list all interfaces |
| 15 | # |
| 16 | # Method for retrieving all network ports from the backend system |
| 17 | # Intended for use when doing a re-sync |
| 18 | def get_network_ports(self): |
| 19 | # Default method needs to be overriden |
| 20 | logger.debug("get_network_ports default called - should be overriden") |
| 21 | |
| 22 | # Method for getting a list of network ports to delete |
| 23 | # The default imnplementation just gets a list from the local DB |
| 24 | # Intended for use when doing a re-sync |
| 25 | def get_network_ports_for_deletion(self): |
| 26 | # Default method needs to be overriden |
| 27 | logger.debug("get_network_ports for deletion called - default is all ports in the db related to this id") |
| 28 | objs = [] |
Rizwan Haider | 30b3379 | 2016-08-18 02:11:18 -0400 | [diff] [blame] | 29 | return objs |
| 30 | |
| 31 | # Method for retrieving all network links from the backend system |
| 32 | # Includes Connectivity Objects |
| 33 | # Intended for use when doing a re-sync |
| 34 | def get_network_links(self): |
| 35 | # Default method needs to be overriden |
| 36 | logger.debug("get_network_links default called - should be overriden") |
| 37 | objs = [] |
| 38 | return objs |
| 39 | |
| 40 | # Method for getting a list of network links to delete |
| 41 | # Includes Connectivity Objects |
| 42 | # Intended for use when doing a re-sync |
| 43 | def get_network_links_for_deletion(self): |
| 44 | # Default method needs to be overriden |
| 45 | logger.debug("get_network_links for deletion called - should be overidden") |
| 46 | objs = [] |
| 47 | return objs |
| 48 | |
| 49 | # Methods to support Event Management - movement of changes from the Domain to XOS |
| 50 | # |
| 51 | # Method for Create and Update - Create and Update are together given the base design |
| 52 | def get_updated_or_created_objects(self): |
| 53 | # Default method needs to be overriden |
| 54 | logger.debug("get_updated_or_created_objects default called - should be overriden") |
| 55 | objs = [] |
| 56 | return objs |
| 57 | |
| 58 | # Method for Delete - Create and Update are together given the base design |
| 59 | def get_deleted_objects(self): |
| 60 | # Default method needs to be overriden |
| 61 | logger.debug("get_deleted_objects default called - should be overriden") |
| 62 | objs = [] |
| 63 | return objs |
| 64 | |
| 65 | # Methods to support Movement of changes from XOS into the Domain |
| 66 | # |
| 67 | # Method for creating point to point connectivity object |
| 68 | # |
| 69 | # obj - Connection object - with all configuration variables set |
| 70 | # returns - Boolean - indicating whether or not the request succeeded - in either case the Admin/Oper |
| 71 | # states are assigned - if False the backend_status field |
| 72 | # should be assigned with the appropriate error code - in the case of True the |
| 73 | # backend_status will be assigned by the system and should be unassigned |
| 74 | |
| 75 | def create_point_to_point_connectivity(self, obj): |
| 76 | # Default method needs to be overriden |
| 77 | logger.debug("create_point_to_point_connectivity called - should be overriden") |
| 78 | return False |
| 79 | |
| 80 | # Method for deleting point to point connectivity object |
| 81 | # |
| 82 | # obj - Connection object |
| 83 | # returns - Boolean - indicating whether or not the request succeeded - in either case the Admin/Oper |
| 84 | # states are assigned - if False the backend_status field |
| 85 | # should be assigned with the appropriate error code - in the case of True the |
| 86 | # backend_status will be assigned by the system and should be unassigned |
| 87 | def delete_point_to_point_connectivity(self, obj): |
| 88 | # Default method needs to be overriden |
| 89 | logger.debug("delete_point_to_point_connectivity called - should be overriden") |
| 90 | return False |