Example #1
0
def vserver_delete(v_name, **connection_args):
    '''
    Delete a lb vserver

    CLI Example:

    .. code-block:: bash

        salt '*' netscaler.vserver_delete 'vserverName'
    '''
    ret = True
    vserver = _vserver_get(v_name, **connection_args)
    if vserver is None:
        return False
    nitro = _connect(**connection_args)
    if nitro is None:
        return False
    try:
        NSLBVServer.delete(nitro, vserver)
    except NSNitroError as e:
        log.debug(
            'netscaler module error - NSVServer.delete() failed: {0}'.format(
                e.message))
        ret = False
    _disconnect(nitro)
    return ret
Example #2
0
def lbvserver_delete(lbvs_name, **connection_args):
    """
    remove/delete sg to a monitor
    CLI Example:
    .. code-block:: bash
        salt '*' netscaler.lbvserver_delete 'lbvsName'
    """
    ret = True
    nitro = _connect(**connection_args)
    if nitro is None:
        return False
    lbvs = NSLBVServer()
    lbvs.set_name(lbvs_name)
    try:
        NSLBVServer.delete(nitro, lbvs)
    except NSNitroError as error:
        log.debug("netscaler module error - NSLBVServer.delete() failed: %s",
                  error)
        ret = False
    _disconnect(nitro)
    return ret
Example #3
0
def vserver_delete(v_name, **connection_args):
    '''
    Delete a lb vserver

    CLI Example:

    .. code-block:: bash

        salt '*' netscaler.vserver_delete 'vserverName'
    '''
    ret = True
    vserver = _vserver_get(v_name, **connection_args)
    if vserver is None:
        return False
    nitro = _connect(**connection_args)
    if nitro is None:
        return False
    try:
        NSLBVServer.delete(nitro, vserver)
    except NSNitroError, e:
        log.debug('netscaler module error - NSVServer.delete() failed: {0}'.format(e.message))
        ret = False
Example #4
0
def vserver_delete(v_name, **connection_args):
    """
    Delete a lb vserver

    CLI Example:

    .. code-block:: bash

        salt '*' netscaler.vserver_delete 'vserverName'
    """
    ret = True
    vserver = _vserver_get(v_name, **connection_args)
    if vserver is None:
        return False
    nitro = _connect(**connection_args)
    if nitro is None:
        return False
    try:
        NSLBVServer.delete(nitro, vserver)
    except NSNitroError as error:
        log.debug("netscaler module error - NSVServer.delete() failed: {0}".format(error))
        ret = False
    _disconnect(nitro)
    return ret