def create_context():
    context = ResourceCommandContext()
    context.resource = ResourceContextDetails()
    context.resource.name = 'Brocy'
    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['Password'] = '******'
    context.resource.attributes['Enable Password'] = '******'
    context.resource.address = '192.168.73.41'
    context.resource.attributes['SNMP Version'] = '2'
    context.resource.attributes['SNMP Read Community'] = 'public'
    context.resource.attributes['Model'] = 'Brocade NOS Switch'
    context.resource.attributes['AdminPassword'] ='******'
    context.resource.attributes['Vendor'] = 'Brocade'

    context.connectivity = ConnectivityContext()
    context.connectivity.admin_auth_token = ''
    context.connectivity.cloudshell_api_port = '8029'
    context.connectivity.quali_api_port = '9000'
    context.connectivity.server_address = 'localhost'


    # context.connectivity.server_address='localhost'
    # context.description ={}
    # context.description['family'] = 'Router'
    # context.description['fullname'] = 'Huawei37'
    # context.description['id'] = 'b476fa1f-379e-435a-b35c-65e892e1c306'
    # context.description['model'] = 'Huaewi VRP Router'
    # context.description['name'] = 'Huawei37'

    return context
Esempio n. 2
0
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
Esempio n. 3
0
    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()
    context.connectivity.server_address = "192.168.85.20"

    dr = TeraVMVbladeDriver()
    dr.initialize(context)

    result = dr.get_inventory(context)

    for resource in result.resources:
        print resource.__dict__
Esempio n. 4
0
    }
    ]
  }
}"""

context = ResourceCommandContext()
context.resource = ResourceContextDetails()
context.resource.name = 'dsada'
context.reservation = ReservationContextDetails()
context.reservation.reservation_id = 'test_id'
context.resource.attributes = {}
context.resource.attributes['User'] = '******'
context.resource.attributes['Password'] = '******'
context.resource.attributes['host'] = 'localhost'
context.resource.address = 'localhost'
context.connectivity = ConnectivityContext()
context.connectivity.admin_auth_token = 'asdas'
context.resource.attributes['SNMP Version'] = '2'
context.resource.attributes['SNMP Read Community'] = 'stargate'

context1 = ResourceCommandContext()
context1.resource = ResourceContextDetails()
context1.resource.name = 'dsada'
context1.reservation = ReservationContextDetails()
context1.reservation.reservation_id = 'test_id'
context1.resource.attributes = {}
context1.resource.attributes['User'] = '******'
context1.resource.attributes['Password'] = '******'
context1.resource.attributes['host'] = 'localhost'
context1.resource.address = 'localhost'
context1.connectivity = ConnectivityContext()