Esempio n. 1
0
    def arg_info(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Prints out all the information for a user group within an organization"
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument('--name',
                               dest='name',
                               type=str,
                               required=True,
                               help="Name of the user group")
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )

        return doParser
Esempio n. 2
0
    def arg_delete(self):
        doParser = ArgumentParser(
            add_help=True,
            description="Delete one or more categories in the organization")

        optional = doParser.add_argument_group("optional arguments")

        optional.add_argument(
            '--name',
            dest='name',
            nargs='+',
            required=False,
            help=
            "One or more categories to delete (category names provided) in the organization.  Names separated by commas (e.g. cat 1, cat 2, cat 3)."
        )
        optional.add_argument(
            '--ids',
            dest='ids',
            nargs='+',
            required=False,
            help=
            "One or more categories to delete (category Ids provided) in the organization.  Ids separated by commas (e.g. id1, id2, id3)."
        )
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )
        return doParser
Esempio n. 3
0
 def arg_batch(self):
     doParser = ArgumentParser(
         "batch",
         add_help=False,
         description=
         "Execute uforge-cli batch command from a file (for scripting)")
     mandatory = doParser.add_argument_group("mandatory arguments")
     optionnal = doParser.add_argument_group("optional arguments")
     mandatory.add_argument('--file',
                            dest='file',
                            required=True,
                            help="uforge-cli batch file commands")
     optionnal.add_argument(
         '-f',
         '--fatal',
         dest='fatal',
         action='store_true',
         required=False,
         help="exit on first error in batch file (default is to continue)")
     # Help is not call at the doParser declaration because it would create two separate argument group for optional arguments.
     optionnal.add_argument('-h',
                            '--help',
                            action='help',
                            help="show this help message and exit")
     return doParser
Esempio n. 4
0
    def arg_addTargetFormat(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Add one or more target formats to a target platform in the organization"
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--id',
            dest='id',
            type=str,
            required=True,
            help="Id of the target platform where adding target formats.")
        mandatory.add_argument(
            '--targetFormats',
            dest='targetFormats',
            nargs='+',
            required=True,
            help="target format(s) to put in the target platform.")
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )

        return doParser
Esempio n. 5
0
        def arg_list(self):
                doParser = ArgumentParser(add_help=True,description="List enabled operating systems for provided user")

                mandatory = doParser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--account', dest='account', type=str, required=True, help="User name of the account for which the current command should be executed")
                return doParser
Esempio n. 6
0
    def arg_create(self):
        doParser = ArgumentParser(
            add_help=True,
            description="Create one or more categories in the organization")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--name',
            dest='name',
            type=str,
            required=True,
            help="Name of the category to create in the organization.")
        mandatory.add_argument(
            '--type',
            dest='type',
            type=str,
            required=True,
            help=
            "Type of the category to create in the organization. Possible values are : TEMPLATE, PROJECT, IMAGEFORMAT."
        )
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )
        return doParser
Esempio n. 7
0
    def arg_disable(self):
        doParser = ArgumentParser(prog=self.cmd_name + " disable", add_help=True, description="Disable provided user")
        mandatory = doParser.add_argument_group("mandatory arguments")

        mandatory.add_argument('--account', dest='account', required=True,
                               help="user name of the account for which the current command should be executed")
        return doParser
    def arg_enable(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Enable one or more target platforms access for provided user")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument('--account',
                               dest='account',
                               type=str,
                               required=True,
                               help="Enable target platform for provided user")
        mandatory.add_argument(
            '--targetPlatforms',
            dest='targetPlatforms',
            nargs='+',
            type=str,
            required=True,
            help=
            "targetPlatform(s) to enable. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "Organization where the target platform to enable is. If not entered, default organization selected."
        )

        return doParser
