Esempio n. 1
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. 2
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. 3
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. 4
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. 5
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. 6
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. 7
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. 8
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. 9
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. 10
0
 def arg_info(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " info", add_help=True,
                                description="Prints out all the details of a specified role within an organization")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name', dest='name', required=True, help="name of the role")
     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. 11
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.")
                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. 12
0
        def arg_info(self):
                doParser = ArgumentParser(prog=self.cmd_name + " info", add_help=True, description="Get detailed information on a subscription profile within an 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 the subscription profile")
                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. 13
0
 def arg_delete(self):
     do_parser = ArgumentParser(prog=self.cmd_name + " delete", add_help=True,
                                description="Delete a role from the specified organization")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name', dest='name', required=True, help="name of the role")
     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_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. 15
0
        def arg_disable(self):
                doParser = ArgumentParser(prog=self.cmd_name + " disable", add_help=True, description="Disables a subscription profile within an organization (cannot be used to reate users).")

                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 the subscription profile to update")
                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. 16
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")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--file', dest='file', required=False,
                            help="the pathname where to store the machine image")
     return doParser
Esempio n. 17
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. 18
0
 def arg_terminate(self):
     doParser = ArgumentParser(prog=self.cmd_name + " terminate", add_help=True,
                               description="Terminate a deployment")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True,
                            help="id of the deployment to terminate")
     optional = doParser.add_argument_group("optional arguments")
     optional.add_argument('--force', '-f', dest='force', required=False, action='store_true',
                           help='Terminate the deployment without asking for confirmation')
     return doParser
