def create_context(): context = ResourceCommandContext() context.resource = ResourceContextDetails() context.resource.name = 'Huawei37' context.reservation = ReservationContextDetails() context.reservation.reservation_id = '5695cf87-a4f3-4447-a08a-1a99a936010e' context.reservation.owner_user = '******' context.reservation.owner_email = '*****@*****.**' context.reservation.environment_path = 'Environment-6-7-2016 15-25' context.reservation.environment_name = 'Environment-6-7-2016 15-25' context.reservation.domain = 'Global' context.resource.attributes = {} context.resource.attributes['CLI Connection Type'] = 'SSH' context.resource.attributes['User'] = '******' context.resource.attributes['AdminUser'] = '******' context.resource.attributes[ 'Console Password'] = '******' context.resource.attributes['Password'] = '******' context.resource.attributes[ 'Enable Password'] = '******' context.resource.address = '172.19.47.74' context.resource.attributes['SNMP Version'] = '2' context.resource.attributes['SNMP Read Community'] = 'Test1234' context.resource.attributes['Model'] = 'Enterprises.2011.2.23.339' context.resource.attributes['AdminPassword'] = '******' context.resource.attributes['Vendor'] = 'huawei' context.resource.attributes['Enable SNMP'] = 'True' context.resource.attributes['Disable SNMP'] = 'False' context.resource.attributes['CLI TCP Port'] = '0' context.resource.attributes['Sessions Concurrency Limit'] = 2 context.resource.name = '2950' return context
def create_context(): context = ResourceCommandContext() context.resource = ResourceContextDetails() context.resource.name = 'TestCenter Controller 1' context.reservation = ReservationContextDetails() context.reservation.reservation_id = 'bc3aa7d1-7d66-4365-b419-65b90ece4d0f' context.reservation.owner_user = '******' context.reservation.owner_email = '*****@*****.**' context.reservation.environment_path = 'config1' context.reservation.environment_name = 'config1' context.reservation.domain = 'Global' context.resource.attributes = {} context.resource.attributes[ 'Client Install Path'] = 'C:\Program Files (x86)\Spirent Communications\Spirent TestCenter 4.52' context.resource.address = 'localhost' return context
def get_context(): address = '10.5.1.127' user = '******' password = '******' reservation_id = 'b5c298ed-72c4-4379-b86d-4e43eb679b36' # port = 1222 # enable_password = '******' # auth_key = 'h8WRxvHoWkmH8rLQz+Z/pg==' api_port = 8029 context = ResourceCommandContext() context.resource = ResourceContextDetails() context.resource.name = 'dsada' context.resource.fullname = 'TestAireOS' context.reservation = ReservationContextDetails() context.reservation.reservation_id = reservation_id context.reservation.domain = 'Global' context.resource.attributes = {} context.resource.attributes['User'] = user context.resource.attributes['Password'] = password context.resource.attributes['host'] = address # context.resource.attributes['Enable Password'] = enable_password # context.resource.attributes['Port'] = port # context.resource.attributes['Backup Location'] = 'tftp://172.25.10.96/AireOS_test' context.resource.attributes[ 'Backup Location'] = 'ftp://*****:*****@192.168.85.23' context.resource.address = address context.connectivity = ConnectivityContext() # context.connectivity.admin_auth_token = auth_key context.connectivity.server_address = '10.5.1.2' context.connectivity.cloudshell_api_port = api_port context.resource.attributes['SNMP Version'] = '2' context.resource.attributes['SNMP Read Community'] = 'public' context.resource.attributes['CLI Connection Type'] = 'ssh' context.resource.attributes['Enable SNMP'] = 'False' context.resource.attributes['Disable SNMP'] = 'False' context.resource.attributes['CLI Connection Type'] = 'ssh' context.resource.attributes['Sessions Concurrency Limit'] = '1' return context
from cloudshell.shell.core.context import ResourceCommandContext, ResourceContextDetails, ReservationContextDetails address = '192.168.42.222' user = '******' password = '******' port = 443 scheme = "https" auth_key = 'h8WRxvHoWkmH8rLQz+Z/pg==' api_port = 8029 context = ResourceCommandContext() context.resource = ResourceContextDetails() context.resource.name = 'dd_5915-07f0' context.resource.fullname = 'dd_5915-07f0' context.reservation = ReservationContextDetails() context.reservation.reservation_id = '0cc17f8c-75ba-495f-aeb5-df5f0f9a0e97' context.resource.attributes = {} context.resource.attributes['User'] = user context.resource.attributes['Password'] = password context.resource.attributes['TVM Comms Network'] = "TVM_Comms_VLAN_99" context.resource.attributes['TVM MGMT Network'] = "TMV_Mgmt" context.resource.address = address context.resource.app_context = mock.MagicMock(app_request_json=json.dumps( { "deploymentService": { "cloudProviderName": "vCenter" } })) context.connectivity = mock.MagicMock()
def _init_reservation_model(): reservation_context = ReservationContextDetails() reservation_model = ReservationModel(reservation_context) reservation_model.reservation_id = "77bf1176-25d2-4dd0-ac58-05f8aee534a5" return reservation_model