Esempio n. 9
0
    def arg_add(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " add",
            add_help=True,
            description=
            "Add one or more entitlements to a role within the specified organization"
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument('--name',
                               dest='name',
                               required=True,
                               help="The name of role")
        mandatory.add_argument(
            '--entitlements',
            dest='entitlements',
            nargs='+',
            required=True,
            help=
            "List of entitlements to add to a role. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        optional.add_argument(
            '--org',
            dest='org',
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )
        return doParser
Esempio n. 10
0
    def arg_add(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " add",
            add_help=True,
            description="Add one or more entitlements to a role within the specified organization",
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument("--name", dest="name", required=True, help="The name of role")
        mandatory.add_argument(
            "--entitlements",
            dest="entitlements",
            nargs="+",
            required=True,
            help="List of entitlements to add to a role. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space.",
        )
        optional.add_argument(
            "--org",
            dest="org",
            required=False,
            help="The organization name. If no organization is provided, then the default organization is used.",
        )
        return doParser
Esempio n. 11
0
    def arg_list(self):
        do_parser = ArgumentParser(
            prog=self.cmd_name + " list",
            add_help=True,
            description="Display the current list of roles for the user")

        mandatory = do_parser.add_argument_group("mandatory arguments")
        optional = do_parser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--account',
            dest='account',
            required=True,
            help=
            "User name of the account for which the current command should be executed"
        )

        optional.add_argument(
            '--org',
            dest='org',
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )
        return do_parser
Esempio n. 12
0
    def arg_delete(self):
        doParser = ArgumentParser(
            add_help=True,
            description="Delete a repository in the organization")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--ids',
            dest='ids',
            nargs='+',
            required=True,
            help=
            "One or more repositories to delete (repository Ids provided) in the organization.  Ids separated by space (e.g. 1 2 3)"
        )
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )

        return doParser
 def arg_remove(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " remove",
         add_help=True,
         description=
         "Remove one or several roles from a subscription profile")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name',
                            dest='name',
                            required=True,
                            help="the name of the subscription profile")
     mandatory.add_argument(
         '--roles',
         dest='roles',
         nargs='+',
         required=True,
         help="the roles to add to the subscription profile")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument(
         '--org',
         dest='org',
         required=False,
         help=
         "the organization name. If no organization is provided, then the default organization is used."
     )
     return do_parser
Esempio n. 14
0
 def arg_list(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " list", add_help=True,
                                description="List the vendors that are part of the Marketplace. Also indicates whether the vendors are active or not.")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--org', dest='org', required=False,
                           help="the organization name. If no organization is provided, then the default organization is used.")
     return do_parser
Esempio n. 15
0
 def arg_info(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " info", add_help=True,
                                description="Displays detailed information about a machine image")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', type=str, required=True,
                            help="the ID of the machine image to retrieve")
     return do_parser
Esempio n. 16
0
 def arg_list(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " list", add_help=True,
                                description="List the vendors registered to the marketplace")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--org', dest='org', required=False,
                           help="the organization name. If no organization is provided, then the default organization is used.")
     return do_parser
Esempio n. 17
0
 def arg_list(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " list", add_help=True,
                                description="List all the roles for a given organization.  If not organization is provided the default organization is used.")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--org', dest='org', required=False,
                           help="the organization name. If no organization is provided, then the default organization is used.")
     return do_parser
Esempio n. 18
0
    def arg_list(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "List all the repositories for the provided organization")

        optional = doParser.add_argument_group("optional arguments")

        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )
        optional.add_argument(
            '--sortField',
            dest='sort',
            type=str,
            required=False,
            help=
            "Sort the repository list by a field between Name, ID, Url and Type"
        )

        return doParser
Esempio n. 19
0
        def arg_info(self):
                doParser = ArgumentParser(add_help = True, description="Get info on provided organization")

                optional = doParser.add_argument_group("optional arguments")

                optional.add_argument('--org', dest='org', type=str, required=False, help="The organization name. If no organization is provided, then the default organization is used.")
                return doParser
Esempio n. 20
0
 def arg_export(self):
     doParser = ArgumentParser(prog=self.cmd_name+" export", add_help = True, description="Exports a template by creating an archive (compressed tar file) that includes the json template configuration file")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the template to export")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--file', dest='file', required=False, help="destination path where to store the template configuration file on the local filesystem")
     return doParser
