def snap_create(name, suffix=None):
    '''

    Create a volume snapshot on a Pure Storage FlashArray.

    Will return False is volume selected to snap does not exist.

    .. versionadded:: 2018.3.0

    name : string
        name of volume to snapshot
    suffix : string
        if specificed forces snapshot name suffix. If not specified defaults to timestamp.

    CLI Example:

    .. code-block:: bash

        salt '*' purefa.snap_create foo
        salt '*' purefa.snap_create foo suffix=bar

    '''
    array = _get_system()
    if suffix is None:
        suffix = 'snap-' + six.text_type((datetime.utcnow() - datetime(1970, 1, 1, 0, 0, 0, 0)).total_seconds())
        suffix = suffix.replace('.', '')
    if _get_volume(name, array) is not None:
        try:
            array.create_snapshot(name, suffix=suffix)
            return True
        except purestorage.PureError:
            return False
    else:
        return False
def snap_create ( name , suffix = None ) : array = _get_system ( ) if suffix is None : suffix = 'snap-' + six . text_type ( ( datetime . utcnow ( ) - datetime ( 1970 , 1 , 1 , 0 , 0 , 0 , 0 ) ) . total_seconds ( ) ) suffix = suffix . replace ( '.' , '' ) if _get_volume ( name , array ) is not None : try : array . create_snapshot ( name , suffix = suffix ) return True except purestorage . PureError : return False else : return False
Create a volume snapshot on a Pure Storage FlashArray.

    Will return False is volume selected to snap does not exist.

    .. versionadded:: 2018.3.0

    name : string
        name of volume to snapshot
    suffix : string
        if specificed forces snapshot name suffix. If not specified defaults to timestamp.

    CLI Example:

    .. code-block:: bash

        salt '*' purefa.snap_create foo
        salt '*' purefa.snap_create foo suffix=bar