Esempio n. 19
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. 20
0
        def arg_delete(self):
                doParser = ArgumentParser(add_help=True, description="Delete an user group from the specified 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
        def arg_delete(self):
                doParser = ArgumentParser(add_help=True, description="Delete 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 to delete 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. 22
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="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. 23
0
        def arg_remove(self):
                doParser = ArgumentParser(prog=self.cmd_name + " remove", add_help=True, description="Remove one or several roles from a subscription profile")

                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 the subscription profile")
                mandatory.add_argument('--roles', dest='roles', nargs='+', required=True, help="the roles to add to the subscription profile")
                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. 24
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. 25
0
        def arg_list(self):
                doParser = ArgumentParser(add_help = True, description="List distributions belonging to a repository in the organization")

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

                mandatory.add_argument('--repoId', dest='repoId', type=str, required=True, help="Id of the repository.")
                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_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")
     mandatory.add_argument('--account', dest='account', required=True,
                            help="user name of the account for which the current command should be executed")
     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. 27
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
        def arg_listTargetFormat(self):
                doParser = ArgumentParser(add_help=True, description="List all target format in the provided 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 you want to list target formats.")
                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_add(self):
                doParser = ArgumentParser(prog=self.cmd_name + " add", add_help=True, description="Add a user as a subscription profile administrator.")

                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 the subscription profile")
                mandatory.add_argument('--admins', dest='admins', nargs='+', required=True, help="The login names to add as new subscription profile administrators.")
                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
        def arg_remove(self):
                doParser = ArgumentParser(prog=self.cmd_name + " remove", add_help=True, description="Remove 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 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.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. 31
0
    def arg_create(self):
        doParser = ArgumentParser(
            add_help=True,
            description="Create a target platform 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 target platform to create in the organization.")
        mandatory.add_argument(
            '--type',
            dest='type',
            type=str,
            required=True,
            help=
            "Type of the target platform to create in the organization (aws, azure, ews, google, abiquo, cloudcom, flexiant, nimbula, openstack, vclouddirector, vsphere)."
        )
        optional.add_argument(
            '--accountInfos',
            dest='accountInfos',
            type=str,
            required=False,
            help=
            "Account information of the target platform (example: cloud provider's URL)."
        )
        optional.add_argument('--file',
                              dest='file',
                              required=False,
                              help="The logo file.")
        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. 32
0
    def arg_enable(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Enable one or more operating systems for the provided organization"
        )

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

        mandatory.add_argument(
            '--name',
            dest='name',
            nargs='+',
            required=True,
            help=
            "Operating system(s) name (for example CentOS, Debian etc) 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(
            '--arch',
            dest='arch',
            nargs='+',
            required=False,
            help=
            "Operating system architecture (i386, x86_64). You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        optional.add_argument(
            '--version',
            dest='version',
            nargs='+',
            required=False,
            help=
            "Operating system version (13, 5.6, ...). 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. 33
0
 def arg_delete(self):
     doParser = ArgumentParser(prog=self.cmd_name + " delete",
                               add_help=True,
                               description="Deletes an existing bundle")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id',
                            dest='id',
                            required=True,
                            help="the ID of the bundle to delete")
     return doParser
Esempio n. 34
0
 def arg_delete(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " delete",
         add_help=True,
         description="Deletes an existing cloud account")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id',
                            dest='id',
                            required=True,
                            help="the ID of the cloud account 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 ask before delete the cloud account")
     doParser.set_defaults(no_confirm=False)
     return doParser
Esempio n. 35
0
 def arg_import(self):
     doParser = ArgumentParser(prog=self.cmd_name + " import", add_help=True,
                               description="Imports (or transforms) the scan to a template")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id', dest='id', required=True, help="the ID of the scan to import")
     mandatory.add_argument('--name', dest='name', required=True, nargs='+',
                            help="the name to use for the template created from the scan")
     mandatory.add_argument('--version', dest='version', required=True,
                            help="the version to use for the template created from the scan")
     return doParser
Esempio n. 36
0
    def arg_add(self):
        doParser = ArgumentParser(
            add_help=True,
            description=
            "Get a user admin to the default organization or 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(
            '--admin',
            dest='admin',
            action="store_true",
            required=False,
            help=
            "Flag to provide administration privileges to the user for the organization"
        )
        optional.add_argument(
            '--publisher',
            dest='publisher',
            action="store_true",
            required=False,
            help=
            "Flag to provide publish rights to the organization's App Store for the account being created."
        )
        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. 37
0
 def arg_create(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " create",
         add_help=True,
         description="Create a new template 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 template 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 template. If provided hammr, creates an archive of the created template, equivalent to running template export"
     )
     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. 38
0
 def arg_demote(self):
     doParser = ArgumentParser(add_help=True,
                               description="Demote an user from being an organization administrator")
     mandatory = doParser.add_argument_group("mandatory arguments")
     optionnal = doParser.add_argument_group("optionnal arguments")
     mandatory.add_argument('--account', dest='account', type=str, required=True,
                            help="User name of the account to demote")
     optionnal.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. 39
0
 def arg_list(self):
     doParser = ArgumentParser(
         add_help=True, description="Displays the user's quota information")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--account',
                            dest='account',
                            type=str,
                            required=True,
                            help="User name of the account to see quotas")
     return doParser
Esempio n. 40
0
 def arg_delete(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " delete",
         add_help=True,
         description="Delete a subscription profile from an organization.")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument(
         '--name',
         dest='name',
         required=True,
         help="the name of the subscription profile to delete")
     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. 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(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. 43
0
 def arg_validate(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " validate",
         add_help=True,
         description="Validates the syntax of a bundle configuration file")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file',
                            dest='file',
                            required=True,
                            help="the yaml/json bundle configuration file")
     return doParser
Esempio n. 44
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. 45
0
    def arg_promote(self):
        doParser = ArgumentParser(add_help=True,
                                  description="Promote user to be an administrator of an organization (note: admin access rights are handled by roles)")
        mandatory = doParser.add_argument_group("mandatory arguments")
        optionnal = doParser.add_argument_group("optionnal arguments")

        mandatory.add_argument('--account', dest='account', type=str, required=True,
                               help="User name of the account to promote")
        optionnal.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. 46
0
 def arg_cancel(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " cancel",
         add_help=True,
         description="Cancels a machine image build or publish")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id',
                            dest='id',
                            required=True,
                            help="the ID of the machine image to cancel")
     return doParser
Esempio n. 47
0
 def arg_delete(self):
     doParser = ArgumentParser(
         prog=self.cmd_name + " delete",
         add_help=True,
         description="Deletes a machine image or publish information")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--id',
                            dest='id',
                            required=True,
                            help="the ID of the machine image to delete")
     return doParser
