def wizard_mode_input_args(self):
     self.input_application_name('')
     self.vlan, self.vlan_allocation_mode, self.vlan_range_from, self.vlan_range_to = createVlanPool.input_key_args('')
     self.vmm_provider, self.vmm_domain = createVmmDomain.input_key_args('')
     self.vmm_credential_profile, self.vmm_user, self.vmm_password = createVcenterCredential.input_key_args('')
     self.vcenter_controller, self.host_or_ip, self.data_center = createVcenterController.input_key_args('')
     self.stats_mode = createVcenterController.input_optional_args(True)['stats_mode']
     vmm_domain_associations = add_mos('Add a VMM Domain Association', addVmmDomainAssociation.input_key_args, addVmmDomainAssociation.input_optional_args)
     for vmm_domain_association in vmm_domain_associations:
         arg = {'name': vmm_domain_association['key_args'],
                'optional_args': vmm_domain_association['opt_args']}
         self.vmm_domain_associations.append(arg)
Example #2
0
    ]

    try:
        host_name, user_name, password, args = set_cli_argparse('Delete a vCenter Domain.', key_args)
        vm_provider = args.pop('provider')
        vmm_domain_name = args.pop('domain')

    except SystemExit:

        if check_if_requesting_help(sys.argv):
            sys.exit('Help Page')

        if len(sys.argv)>1:
            print 'Invalid input arguments.'

        host_name, user_name, password = input_login_info()
        vm_provider, vmm_domain_name = input_key_args()

    # Login to APIC
    modir = apic_login(host_name, user_name, password)

    # Execute the main function
    if vm_provider not in ['VMware', 'Microsoft']:
        print 'VM provider has to be either be \"VMware\" or \"Microsoft\"'
    else:
        delete_vmm_domain(modir, vm_provider, vmm_domain_name)

    modir.logout()


Example #3
0
        'help': 'vCenter Domain Name'
    }]

    try:
        host_name, user_name, password, args = set_cli_argparse(
            'Delete a vCenter Domain.', key_args)
        vm_provider = args.pop('provider')
        vmm_domain_name = args.pop('domain')

    except SystemExit:

        if check_if_requesting_help(sys.argv):
            sys.exit('Help Page')

        if len(sys.argv) > 1:
            print 'Invalid input arguments.'

        host_name, user_name, password = input_login_info()
        vm_provider, vmm_domain_name = input_key_args()

    # Login to APIC
    modir = apic_login(host_name, user_name, password)

    # Execute the main function
    if vm_provider not in ['VMware', 'Microsoft']:
        print 'VM provider has to be either be \"VMware\" or \"Microsoft\"'
    else:
        delete_vmm_domain(modir, vm_provider, vmm_domain_name)

    modir.logout()
if __name__ == '__main__':

    # Login
    hostname, username, password = input_login_info(msg='')
    try:
        modir = apic_login(hostname, username, password)
        print 'Login succeed.'
    except KeyError:
        print 'Login fail.'
        sys.exit()

    # Wizard starts asking inputs step by step
    tenant_name = input_tenant_name()
    application_name = input_application_name()
    vlan_pool_array = add_mos(createVlanPool.input_key_args, 'Create a Vlan pool')
    vmm_domain_provider, vmm_domain_name = createVmmDomain.input_key_args()
    vmm_domain_options = createVmmDomain.input_optional_args()
    vcenter_credential_array = add_mos(createVcenterCredential.input_key_args, 'Create a vCenter Domain Credential')
    vcenter_controller = createVcenterController.input_key_args()
    vcenter_controller_options = createVcenterController.input_optional_args()
    vmm_domain_association_array = add_mos_with_options(addVmmDomainAssociation.input_key_args, addVmmDomainAssociation.input_optional_args, 'Add a VMM Domain Association')

    # Running
    for vlan_pool in vlan_pool_array:
        createVlanPool.create_vlan_pool(modir, vlan_pool[0], vlan_pool[1], vlan_pool[2], vlan_pool[3])
    createVmmDomain.create_vmm_domain(modir, vmm_domain_provider, vmm_domain_name, args_from_CLI=vmm_domain_options)
    for vcenter_credential in vcenter_credential_array:
        createVcenterCredential.create_vcenter_credential(modir, vmm_domain_provider, vmm_domain_name, vcenter_credential[0], vcenter_credential[1], vcenter_credential[2])
    createVcenterController.create_vcenter_controller(modir, vmm_domain_provider, vmm_domain_name, vcenter_controller[0], vcenter_controller[1], vcenter_controller[2], args_from_CLI=vcenter_controller_options)
    for vmm_domain_association in vmm_domain_association_array:
        addVmmDomainAssociation.add_vmm_domain_association(modir, tenant_name, application_name, vmm_domain_association[0][0], vmm_domain_association[0][1], args_from_CLI=vmm_domain_association[1])