pyzkiln_core/zutils/fsutils.py
def allocate_zfs(fs_name: str, volume: str, fs_size: int, extended_size: int):
    """
    Create a zFS Aggregate and File System.

        Parameters:
                  fs_name (str): aggregate name for new zFS file system
                   volume (str): size in megabytes for the VSAM linear data set
                  fs_size (int): secondary size in megabytesfor VSAM data set
            extended_size (int): volume the VSAM linear data set can have space
        Returns:
            Resulting return code of zfsadm define command
            -2 = invalid fs_size or extended_size parameter
        Note: The issuer of the zfsadm define command requires sufficient
              authority to create the VSAM linear data set
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=commands-zfsadm-define
    """
    if fs_size <= 0 or extended_size < 0:
        return -2

    if dry_run_flag:
        logging.info(f"DRY RUN COMMAND: zfsadm define -aggregate -volumes {volume}" +
            f" -megabytes {fs_size} {extended_size}")
        return 0
    else:
        alloc_cmd = subprocess.run(
            [
                "zfsadm",
                "define",
                "-aggregate",
                fs_name,
                "-volumes",
                volume,
                "-megabytes",
                str(fs_size),
                str(extended_size),
            ]
        )
        return alloc_cmd.returncode

    Create a zFS Aggregate and File System.

        Parameters:
                  fs_name (str): aggregate name for new zFS file system
                   volume (str): size in megabytes for the VSAM linear data set
                  fs_size (int): secondary size in megabytesfor VSAM data set
            extended_size (int): volume the VSAM linear data set can have space
        Returns:
            Resulting return code of zfsadm define command
            -2 = invalid fs_size or extended_size parameter
        Note: The issuer of the zfsadm define command requires sufficient
              authority to create the VSAM linear data set
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=commands-zfsadm-define
    
Create a zFS Aggregate and File System.
Create a zFS Aggregate and File System .
def allocate_zfs(fs_name: str, volume: str, fs_size: int, extended_size: int):
    if fs_size <= 0 or extended_size < 0:
        return -2
    if dry_run_flag:
        logging.info(f"DRY RUN COMMAND: zfsadm define -aggregate -volumes {volume}" +
            f" -megabytes {fs_size} {extended_size}")
        return 0
    else:
        alloc_cmd = subprocess.run(
            [
                "zfsadm",
                "define",
                "-aggregate",
                fs_name,
                "-volumes",
                volume,
                "-megabytes",
                str(fs_size),
                str(extended_size),
            ]
        )
        return alloc_cmd.returncode
def allocate_zfs ( fs_name : str , volume : str , fs_size : int , extended_size : int ) : if fs_size <= 0 or extended_size < 0 : return - 2 if dry_run_flag : logging . info ( f"DRY RUN COMMAND: zfsadm define -aggregate -volumes {volume}" + f" -megabytes {fs_size} {extended_size}" ) return 0 else : alloc_cmd = subprocess . run ( [ "zfsadm" , "define" , "-aggregate" , fs_name , "-volumes" , volume , "-megabytes" , str ( fs_size ) , str ( extended_size ) , ] ) return alloc_cmd . returncode
Create a zFS Aggregate and File System.
Create a zFS Aggregate and File System .
"""
    Create a zFS Aggregate and File System.

        Parameters:
                  fs_name (str): aggregate name for new zFS file system
                   volume (str): size in megabytes for the VSAM linear data set
                  fs_size (int): secondary size in megabytesfor VSAM data set
            extended_size (int): volume the VSAM linear data set can have space
        Returns:
            Resulting return code of zfsadm define command
            -2 = invalid fs_size or extended_size parameter
        Note: The issuer of the zfsadm define command requires sufficient
              authority to create the VSAM linear data set
        Doc:
            https://www.ibm.com/docs/en/zos/2.4.0?topic=commands-zfsadm-define
    """
fs_name
str
volume
str
fs_size
int
extended_size
int