Esempio n. 21
0
    def arg_list(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " list",
            add_help=True,
            description="List all milestones from a distribution.")

        mandatory = doParser.add_argument_group("mandatory arguments")

        mandatory.add_argument(
            '--darch',
            dest='darch',
            required=True,
            help="Operating system architecture (i386, x86_64).")
        mandatory.add_argument(
            '--dname',
            dest='dname',
            required=True,
            help=
            "Operating system(s) name (for example CentOS, Debian etc) for which the current command should be executed."
        )
        mandatory.add_argument('--dversion',
                               dest='dversion',
                               required=True,
                               help="Operating system version (13, 5.6, ...).")
        return doParser
Esempio n. 22
0
 def arg_run(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " run",
         add_help=True,
         description="Executes a deep scan of a running system")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument(
         '--ip',
         dest='ip',
         required=True,
         help=
         "the IP address or fully qualified hostname of the running system")
     mandatory.add_argument('--scan-login',
                            dest='login',
                            required=True,
                            help="the root user name (normally root)")
     mandatory.add_argument(
         '--name',
         dest='name',
         required=True,
         help="the scan name to use when creating the scan meta-data")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--scan-port',
                           dest='port',
                           required=False,
                           help="the ssh port of the running system")
     optional.add_argument(
         '--scan-password',
         dest='password',
         required=False,
         help="the root password to authenticate to the running system")
     optional.add_argument(
         '--dir',
         dest='dir',
         required=False,
         help=
         "the directory where to install the uforge-scan.bin binary used to execute the deep scan"
     )
     optional.add_argument(
         '--exclude',
         dest='exclude',
         nargs='+',
         required=False,
         help=
         "a list of directories or files to exclude during the deep scan")
     optional.add_argument(
         '-o',
         '--overlay',
         dest='overlay',
         action='store_true',
         required=False,
         help="perform a scan with overlay into the given scanned instance")
     optional.add_argument(
         '--identity-file',
         dest='id_file',
         required=False,
         help=
         "the file containing the private ssh key used to connect to the source machine"
     )
     return do_parser
Esempio n. 23
0
 def arg_clone(self):
     doParser = ArgumentParser(prog=self.cmd_name+" clone", add_help = True, description="Clones the bundle. The clone is copying the meta-data of the bundle")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the bundle to clone")
     mandatory.add_argument('--name', dest='name', required=True, help="the name to use for the new cloned bundle")
     mandatory.add_argument('--version', dest='version', required=True, help="the version to use for the cloned bundle")
     return doParser
Esempio n. 24
0
 def arg_launch(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " launch", add_help=True,
                               description="Launches a migration")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True,
                            help="yaml/json file providing the migration configuration")
     return do_parser
Esempio n. 25
0
    def arg_remove(self):
        do_parser = ArgumentParser(
            prog=self.cmd_name + " remove",
            add_help=True,
            description=
            "Remove one or more entitlements to a role within the specified organization"
        )

        mandatory = do_parser.add_argument_group("mandatory arguments")

        mandatory.add_argument(
            '--account',
            dest='account',
            required=True,
            help=
            "user name of the account for which the current command should be executed"
        )
        mandatory.add_argument(
            '--roles',
            dest='roles',
            nargs='+',
            required=True,
            help=
            "a list of roles to be removed (example: --roles \"role1 role2 role3\")."
        )
        return do_parser
Esempio n. 26
0
    def arg_disable(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Disable one or more target formats for the provided organization."
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--targetFormats',
            dest='targetFormats',
            nargs='+',
            required=True,
            help=
            "Target Format(s) for which the current command should be executed. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )

        return doParser
Esempio n. 27
0
 def arg_add(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " add",
         add_help=True,
         description="Add a user as a subscription profile administrator.")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name',
                            dest='name',
                            required=True,
                            help="the name of the subscription profile")
     mandatory.add_argument(
         '--admins',
         dest='admins',
         nargs='+',
         required=True,
         help=
         "the login names to add as new subscription profile administrators."
     )
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument(
         '--org',
         dest='org',
         required=False,
         help=
         "the organization name. If no organization is provided, then the default organization is used."
     )
     return do_parser
