Beispiel #1
0
def delete_iam2_organization(uuid, session_uuid=None):
    action = api_actions.DeleteIAM2OrganizationAction()
    action.timeout = 30000
    action.uuid = uuid
    test_util.action_logger('delete IAM2 organization : %s ' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
def delete_vcenter(vcenter_uuid, timeout=240000, session_uuid=None):
    action = api_actions.DeleteVCenterAction()
    action.uuid = vcenter_uuid
    action.timeout = timeout
    test_util.action_logger('Delete VCenter [uuid:] %s' % vcenter_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def get_ip_capacity_by_l3s(l3_network_list, session_uuid = None):
    action = api_actions.GetIpAddressCapacityAction()
    action.l3NetworkUuids = l3_network_list
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger('Get L3s: [%s] IP Capacity' % \
            l3_network_list)
    return evt
def delete_resource_stack(uuid, session_uuid=None):
    action = api_actions.DeleteResourceStackAction()
    action.uuid = uuid
    action.timeout = 240000
    test_util.action_logger('Delete resource stack [uuid:] %s' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def delete_autoScaling_template(uuid,session_uuid=None):
	action = api_actions.DeleteAutoScalingTemplateAction()
        action.time = 30000
        action.uuid = uuid
        test_util.action_logger('Delete autoscaling VM Template :%s' % action.uuid)
        evt = acc_ops.execute_action_with_session(action, session_uuid)
        return evt.success
def del_vm_disk_qos(volume_uuid, session_uuid=None):
    action = api_actions.DeleteVolumeQosAction()
    action.uuid = volume_uuid

    test_util.action_logger('DeleteVolumeQos [volume:] %s' % (volume_uuid))
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
Beispiel #7
0
def get_ip_capacity_by_l3s(l3_network_list, session_uuid=None):
    action = api_actions.GetIpAddressCapacityAction()
    action.l3NetworkUuids = l3_network_list
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger('Get L3s: [%s] IP Capacity' % \
            l3_network_list)
    return evt
Beispiel #8
0
def delete_chassis(chassis_uuid, session_uuid=None):
    action = api_actions.DeleteBaremetalChassisAction()
    action.uuid = chassis_uuid
    action.timeout = 30000
    test_util.action_logger('Delete Chassis [uuid:] %s' % chassis_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
Beispiel #9
0
def power_reset_baremetal(chassis_uuid, session_uuid=None):
    action = api_actions.PowerResetBaremetalHostAction()
    action.chassisUuid = chassis_uuid
    action.timeout = 30000
    test_util.action_logger('PowerReset Chassis [uuid:] %s' % chassis_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
Beispiel #10
0
def expunge_iam2_project(uuid, session_uuid=None):
    action = api_actions.ExpungeIAM2ProjectAction()
    action.timeout = 30000
    action.uuid = uuid
    test_util.action_logger('expunge iam2 project : %s ' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
Beispiel #11
0
def login_iam2_project(project_name, session_uuid=None):
    action = api_actions.LoginIAM2ProjectAction()
    action.timeout = 30000
    action.projectName = project_name
    test_util.action_logger('login iam2 project : %s' % project_name)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
Beispiel #12
0
def delete_role(uuid, session_uuid=None):
    action = api_actions.DeleteRoleAction()
    action.timeout = 30000
    action.uuid = uuid
    test_util.action_logger('delete role  : %s ' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
Beispiel #13
0
def delete_iam2_project_template(uuid, session_uuid=None):
    action = api_actions.DeleteIAM2ProjectTemplateAction()
    action.timeout = 30000
    action.uuid = uuid
    test_util.action_logger('delete IAM2 project template  : %s ' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
Beispiel #14
0
def delete_iam2_virtual_id(uuid, session_uuid=None):
    action = api_actions.DeleteIAM2VirtualIDAction()
    action.timeout = 30000
    action.uuid = uuid
    test_util.action_logger('delete IAM2 virtual id  : %s ' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
def update_instance_offering(instance_offering_option,
                             offering_uuid,
                             system_tags=None,
                             session_uuid=None):
    action = api_actions.UpdateInstanceOfferingAction()
    action.uuid = offering_uuid
    action.cpuNum = instance_offering_option.get_cpuNum()
    #action.cpuSpeed = instance_offering_option.get_cpuSpeed()
    action.memorySize = instance_offering_option.get_memorySize()
    #action.allocatorStrategy = instance_offering_option.get_allocatorStrategy()
    #action.type = instance_offering_option.get_type()
    action.name = instance_offering_option.get_name()
    action.description = instance_offering_option.get_description()
    #action.systemTags += instance_offering_option.get_name()
    if system_tags:
        action.systemTags = system_tags

    #test_util.action_logger('update instance offering: name: %s cpuNum: %s, cpuSpeed: %s, memorySize: %s, allocatorStrategy: %s, type: %s, systemTags: %s '\
    #        % (action.name, action.cpuNum, action.cpuSpeed, action.memorySize, action.allocatorStrategy, action.type, action.systemTags))
    test_util.action_logger('update instance offering: name: %s cpuNum: %s, memorySize: %s, systemTags: %s '\
            % (action.name, action.cpuNum, action.memorySize, action.systemTags))
    evt = account_operations.execute_action_with_session(action, session_uuid)
    test_util.test_logger('Instance Offering: %s is created' %
                          evt.inventory.uuid)
    return evt.inventory
Beispiel #16
0
def start_pxe(pxe_uuid, session_uuid=None):
    action = api_actions.StartBaremetalPxeServerAction()
    action.uuid = pxe_uuid
    action.timeout = 30000
    test_util.action_logger('Start PXE [uuid:] %s' % pxe_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def reinit_vm(vm_uuid, session_uuid=None):
    action = api_actions.ReimageVmInstanceAction()
    action.vmInstanceUuid = vm_uuid

    test_util.action_logger('Reinit [Vm:] %s' % (vm_uuid))
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
Beispiel #18
0
def set_l3_mtu(l3_uuid, mtu, session_uuid=None):
    action = api_actions.SetL3NetworkMtuAction()
    action.l3NetworkUuid = l3_uuid
    action.mtu = mtu
    action.timeout = 300000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("Set [L3:] %s [mtu:] %s" % (l3_uuid, mtu))
Beispiel #19
0
def detach_port_forwarding(pf_rule_uuid, session_uuid=None):
    action = api_actions.DetachPortForwardingRuleAction()
    action.uuid = pf_rule_uuid
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("Port Forwarding Rule [uuid:] %s is detached" %
                            pf_rule_uuid)
    return evt.inventory
Beispiel #20
0
def get_l3_mtu(l3_uuid, session_uuid=None):
    action = api_actions.GetL3NetworkMtuAction()
    action.l3NetworkUuid = l3_uuid
    action.timeout = 300000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("Get [L3:] %s mtu" % l3_uuid)
    return evt.mtu
Beispiel #21
0
def detach_l3(nic_uuid, session_uuid=None):
    action = api_actions.DetachL3NetworkFromVmAction()
    action.vmNicUuid = nic_uuid
    test_util.action_logger('[Detach L3 Network Nic]: %s' % nic_uuid)
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.test_logger('[L3 Network Nic]: %s has been detached' % nic_uuid)
    return evt.inventory
Beispiel #22
0
def delete_vrouter_route_table(vrrt_uuid, session_uuid=None):
    action = api_actions.DeleteVRouterRouteTableAction()
    action.uuid = vrrt_uuid
    action.timeout = 12000
    test_util.action_logger('Delete [VRouter Route Table]: %s' % vrrt_uuid)
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt
def remove_vm_from_affinity_group(affinityGroupUuid, vm_uuid, timeout=240000, session_uuid=None):
    action = api_actions.RemoveVmFromAffinityGroupAction()
    action.affinityGroupUuid = affinityGroupUuid
    action.uuid = vm_uuid
    test_util.action_logger('Remove VM [uuid:] %s to Affinity Group [uuid:] %s' % (affinityGroupUuid, vm_uuid))
    evt = account_operations.execute_action_with_session(action, session_uuid) 
    return evt.inventory
Beispiel #24
0
def destroy_vrouter(vrouter_uuid, session_uuid=None):
    action = api_actions.DestroyVmInstanceAction()
    action.uuid = vrouter_uuid
    action.timeout = 12000
    test_util.test_logger('Destroy vRouter uuid: {}'.format(vrouter_uuid))
    result = acc_ops.execute_action_with_session(action, session_uuid)
    return result.success
def delete_loadbalancer(uuid,session_uuid = None):
	action = api_actions.DeleteLoadBalancerAction()
	action.uuid = uuid
	action.time = 30000
	test_util.action_logger("delete load balancer %s" %(action.uuid))
	evt = acc_ops.execute_action_with_session(action,session_uuid)
	return evt
def get_vm_console_protocol(uuid, session_uuid=None):
    action = api_actions.GetVmConsoleAddressAction()
    action.timeout = 30000
    action.uuid = uuid
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger('Get VM Console protocol:  %s ' % evt.protocol)
    return evt
def attach_port_forwarding(pf_rule_uuid, vm_nic_uuid, session_uuid=None):
    action = api_actions.AttachPortForwardingRuleAction()
    action.ruleUuid = pf_rule_uuid
    action.vmNicUuid = vm_nic_uuid
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("Port Forwarding Rule [uuid:] %s is attached to %s" % (pf_rule_uuid, vm_nic_uuid))
    return evt.inventory
def delete_vip(vip_uuid, session_uuid=None):
    action = api_actions.DeleteVipAction()
    action.timeout = 30000
    action.uuid = vip_uuid
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger('Delete Vip:  %s ' % vip_uuid)
    return evt
def delete_security_group(sg_uuid, session_uuid=None):
    action = api_actions.DeleteSecurityGroupAction()
    action.uuid = sg_uuid
    action.timeout = 12000
    test_util.action_logger('Delete [Security Group:] %s' % sg_uuid)
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt
def get_vm_nic_qos(nic_uuid, session_uuid = None):
    action = api_actions.GetNicQosAction()
    action.uuid = nic_uuid

    test_util.action_logger('GetNicQos [nic:] %s' % (nic_uuid))
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
def reconnect_vr(vr_uuid, session_uuid=None):
    action = api_actions.ReconnectVirtualRouterAction()
    action.vmInstanceUuid = vr_uuid
    action.timeout = 600000
    test_util.action_logger('Reconnect VR VM [uuid:] %s' % vr_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def del_vm_disk_qos(volume_uuid, session_uuid = None):
    action = api_actions.DeleteVolumeQosAction()
    action.uuid = volume_uuid

    test_util.action_logger('DeleteVolumeQos [volume:] %s' % (volume_uuid))
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
def delete_instance_offering(instance_offering_uuid, session_uuid=None):
    action = api_actions.DeleteInstanceOfferingAction()
    action.uuid = instance_offering_uuid
    test_util.action_logger('Delete Instance Offering [uuid:] %s' \
            % instance_offering_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
def suspend_vm(vm_uuid, session_uuid=None):
    action = api_actions.PauseVmInstanceAction()
    action.uuid = vm_uuid
    action.timeout = 240000
    test_util.action_logger('Pause VM [uuid:] %s' % vm_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def get_vm_nic_qos(nic_uuid, session_uuid=None):
    action = api_actions.GetNicQosAction()
    action.uuid = nic_uuid

    test_util.action_logger('GetNicQos [nic:] %s' % (nic_uuid))
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt
def start_vm(vm_uuid, session_uuid=None, timeout=240000):
    action = api_actions.StartVmInstanceAction()
    action.uuid = vm_uuid
    action.timeout = timeout
    test_util.action_logger('Start VM [uuid:] %s' % vm_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
Beispiel #37
0
def create_port_forwarding(pf_rule_creation_option):
    action = api_actions.CreatePortForwardingRuleAction()
    action.name = pf_rule_creation_option.get_name()
    if not action.name:
        action.name = 'test_port_forwarding_rule'

    action.timeout = pf_rule_creation_option.get_timeout()
    if not action.timeout:
        action.timeout = 12000

    action.description = pf_rule_creation_option.get_description()
    session_uuid = pf_rule_creation_option.get_session_uuid()

    action.vipPortStart, action.vipPortEnd = pf_rule_creation_option.get_vip_ports(
    )
    action.privatePortStart, action.privatePortEnd = pf_rule_creation_option.get_private_ports(
    )
    if not action.privatePortStart:
        action.privatePortStart = action.vipPortStart
        action.privatePortEnd = action.vipPortEnd

    action.vipUuid = pf_rule_creation_option.get_vip_uuid()
    action.vmNicUuid = pf_rule_creation_option.get_vm_nic_uuid()
    action.allowedCidr = pf_rule_creation_option.get_allowedCidr()
    action.protocolType = pf_rule_creation_option.get_protocol()
    test_util.action_logger(
        "Create Port Forwarding Rule: [vipUuid:] %s [vm nic:] %s [vip start:] %s [vip end:] %s [pri start:] %s [pri end:] %s [allowedCidr:] %s"
        % (action.vipUuid, action.vmNicUuid, action.vipPortStart,
           action.vipPortEnd, action.privatePortStart, action.privatePortEnd,
           action.allowedCidr))
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt.inventory
Beispiel #38
0
def delete_resource_stack(uuid, session_uuid=None):
    action = api_actions.DeleteResourceStackAction()
    action.uuid = uuid
    action.timeout = 240000
    test_util.action_logger('Delete resource stack [uuid:] %s' % uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
Beispiel #39
0
def delete_eip(eip_uuid, session_uuid=None):
    action = api_actions.DeleteEipAction()
    action.uuid = eip_uuid
    action.timeout = 12000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("[EIP:] %s is deleted" % eip_uuid)
    return evt
def detach_eip(eip_uuid, session_uuid=None):
    action = api_actions.DetachEipAction()
    action.uuid = eip_uuid
    action.timeout = 24000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("[EIP:] %s is detached" % eip_uuid)
    return evt.inventory
Beispiel #41
0
def delete_security_group(sg_uuid, session_uuid=None):
    action = api_actions.DeleteSecurityGroupAction()
    action.uuid = sg_uuid
    action.timeout = 12000
    test_util.action_logger('Delete [Security Group:] %s' % sg_uuid)
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt
def set_l3_mtu(l3_uuid, mtu, session_uuid = None):
    action = api_actions.SetL3NetworkMtuAction()
    action.l3NetworkUuid = l3_uuid
    action.mtu = mtu
    action.timeout = 300000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("Set [L3:] %s [mtu:] %s" % (l3_uuid, mtu))
def reboot_vm(vm_uuid, session_uuid=None):
    action = api_actions.RebootVmInstanceAction()
    action.uuid = vm_uuid
    action.timeout = 240000
    test_util.action_logger('Reboot VM [uuid:] %s' % vm_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def get_l3_mtu(l3_uuid, session_uuid = None):
    action = api_actions.GetL3NetworkMtuAction()
    action.l3NetworkUuid = l3_uuid
    action.timeout = 300000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("Get [L3:] %s mtu" % l3_uuid)
    return evt.mtu
def delete_affinity_group(affinity_group_uuid, timeout=240000, session_uuid=None):
    action = api_actions.DeleteAffinityGroupAction()
    action.uuid = affinity_group_uuid
    action.timeout = timeout
    test_util.action_logger('Delete Affinity Group [uuid:] %s' % affinity_group_uuid)
    evt = account_operations.execute_action_with_session(action, session_uuid)
    return evt.inventory
def delete_vrouter_route_table(vrrt_uuid, session_uuid=None):
    action = api_actions.DeleteVRouterRouteTableAction()
    action.uuid = vrrt_uuid
    action.timeout = 12000
    test_util.action_logger('Delete [VRouter Route Table]: %s' % vrrt_uuid)
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt
def create_alarm(comparisonOperator, period, threshold, namespace, metric_name, type_alarm=None, name=None, repeat_interval=None, labels=None, actions=None, resource_uuid=None, session_uuid=None):
        action = api_actions.CreateAlarmAction()
        test_util.test_logger("%s" %(comparisonOperator))
        action.timeout = 30000
        if name:
                action.name = name
        if not name:
                action.name = 'alarm_01'
        action.comparisonOperator = comparisonOperator
        action.period = period
        action.threshold = threshold
        action.namespace = namespace
        action.metricName = metric_name
        if actions:
                action.actions = actions
        if repeat_interval:
                action.repeatInterval = repeat_interval
        if labels:
                action.labels = labels
        if resource_uuid:
                action.resourceUuid = resource_uuid
        if type_alarm:
                action.type = type_alarm
        test_util.action_logger('Create Alarm: %s ' % name)
        evt = acc_ops.execute_action_with_session(action, session_uuid)
        return evt.inventory
def create_virtual_router_offering(name, cpuNum, memorySize, imageUuid, zoneUuid, managementNetworkUuid, publicNetworkUuid=None, description=None, allocatorStrategy=None, offeringType=None, session_uuid = None):
    action = api_actions.CreateVirtualRouterOfferingAction()
    action.name = name
    action.cpuNum = cpuNum
    action.memorySize = memorySize
    action.imageUuid = imageUuid
    action.zoneUuid = zoneUuid
    action.managementNetworkUuid = managementNetworkUuid
    if publicNetworkUuid != None:
        action.publicNetworkUuid = publicNetworkUuid
    else:
        action.publicNetworkUuid = managementNetworkUuid
    if description != None:
        action.description = description
    if allocatorStrategy != None:
        action.allocatorStrategy = allocatorStrategy
    if offeringType != None:
        action.type = offeringType
    action.timeout = 12000
    test_util.action_logger('create virtual router offering: name: %s cpuNum: %s, memorySize: %s,\
             publicNetworkUuid: %s, managementNetworkUuid: %s, imageUuid: %s '\
            % (action.name, action.cpuNum, action.memorySize,\
             action.publicNetworkUuid, action.managementNetworkUuid, action.imageUuid))
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.test_logger('Virtual Router Offering: %s is created' % evt.inventory.uuid)
    return evt.inventory
def query_vm_install(conditions,session_uuid=None):
	action = api_actions.QueryVmInstanceAction()
	action.conditions = conditions
	action.time = 30000
	test_util.action_logger("query vm instance")
	evt = acc_ops.execute_action_with_session(action, session_uuid)
	return evt
def destroy_vrouter(vrouter_uuid, session_uuid=None):
    action = api_actions.DestroyVmInstanceAction()
    action.uuid = vrouter_uuid
    action.timeout = 12000
    test_util.test_logger('Destroy vRouter uuid: {}'.format(vrouter_uuid))
    result = acc_ops.execute_action_with_session(action, session_uuid)
    return result.success
def create_autoScaling_vmTemplate(l3NetworkUuids,vmInstanceOfferingUuid,imageUuid,defaultL3NetworkUuid,systemTags=None,vmTemplateName=None,vmInstanceName=None,session_uuid=None):
	action = api_actions.CreateAutoScalingVmTemplateAction()
	action.timeout = 30000
	if vmTemplateName:
		action.name = vmTemplateName
	if not vmTemplateName:
		action.name = 'vmTemplate_autoScaling'	
	test_util.test_logger("%s" %(action.name))
	if vmInstanceName:
		action.vmInstanceName = vmInstanceName
	if not vmInstanceName:
		action.vmInstanceName = 'vmm'
	test_util.test_logger("%s" %(action.vmInstanceName))	
	
	action.l3NetworkUuids = l3NetworkUuids
	test_util.test_logger("%s" %(action.l3NetworkUuids))

	action.vmInstanceOfferingUuid = vmInstanceOfferingUuid
	test_util.test_logger("%s" %(action.vmInstanceOfferingUuid))

	action.imageUuid = imageUuid
	test_util.test_logger("%s" %(action.imageUuid))
	
	action.defaultL3NetworkUuid = defaultL3NetworkUuid
	test_util.test_logger("%s" %(action.defaultL3NetworkUuid))

	if systemTags:
        	action.systemTags = systemTags
	#test_util.test_logger("%s" %(action.systemTags))
	test_util.action_logger('Create Vmm Template: %s ' % action.name)
	evt = acc_ops.execute_action_with_session(action, session_uuid)
	return evt.inventory
def delete_certificate(uuid, session_uuid = None):
    action = api_actions.DeleteCertificateAction()
    action.uuid = uuid
    action.timeout = 120000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.test_logger('Delete [Certificate]: %s' % uuid)
    return evt.inventory
def create_port_forwarding(pf_rule_creation_option):
    action = api_actions.CreatePortForwardingRuleAction()
    action.name = pf_rule_creation_option.get_name()
    if not action.name:
        action.name = 'test_port_forwarding_rule'

    action.timeout = pf_rule_creation_option.get_timeout()
    if not action.timeout:
        action.timeout = 12000

    action.description = pf_rule_creation_option.get_description()
    session_uuid = pf_rule_creation_option.get_session_uuid()

    action.vipPortStart, action.vipPortEnd = pf_rule_creation_option.get_vip_ports()
    action.privatePortStart, action.privatePortEnd = pf_rule_creation_option.get_private_ports()
    if not action.privatePortStart:
        action.privatePortStart = action.vipPortStart
        action.privatePortEnd = action.vipPortEnd

    action.vipUuid = pf_rule_creation_option.get_vip_uuid()
    action.vmNicUuid = pf_rule_creation_option.get_vm_nic_uuid()
    action.allowedCidr = pf_rule_creation_option.get_allowedCidr()
    action.protocolType = pf_rule_creation_option.get_protocol()
    test_util.action_logger("Create Port Forwarding Rule: [vipUuid:] %s [vm nic:] %s [vip start:] %s [vip end:] %s [pri start:] %s [pri end:] %s [allowedCidr:] %s" % (action.vipUuid, action.vmNicUuid, action.vipPortStart, action.vipPortEnd, action.privatePortStart, action.privatePortEnd, action.allowedCidr))
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt.inventory
def delete_l3(uuid, session_uuid = None):
    action = api_actions.DeleteL3NetworkAction()
    action.uuid = uuid
    action.timeout = 300000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("[L3:] %s is deleted" % uuid)
    return evt   
def delete_eip(eip_uuid, session_uuid=None):
    action = api_actions.DeleteEipAction()
    action.uuid = eip_uuid
    action.timeout = 12000
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger("[EIP:] %s is deleted" % eip_uuid)
    return evt
def get_l3network_dhcp_ip(l3NetworkUuid, session_uuid=None):
    action = api_actions.GetL3NetworkDhcpIpAddressAction()
    action.l3NetworkUuid = l3NetworkUuid
    action.timeout = 12000
    test_util.test_logger('Get l3 network dhcp ip from L3 uuid: {}'.format(l3NetworkUuid))
    result = acc_ops.execute_action_with_session(action, session_uuid)
    return result.ip
def detach_l3(nic_uuid, session_uuid = None):
    action = api_actions.DetachL3NetworkFromVmAction()
    action.vmNicUuid = nic_uuid
    test_util.action_logger('[Detach L3 Network Nic]: %s' % nic_uuid)
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.test_logger('[L3 Network Nic]: %s has been detached'% nic_uuid)
    return evt.inventory
def add_dns_to_l3(l3_uuid, dns, session_uuid=None):
    action = api_actions.AddDnsToL3NetworkAction()
    action.sessionUuid = session_uuid
    action.dns = dns
    action.l3NetworkUuid = l3_uuid
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    return evt
def get_vm_console_protocol(uuid, session_uuid=None):
    action = api_actions.GetVmConsoleAddressAction()
    action.timeout = 30000
    action.uuid = uuid
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger('Get VM Console protocol:  %s ' % evt.protocol)
    return evt
Beispiel #60
0
def create_zone(zone_name='ZONE1', session_uuid=None):
    action = api_actions.CreateZoneAction()
    action.name = zone_name
    evt = acc_ops.execute_action_with_session(action, session_uuid)
    test_util.action_logger('Add Zone [uuid:] %s [name:] %s' % \
            (evt.uuid, action.name))
    return evt.inventory