Esempio n. 48
0
 def arg_batch(self):
     doParser = ArgumentParser(
         "batch",
         add_help=True,
         description=
         "Execute hammr batch command from a file (for scripting)")
     mandatory = doParser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--file',
                            dest='file',
                            required=True,
                            help="hammr batch file commands")
     return doParser
Esempio n. 49
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. 50
0
 def arg_info(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " info",
         add_help=True,
         description=
         "Get detailed information on a subscription profile within an organization."
     )
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--name',
                            dest='name',
                            required=True,
                            help="the name of 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. 51
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=
         "yaml/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. 52
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")
     mandatory.add_argument(
         '--account',
         dest='account',
         required=True,
         help=
         "user name of the account for which the current command should be executed"
     )
     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
    def arg_remove(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " remove",
            add_help=True,
            description=
            "Remove one or several target formats from a subscription profile")

        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 the subscription profile")
        mandatory.add_argument(
            '--targetFormats',
            dest='targetFormats',
            nargs='+',
            required=True,
            help=
            "targetFormat(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',
            required=False,
            help=
            "the organization name. If no organization is provided, then the default organization is used."
        )
        optional.add_argument(
            '--allusers',
            dest='allusers',
            action="store_true",
            required=False,
            help=
            "if set, all existing active users of that subscription profile benefit from the target format deletion."
        )

        return doParser
Esempio n. 54
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. 55
0
 def arg_create(self):
     do_parser = ArgumentParser(
         prog=self.cmd_name + " create",
         add_help=True,
         description=
         "Create a new user. This is restricted to administrators.")
     mandatory = do_parser.add_argument_group("mandatory arguments")
     mandatory.add_argument('--account',
                            dest='account',
                            required=True,
                            help="the login name of the user to create")
     mandatory.add_argument('--email',
                            dest='email',
                            required=True,
                            help="the email of the user to create")
     mandatory.add_argument(
         '--code',
         dest='code',
         required=True,
         help=
         "the creation code (subscription profile) to be used to create the user account"
     )
     optional = do_parser.add_argument_group("optional arguments")
     optional.add_argument('--accountPassword',
                           dest='accountPassword',
                           required=False,
                           help="the new user account password")
     optional.add_argument(
         '--org',
         dest='org',
         required=False,
         help="the organization in which the user should be created")
     optional.add_argument(
         '--disable',
         dest='disable',
         required=False,
         help="flag to de-activate the account during the creation")
     return do_parser
Esempio n. 56
0
    def arg_list(self):
        doParser = ArgumentParser(
            add_help=True, description="List all the images created by a 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="The account on which you want to list the images")
        optional.add_argument(
            '--os',
            dest='os',
            nargs='+',
            required=False,
            help=
            "Only display images that have been built from the operating system(s). You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        optional.add_argument(
            '--name',
            dest='name',
            nargs='+',
            required=False,
            help=
            "Only display images that have the name matching this name. You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        optional.add_argument(
            '--format',
            dest='format',
            nargs='+',
            required=False,
            help=
            "Only display images that have been generated by the following format(s). You can use Unix matching system (*,?,[seq],[!seq]) and multiple match separating by space."
        )
        return doParser
Esempio n. 57
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. 58
0
    def arg_list(self):
        doParser = ArgumentParser(
            add_help=True,
            description="List all the target platform from a 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="List target platforms for provided user")
        optional.add_argument(
            '--org',
            dest='org',
            type=str,
            required=False,
            help=
            "List target platforms for provided user by a specific organization."
        )

        return doParser
Esempio n. 59
0
    def arg_delete(self):
        doParser = ArgumentParser(
            add_help=True,
            description="Delete an user group from the specified 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. 60
0
    def arg_remove(self):
        doParser = ArgumentParser(
            prog=self.cmd_name + " remove",
            add_help=True,
            description=
            "Remove one or several roles from a subscription profile")

        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 the subscription profile")
        mandatory.add_argument(
            '--roles',
            dest='roles',
            nargs='+',
            required=True,
            help="the roles to add to the subscription profile")
        optional.add_argument(
            '--org',
            dest='org',
            required=False,
            help=
            "the organization name. If no organization is provided, then the default organization is used."
        )
        optional.add_argument(
            '--allusers',
            dest='allusers',
            action="store_true",
            required=False,
            help=
            "if set, all existing active users of that subscription profile benefit from the role deletion."
        )

        return doParser