Esempio n. 28
0
 def arg_build(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " build",
         add_help=True,
         description="Builds a machine image from the template")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument(
         '--file',
         dest='file',
         required=True,
         help="yaml/json file providing the builder parameters")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--id',
                           dest='id',
                           required=False,
                           help="id of the template to build")
     optional.add_argument('--junit',
                           dest='junit',
                           required=False,
                           help="name of junit XML output file")
     optional.add_argument(
         '--simulate',
         dest='simulated',
         action='store_true',
         help=
         'Simulate the generation (only the Checking Dependencies process will be executed)',
         required=False)
     optional.add_argument('--force',
                           dest='forced',
                           action='store_true',
                           help='Force the checking dependencies',
                           required=False)
     return doParser
Esempio n. 29
0
    def arg_remove(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Remove user account from the default organization or from the provided one"
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--account',
            dest='account',
            type=str,
            required=True,
            help=
            "User name of the account for which the current command should be executed"
        )
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization where the user is/will be a member/administrator (depending on command context). If no organization is provided, then the default organization is used."
        )

        return doParser
Esempio n. 30
0
 def arg_export(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " export",
         add_help=True,
         description=
         "Exports a template by creating an archive (compressed tar file) that includes the template configuration file"
     )
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id',
                            dest='id',
                            required=True,
                            help="the ID of the template to export")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument(
         '--file',
         dest='file',
         required=False,
         help=
         "destination path where to store the template configuration file on the local filesystem"
     )
     optional.add_argument(
         '--outputFormat',
         dest='output_format',
         required=False,
         help=
         "output format (yaml or json) of the template file to export (yaml is the default one)"
     )
     return doParser
Esempio n. 31
0
 def arg_import(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " import",
         add_help=True,
         description="Creates a template from an archive")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file',
                            dest='file',
                            required=True,
                            help="the path of the archive")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument(
         '-f',
         '--force',
         dest='force',
         action='store_true',
         help=
         'force template creation (delete template/bundle if already exist)',
         required=False)
     optional.add_argument(
         '-r',
         '--rbundles',
         dest='rbundles',
         action='store_true',
         help=
         'if a bundle already exists, use it in the new template. Warning: this option ignore the content of the bundle described in the template file',
         required=False)
     optional.add_argument('--usemajor',
                           dest='use_major',
                           action='store_true',
                           help='use distribution major version if exit',
                           required=False)
     optional.set_defaults(force=False)
     optional.set_defaults(use_major=False)
     return doParser
Esempio n. 32
0
    def arg_disable(self):
        doParser = ArgumentParser(prog=self.cmd_name + " disable", add_help=True, description="Disable provided user. This is restricted to administrators.")
        mandatory = doParser.add_argument_group("mandatory arguments")

        mandatory.add_argument('--account', dest='account', required=True,
                               help="user name of the account for which the current command should be executed")
        return doParser
Esempio n. 33
0
 def arg_delete(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " delete",
         add_help=True,
         description="Deletes an existing instance or scan")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id',
                            dest='id',
                            required=True,
                            help="the ID of the instance or scan to delete")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument(
         '--scantype',
         dest='scantype',
         required=False,
         help=
         "the scan type, values is [instance|scan|all] (default is scan)")
     optional.add_argument(
         '--scansonly',
         dest='scansonly',
         required=False,
         action='store_true',
         help=
         "if scan type is instance, and this argument is used, will only remove the scans not the instance itself"
     )
     return doParser
Esempio n. 34
0
    def arg_remove(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " remove",
            add_help=True,
            description="Remove a milestone from an operating system.")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--darch',
            dest='darch',
            required=True,
            help="Operating system architecture (i386, x86_64).")
        mandatory.add_argument(
            '--dname',
            dest='dname',
            required=True,
            help=
            "Operating system(s) name (for example CentOS, Debian etc) for which the current command should be executed."
        )
        mandatory.add_argument('--dversion',
                               dest='dversion',
                               required=True,
                               help="Operating system version (13, 5.6, ...).")
        mandatory.add_argument('--name',
                               dest='name',
                               required=True,
                               help="The name of the milestone.")
        return doParser
