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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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_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