예제 #1
0
def set_args(name, subparsers):
    """ add arguments, and their options """
    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg("name", help="Storage Name")
    arg("--type",
        help="Storage Type",
        choices=["Replica1", "Replica3", "External", "Replica2"],
        default=None)
    arg("--device",
        help=("Storage device in <node>:<device> format, "
              "Example: --device kube1.example.com:/dev/vdc"),
        default=[],
        action="append")
    arg("--path",
        help=("Storage path in <node>:<path> format, "
              "Example: --path kube1.example.com:/exports/data"),
        default=[],
        action="append")
    arg("--pvc",
        help="Storage from pvc, Example: --pvc local-pvc-1",
        default=[],
        action="append")
    arg("--external",
        help=
        "Storage from external gluster, Example: --external gluster-node:/gluster-volname",
        default=None)
    arg("--tiebreaker",
        help="If type is 'Replica2', one can have a tiebreaker node along "
        "with it. like '--tiebreaker tie-breaker-node-name:/data/tiebreaker'",
        default=None)
    utils.add_global_flags(parser)
예제 #2
0
파일: install.py 프로젝트: leelavg/kadalu
def set_args(name, subparsers):
    """ add arguments to argparser """
    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg(
        "--version",
        help="Kadalu Version to Install [default: " + VERSION + "]",
        choices=[VERSION, "devel"],
        default=VERSION
    )
    arg(
        "--type",
        help="Type of installation - k8s/openshift [default: kubernetes]",
        choices=["openshift", "kubernetes", "microk8s", "rke"],
        default="kubernetes"
    )
    arg(
        "--local-yaml",
        help="local operator yaml file path"
    )
    arg(
        "--local-csi-yaml",
        help="local csi-nodeplugin yaml file path"
    )
    utils.add_global_flags(parser)
예제 #3
0
def set_args(name, subparsers):
    """ add arguments, and their options """

    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg(
        "name",
        help="Storage Name"
    )
    utils.add_global_flags(parser)
예제 #4
0
def set_args(name, subparsers):
    """ add arguments to argparser """
    # TODO: allow check of specific storage pool
    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg("--trigger-full-heal",
        action="store_true",
        help="Trigger full client side self heal on all volumes")

    utils.add_global_flags(parser)
예제 #5
0
def set_args(name, subparsers):
    """ add arguments to argparser """
    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg("name",
        metavar="NAME",
        help="Specify Storage name to delete archived pvc(s)")
    arg("--pvc",
        metavar="PVC",
        default=None,
        help="name of archived pvc belonging to specified storage-pool")
    utils.add_global_flags(parser)
예제 #6
0
def set_args(name, subparsers):
    """ add arguments to argparser """
    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg("--name", metavar="NAME",
        help="Specify Storage name to get info")
    arg("--detail", action="store_true",
        help=("Show detailed information "
              "including Storage units"))
    arg("--status", action="store_true",
        help=("Show status information like number "
              "of PVs, Utilization etc"))
    utils.add_global_flags(parser)
예제 #7
0
def set_args(name, subparsers):
    """ add arguments to argparser """
    # TODO: provide options to pass options to kubectl logs (like tail, container name etc)

    parser = subparsers.add_parser(
        name, formatter_class=argparse.RawTextHelpFormatter)

    arg = parser.add_argument

    arg("-p", "--podname", help="Specify pod name to get log info")

    arg("-c",
        "--container",
        help="Specify container name to get log info.\n"
        "To be used along with '--podname'")

    arg("-A",
        "--allcontainers",
        action="store_true",
        help=("Show logs of all containers"
              "of a particular pod.\n"
              "To be used along with '--podname'"))

    utils.add_global_flags(parser)
예제 #8
0
def set_args(name, subparsers):
    """ add arguments, and their options """
    # TODO: Sub group arguments to relax validation manually
    # https://docs.python.org/3/library/argparse.html#argument-groups
    parser = subparsers.add_parser(name)
    arg = parser.add_argument

    arg("name", help="Storage Name")
    arg("storage_units", help="List of Storage units (Alternate syntax)", nargs="*")
    arg("--storage-unit-type",
        help="Storage Unit Type",
        choices=["path", "pvc", "device"],
        default=None)
    arg("--type",
        help="Storage Type",
        choices=["Replica1", "Replica3", "External", "Replica2", "Disperse"],
        default=None)
    arg("--volume-id",
        help="Volume ID of previously created volume",
        default=None)
    arg("--pv-reclaim-policy",
        help="PV Reclaim Policy",
        choices=["delete", "archive", "retain"],
        default=None)
    arg("--device",
        help=("Storage device in <node>:<device> format, "
              "Example: --device kube1.example.com:/dev/vdc"),
        default=[],
        action="append")
    arg("--path",
        help=("Storage path in <node>:<path> format, "
              "Example: --path kube1.example.com:/exports/data"),
        default=[],
        action="append")
    arg("--pvc",
        help="Storage from pvc, Example: --pvc local-pvc-1",
        default=[],
        action="append")
    arg("--external",
        help=("Storage from external gluster, "
              "Example: --external gluster-node:/gluster-volname"),
        default=None)
    arg("--tiebreaker",
        help=
        ("If type is 'Replica2', one can have a tiebreaker node along "
         "with it. like '--tiebreaker tie-breaker-node-name:/data/tiebreaker'"
         ),
        default=None)
    arg("--gluster-options",
        help=(
            "Can only be used in conjunction with '--external' argument. "
            "Supply options to be used while mounting external gluster cluster"
            "Example: --gluster-options 'log-level=WARNING,"
            "reader-thread-count=2,log-file=/var/log/gluster.log'"
         ),
        default=None)
    arg("--data",
        help="Number of Disperse data Storage units",
        type=int,
        dest="disperse_data",
        default=0)
    arg("--redundancy",
        help="Number of Disperse Redundancy Storage units",
        type=int,
        dest="disperse_redundancy",
        default=0)
    # Default for 'kadalu-format' is set in CRD
    arg("--kadalu-format",
            help=("Specifies whether the  cluster should be provisioned in "
                  "kadalu native (1 PV:1 Subdir) or non-native "
                  "(1 PV: 1 Volume) format. Default: native"),
            choices=["native", "non-native"],
            default=None)
    utils.add_global_flags(parser)
예제 #9
0
def set_args(name, subparsers):
    """ add arguments to argparser """
    # TODO: allow check of specific storage pool
    parser = subparsers.add_parser(name)
    utils.add_global_flags(parser)