Esempio n. 35
0
    def arg_listTargetPlatform(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "List all target platform in the provided target format in the organization"
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--id',
            dest='id',
            type=str,
            required=True,
            help="Id of the target format you want to list target platforms.")
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )

        return doParser
Esempio n. 36
0
    def arg_update(self):
        doParser = ArgumentParser(add_help=True, description="Update a repository in the organisation")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            "--id", dest="id", type=int, required=True, help="Id of the repository to update in the organization."
        )
        optional.add_argument(
            "--repoUrl",
            dest="repoUrl",
            type=str,
            required=False,
            help="Url of the repository to update in the organization.",
        )
        optional.add_argument(
            "--type",
            dest="type",
            type=str,
            required=False,
            help="Type of the repository to update in the organization.",
        )
        optional.add_argument(
            "--org",
            dest="org",
            type=str,
            required=False,
            help="The organization name. If no organization is provided, then the default organization is used.",
        )

        return doParser
Esempio n. 37
0
    def arg_removeTargetPlatform(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Remove one or more target platforms from a target format in the organization"
        )

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--id',
            dest='id',
            type=str,
            required=True,
            help="Id of the target format to remove to target platforms.")
        mandatory.add_argument(
            '--targetPlatforms',
            dest='targetPlatforms',
            nargs='+',
            required=True,
            help="target platform(s) in which remove the target format.")
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "The organization name. If no organization is provided, then the default organization is used."
        )

        return doParser
Esempio n. 38
0
    def arg_add(self):
        doParser = ArgumentParser(add_help=True, description="Add an operating system for the provided organization")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            "--arch", dest="arch", type=str, required=True, help="Operating system architecture (i386, x86_64)."
        )
        mandatory.add_argument(
            "--name",
            dest="name",
            type=str,
            required=True,
            help="Operating system(s) name (for example CentOS, Debian etc) for which the current command should be executed.",
        )
        mandatory.add_argument(
            "--version", dest="version", type=str, required=True, help="Operating system version (13, 5.6, ...)"
        )
        optional.add_argument(
            "--org",
            dest="org",
            type=str,
            required=False,
            help="The organization name. If no organization is provided, then the default organization is used.",
        )

        return doParser
Esempio n. 39
0
 def arg_remove(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " remove",
         add_help=True,
         description=
         "Remove a user as an administrator of subscription profiles")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name',
                            dest='name',
                            required=True,
                            help="the name of the subscription profile")
     mandatory.add_argument(
         '--admins',
         dest='admins',
         nargs='+',
         required=True,
         help=
         "the login names of the users to be removed from the the subscription profile administrators"
     )
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument(
         '--org',
         dest='org',
         required=False,
         help=
         "the organization name. If no organization is provided, then the default organization is used."
     )
     return do_parser
Esempio n. 40
0
    def arg_add(self):
        do_parser = ArgumentParser(
            prog=self.cmd_name + " add",
            add_help=True,
            description=
            "Add one or more roles to the user (note the role(s) must exist in the organization where the user is a member)"
        )

        mandatory = do_parser.add_argument_group("mandatory arguments")
        optional = do_parser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--account',
            dest='account',
            required=True,
            help=
            "user name of the account for which the current command should be executed"
        )
        mandatory.add_argument(
            '--roles',
            dest='roles',
            nargs='+',
            required=True,
            help=
            "a list of roles to be added to this user (example: --roles \"role1 role2 role3\"). For a list of available roles, run the command: uforge role list --org <org name>"
        )

        optional.add_argument(
            '--org',
            dest='org',
            required=False,
            help=
            "the organization name. If no organization is provided, then the default organization is used."
        )
        return do_parser
Esempio n. 41
0
 def arg_create(self):
     doParser = ArgumentParser(prog=self.cmd_name+" create", add_help = True, description="Create a new bundle and save to the UForge server")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True, help="yaml/json file containing the bundle content")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--archive-path', dest='archive_path', required=False, help="path of where to store the archive of the created bundle. If provided hammr, creates an archive of the created bundle, equivalent to running bundle export")
     return doParser
