diff --git a/src/config/constants.py b/src/config/constants.py index 5f5bb85c4581cccc712925f598b4b894e939e52d..bbf8ba172b8a7f823e15a3a0c9ac9d5501454d5e 100644 --- a/src/config/constants.py +++ b/src/config/constants.py @@ -17,7 +17,7 @@ from pathlib import Path # Default port for NSC deployment -NSC_PORT = 8081 +NSC_PORT = 8086 # Paths BASE_DIR = Path(__file__).resolve().parent.parent.parent diff --git a/src/realizer/tfs/helpers/cisco_connector.py b/src/realizer/tfs/helpers/cisco_connector.py index 503c8c7a910a341537205fa93b2d736f8da4fa96..356012c1f697a8d08d5b222a9b7c2e7ea57d52e6 100644 --- a/src/realizer/tfs/helpers/cisco_connector.py +++ b/src/realizer/tfs/helpers/cisco_connector.py @@ -26,7 +26,7 @@ class cisco_connector(): try: # Configuración del dispositivo device = { - 'device_type': 'cisco_xr', # Esto depende del tipo de dispositivo (ej: 'cisco_ios', 'cisco_xr', 'linux', etc.) + 'device_type': 'cisco_xr', 'host': self.address, 'username': 'cisco', 'password': 'cisco12345', @@ -42,28 +42,27 @@ class cisco_connector(): # Cerrar la conexión connection.disconnect() - except Exception as e: - logging.error(f"Failed to execute commands on {self.address}: {str(e)}") + except EOFError as e: + logging.error("Failed to execute commands on %s: %s",self.address, str(e)) def create_command_template(self, config): - commands = [ "l2vpn", f"pw-class l2vpn_vpws_profile_example_{config['number']}", "encapsulation mpls" ] - + commands.extend([ "transport-mode vlan passthrough", "control-word" ]) - + commands.extend([ f"preferred-path interface tunnel-te {config['number']}", "exit", "exit" ]) - + commands.extend([ "xconnect group l2vpn_vpws_group_example", f"p2p {config['ni_name']}", @@ -72,10 +71,9 @@ class cisco_connector(): "no pw-class l2vpn_vpws_profile_example", f"pw-class l2vpn_vpws_profile_example_{config['number']}" ]) - return commands - + def full_create_command_template(self): commands =[] for config in self.configs: @@ -89,8 +87,7 @@ class cisco_connector(): commands = [ "no l2vpn", ] - + commands.append("commit") commands.append("end") - - return commands \ No newline at end of file + return commands diff --git a/src/templates/IPoWDM_orchestrator.json b/src/templates/IPoWDM_orchestrator.json new file mode 100644 index 0000000000000000000000000000000000000000..60eb0dbaaebca3e0a35d5b9007121119a60443f8 --- /dev/null +++ b/src/templates/IPoWDM_orchestrator.json @@ -0,0 +1,31 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "TAPI LSP"} + }, + "service_type": 12, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "TFS-OPTICAL"}},"endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "TFS-PACKET"}},"endpoint_uuid": {"uuid": "mgmt"}} + + ], + "service_constraints": [], + + "service_config": {"config_rules": [ + {"action": 1, "ipowdm": { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "TFS-PACKET"}}, + "endpoint_uuid": {"uuid": "mgmt"} + }, + "rule_set": { + "src" : [], + "dst" : [] + } + }} + ]} + } + ] +} \ No newline at end of file diff --git a/src/templates/Optical_slice.json b/src/templates/Optical_slice.json new file mode 100644 index 0000000000000000000000000000000000000000..94c87fe03f52b7a10acfc537eb5dbabfc6b4a46b --- /dev/null +++ b/src/templates/Optical_slice.json @@ -0,0 +1,28 @@ +{ + "tapi-common:context" : { + "name" : [ + { + "value" : "" + } + ], + "service-interface-point" : [ + { + "uuid" : "" + }, + { + "uuid" : "" + } + ], + "tapi-topology:topology-context" : { + "topology" : [ + { + "link" : [ + ], + "node" : [ + ] + } + ] + }, + "uuid" : "" + } +} diff --git a/src/templates/TAPI_service.json b/src/templates/TAPI_service.json new file mode 100644 index 0000000000000000000000000000000000000000..1b09a04cb809d0d959340e6d23a15d65f7f372b0 --- /dev/null +++ b/src/templates/TAPI_service.json @@ -0,0 +1,43 @@ +{ + "services": [ + { + "service_id": { + "context_id": {"context_uuid": {"uuid": "admin"}}, + "service_uuid": {"uuid": "TAPI LSP"} + }, + "service_type": 11, + "service_status": {"service_status": 1}, + "service_endpoint_ids": [ + {"device_id": {"device_uuid": {"uuid": "TFS-OPTICAL"}},"endpoint_uuid": {"uuid": "mgmt"}}, + {"device_id": {"device_uuid": {"uuid": "TFS-PACKET"}},"endpoint_uuid": {"uuid": "mgmt"}} + + ], + "service_constraints": [], + + "service_config": {"config_rules": [ + {"action": 1, "tapi_lsp": { + "endpoint_id": { + "device_id": {"device_uuid": {"uuid": "TFS-OPTICAL"}}, + "endpoint_uuid": {"uuid": "mgmt"} + }, + "rule_set": { + "src": "", + "dst": "", + "uuid": "", + "bw": "", + "tenant_uuid": "", + "direction": "", + "layer_protocol_name": "", + "layer_protocol_qualifier": "", + "lower_frequency_mhz": "", + "upper_frequency_mhz": "", + "link_uuid_path": [ + ], + "granularity": "", + "grid_type": "" + } + }} + ]} + } + ] +} \ No newline at end of file