Esempio n. 42
0
    def arg_create(self):
        doParser = ArgumentParser(add_help=True,
                                  description="Create new organization")

        mandatory = doParser.add_argument_group("mandatory arguments")
        optional = doParser.add_argument_group("optional arguments")

        mandatory.add_argument(
            '--org',
            dest='org',
            type=str,
            required=True,
            help="Name of organization which should be created.")
        optional.add_argument(
            '--autoActivate',
            dest='autoActivate',
            action="store_true",
            required=False,
            help="Flag to tell if organization auto activates new users or not."
        )
        optional.add_argument(
            '--hasStore',
            dest='hasStore',
            action="store_true",
            required=False,
            help="Flag to tell if organization has a Store or not.")
        return doParser
Esempio n. 43
0
 def arg_create(self):
     doParser = ArgumentParser(prog=self.cmd_name + " create", add_help=True,
                               description="Creates a new cloud account")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True,
                            help="yaml/json file providing the cloud account parameters")
     return doParser
Esempio n. 44
0
 def arg_import(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " import", add_help=True, description="Creates a template from an archive"
     )
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument("--file", dest="file", required=True, help="the path of the archive")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument(
         "-f",
         "--force",
         dest="force",
         action="store_true",
         help="force template creation (delete template/bundle if already exist)",
         required=False,
     )
     optional.add_argument(
         "-r",
         "--rbundles",
         dest="rbundles",
         action="store_true",
         help="if a bundle already exists, use it in the new template. Warning: this option ignore the content of the bundle described in the template file",
         required=False,
     )
     optional.add_argument(
         "--usemajor",
         dest="use_major",
         action="store_true",
         help="use distribution major version if exit",
         required=False,
     )
     optional.set_defaults(force=False)
     optional.set_defaults(use_major=False)
     return doParser
Esempio n. 45
0
 def arg_update(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " update",
         add_help=True,
         description="Updates a new subscription profile")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument(
         '--name',
         dest='name',
         required=True,
         help="the name of the subscription profile to update")
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument(
         '--description',
         dest='description',
         required=False,
         help="the description of the subscription profile to update")
     optional.add_argument(
         '--active',
         dest='active',
         required=False,
         help="flag to make the subscription profile active.")
     optional.add_argument(
         '--org',
         dest='org',
         required=False,
         help=
         "the organization name. If no organization is provided, then the default organization is used."
     )
     return do_parser
Esempio n. 46
0
 def arg_publish(self):
     doParser = ArgumentParser(prog=self.cmd_name+" publish", add_help = True, description="Publish (upload and register) a built machine image to a target environment")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True, help="json file providing the cloud account parameters required for upload and registration")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--id',dest='id',required=False, help="id of the image to publish")
     return doParser
Esempio n. 47
0
 def arg_build(self):
     doParser = ArgumentParser(prog=self.cmd_name + " build", add_help=True,
                               description="Builds a machine image from a scan")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True,
                            help="the ID of the scan to generate the machine image from")
     mandatory.add_argument('--file', dest='file', required=True, help="yaml/json file providing the builder parameters")
     return doParser
Esempio n. 48
0
        def arg_list(self):
                doParser = ArgumentParser(add_help = True, description="List all the formats (enabled and disabled) for the provided organization")

                optional = doParser.add_argument_group("optional arguments")

                optional.add_argument('--org', dest='org', type=str, required=False, help="The organization name. If no organization is provided, then the default organization is used.")

                return doParser
Esempio n. 49
0
 def arg_export(self):
     doParser = ArgumentParser(prog=self.cmd_name+" export", add_help = True, description="Exports a bundle by creating an archive (compressed tar file) that includes the bundle configuration file")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the bundle to export")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--file', dest='file', required=False, help="destination path where to store the bundle configuration file on the local filesystem")
     optional.add_argument('--outputFormat', dest='output_format', required=False, help="output format (yaml or json) of the bundle file to export (yaml is the default one)")
     return doParser
Esempio n. 50
0
        def arg_remove(self):
                do_parser = ArgumentParser(prog=self.cmd_name + " remove", add_help=True, description="Remove one or more entitlements to a role within the specified organization")

                mandatory = do_parser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--account', dest='account', required=True, help="user name of the account for which the current command should be executed")
                mandatory.add_argument('--roles', dest='roles', nargs='+', required=True, help="a list of roles to be removed (example: --roles \"role1 role2 role3\").")
                return do_parser
Esempio n. 51
0
 def arg_delete(self):
     doParser = ArgumentParser(prog=self.cmd_name+" delete", add_help = True, description="Deletes an existing template")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the template to delete")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--no-confirm',dest='no_confirm',action='store_true', required=False, help="do not print confirmation dialog")
     optional.set_defaults(no_confirm=False)
     return doParser
Esempio n. 52
0
        def arg_info(self):
                doParser = ArgumentParser(add_help = True, description="Set the quota of api keys the user can create")

                mandatory = doParser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--account', dest='account', type=str, required=True, help="User name of the account for which the current command should be executed")

                return doParser
Esempio n. 53
0
 def arg_download(self):
     doParser = ArgumentParser(prog=self.cmd_name + " download", add_help=True,
                               description="Downloads a machine image to the local filesystem")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the machine image to download")
     mandatory.add_argument('--file', dest='file', required=True,
                            help="the pathname where to store the machine image")
     return doParser
Esempio n. 54
0
        def arg_list(self):
                doParser = ArgumentParser(add_help=True, description="List all the user groups for a given organization.  If not organization is provided the default organization is used.")

                optional = doParser.add_argument_group("optional arguments")

                optional.add_argument('--org', dest='org', type=str, required=False, help="The organization name. If no organization is provided, then the default organization is used.")

                return doParser
Esempio n. 55
0
 def arg_deploy(self):
     doParser = ArgumentParser(prog=self.cmd_name + " deploy", add_help=True,
                               description="Deploy an instance of a published image on the targeted cloud.")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file', dest='file', required=True,
                            help="yaml/json file providing the instance parameters required for deployment on targeted cloud")
     mandatory.add_argument('--publish-id', dest='pid', required=True,
                            help="the ID of the published image to deploy")
     return doParser
Esempio n. 56
0
        def arg_enable(self):
                doParser = ArgumentParser(add_help = True, description="Enable one or more formats for the provided organization")

                mandatory = doParser.add_argument_group("mandatory arguments")
                optional = doParser.add_argument_group("optional arguments")

                optional.add_argument('--org', dest='org', type=str, required=False, help="The organization name. If no organization is provided, then the default organization is used.")
                mandatory.add_argument('--formats', dest='format', nargs='+', required=True, help="Format(s) for which the current command should be executed. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space.")
                return doParser
Esempio n. 57
0
 def arg_validate(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " validate",
         add_help=True,
         description="Validates the syntax of a template configuration file",
     )
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument("--file", dest="file", required=True, help="the yaml/json template configuration file")
     return doParser
Esempio n. 58
0
        def arg_list(self):
                doParser = ArgumentParser(prog=self.cmd_name + " list", add_help=True, description="List all milestones from a distribution.")

                mandatory = doParser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--darch', dest='darch', required=True, help="Operating system architecture (i386, x86_64).")
                mandatory.add_argument('--dname', dest='dname', required=True, help="Operating system(s) name (for example CentOS, Debian etc) for which the current command should be executed.")
                mandatory.add_argument('--dversion', dest='dversion', required=True, help="Operating system version (13, 5.6, ...).")
                return doParser
Esempio n. 59
0
        def arg_info(self):
                doParser = ArgumentParser(add_help = True, description="Retrieve detailed information of a generated image")

                mandatory = doParser.add_argument_group("mandatory arguments")

                mandatory.add_argument('--id', dest='id', type=str, required=True, help="The unique identifier of the image to retrieve")
                mandatory.add_argument('--account', dest='account', type=str, required=True, help="The account on which you want to get the image info")

                return doParser