def create_parser(): parser = OptParser(option_class=OptChecker, description="Greenplum Package Manager", version='%prog version $Revision: #1 $') parser.setHelp([]) addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) parser.remove_option('-q') parser.remove_option('-l') add_to = OptionGroup(parser, 'General Options') parser.add_option_group(add_to) addMasterDirectoryOptionForSingleClusterProgram(add_to) # TODO: AK: Eventually, these options may need to be flexible enough to accept mutiple packages # in one invocation. If so, the structure of this parser may need to change. add_to.add_option('-i', '--install', help='install the given gppkg', metavar='<package>') add_to.add_option('-u', '--update', help='update the given gppkg', metavar='<package>') add_to.add_option('-r', '--remove', help='remove the given gppkg', metavar='<name>-<version>') add_to.add_option('-q', '--query', help='query the gppkg database or a particular gppkg', action='store_true') add_to.add_option('-b', '--build', help='build a gppkg', metavar='<directory>') add_to.add_option('-c', '--clean', help='clean the cluster of the given gppkg', action='store_true') add_to.add_option('--migrate', help='migrate gppkgs from a separate $GPHOME', metavar='<from_gphome> <to_gphome>', action='store_true', default=False) add_to = OptionGroup(parser, 'Query Options') parser.add_option_group(add_to) add_to.add_option('--info', action='store_true', help='print information about the gppkg including name, version, description') add_to.add_option('--list', action='store_true', help='print all the files present in the gppkg') add_to.add_option('--all', action='store_true', help='print all the gppkgs installed by gppkg') return parser
def createParser(): """ Create parser expected by simple_main """ parser = OptParser(option_class=OptChecker, description=' '.join(DESCRIPTION.split()), version='%prog version main build dev') parser.setHelp(HELP) # # Note that this mirroringmode parameter should only be either mirrorless or quiescent. # If quiescent then it is implied that there is pickled transition data that will be # provided (using -p) to immediately convert to a primary or a mirror. # addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=False) parser.add_option("-C", "--collation", type="string", help="values for lc_collate, lc_monetary, lc_numeric separated by :") parser.add_option("-D", "--dblist", dest="dblist", action="append", type="string") parser.add_option("-M", "--mirroringmode", dest="mirroringMode", type="string") parser.add_option("-p", "--pickledTransitionData", dest="pickledTransitionData", type="string") parser.add_option("-V", "--gp-version", dest="gpversion", metavar="GP_VERSION", help="expected software version") parser.add_option("-n", "--numsegments", dest="num_cids", help="number of distinct content ids in cluster") parser.add_option("", "--era", dest="era", help="master era") parser.add_option("-t", "--timeout", dest="timeout", type="int", default=gp.SEGMENT_TIMEOUT_DEFAULT, help="seconds to wait") parser.add_option('-U', '--specialMode', type='choice', choices=['upgrade', 'maintenance'], metavar='upgrade|maintenance', action='store', default=None, help='start the instance in upgrade or maintenance mode') parser.add_option('', '--wrapper', dest="wrapper", default=None, type='string') parser.add_option('', '--wrapper-args', dest="wrapper_args", default=None, type='string') return parser
def createParser(): """ Create parser expected by simple_main """ parser = OptParser(option_class=OptChecker, description=' '.join(DESCRIPTION.split()), version='%prog version main build dev') parser.setHelp(HELP) # # Note that this mirroringmode parameter should only be either mirrorless or quiescent. # If quiescent then it is implied that there is pickled transition data that will be # provided (using -p) to immediately convert to a primary or a mirror. # addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=False) parser.add_option("-D", "--dblist", dest="dblist", action="append", type="string") parser.add_option("-M", "--mirroringmode", dest="mirroringMode", type="string") parser.add_option("-p", "--pickledTransitionData", dest="pickledTransitionData", type="string") parser.add_option("-V", "--gp-version", dest="gpversion", metavar="GP_VERSION", help="expected software version") parser.add_option("-n", "--numsegments", dest="num_cids", help="number of distinct content ids in cluster") parser.add_option("", "--era", dest="era", help="master era") parser.add_option("-t", "--timeout", dest="timeout", type="int", default=gp.SEGMENT_TIMEOUT_DEFAULT, help="seconds to wait") parser.add_option('-U', '--specialMode', type='choice', choices=['upgrade', 'maintenance'], metavar='upgrade|maintenance', action='store', default=None, help='start the instance in upgrade or maintenance mode') parser.add_option('', '--wrapper', dest="wrapper", default=None, type='string') parser.add_option('', '--wrapper-args', dest="wrapper_args", default=None, type='string') parser.add_option('', '--master-checksum-version', dest="master_checksum_version", default=None, type='string', action="store") parser.add_option('-B', '--parallel', type="int", dest="parallel", default=gp.DEFAULT_GPSTART_NUM_WORKERS, help='maximum size of a threadpool to start segments') return parser
def create_parser(): parser = OptParser(option_class=OptChecker, description='update the pg_hba.conf on all segments') addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) parser.add_option('-p', '--pg-hba-info', dest='pg_hba_info', metavar='<pg_hba entries>', help='Entries that get added to pg_hba.conf file') parser.add_option( '-d', '--data-dirs', dest='data_dirs', metavar='<list of data dirs>', help='A list of all data directories present on this host') parser.add_option('-b', '--backup', action='store_true', help='Backup the pg_hba.conf file') parser.add_option('-r', '--restore', action='store_true', help='Restore the pg_hba.conf file') parser.add_option('-D', '--delete', action='store_true', help='Cleanup the pg_hba.conf backup file') return parser
def create_parser(): parser = OptParser(option_class=OptChecker, description="Greenplum Package Manager", version='%prog version $Revision: #1 $') parser.setHelp([]) addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) parser.remove_option('-q') parser.remove_option('-l') add_to = OptionGroup(parser, 'General Options') parser.add_option_group(add_to) addMasterDirectoryOptionForSingleClusterProgram(add_to) # TODO: AK: Eventually, these options may need to be flexible enough to accept mutiple packages # in one invocation. If so, the structure of this parser may need to change. add_to.add_option('-i', '--install', help='install the given gppkg', metavar='<package>') add_to.add_option('-u', '--update', help='update the given gppkg', metavar='<package>') add_to.add_option('-r', '--remove', help='remove the given gppkg', metavar='<name>-<version>') add_to.add_option('-q', '--query', help='query the gppkg database or a particular gppkg', action='store_true') add_to.add_option('-b', '--build', help='build a gppkg', metavar='<directory>') add_to.add_option('-c', '--clean', help='clean the cluster of the given gppkg', action='store_true') add_to.add_option('--migrate', help='migrate gppkgs from a separate $GPHOME', metavar='<from_gphome> <to_gphome>', action='store_true', default=False) add_to.add_option('-f', '--filename', help='set specific package name', metavar='<name>') add_to = OptionGroup(parser, 'Query Options') parser.add_option_group(add_to) add_to.add_option('--info', action='store_true', help='print information about the gppkg including name, version, description') add_to.add_option('--list', action='store_true', help='print all the files present in the gppkg') add_to.add_option('--all', action='store_true', help='print all the gppkgs installed by gppkg') return parser
def create_parser(): """Create the command line parser object for gpkill""" help = [] parser = OptParser( option_class=OptChecker, description='Check or Terminate a Greenplum Database process.', version='%prog version $Revision: #1 $') parser.setHelp(help) addStandardLoggingAndHelpOptions(parser, True) parser.remove_option('-l') parser.remove_option('-a') addTo = OptionGroup(parser, 'Check Options') parser.add_option_group(addTo) addTo.add_option( '--check', metavar='pid', help= 'Only returns status 0 if pid may be killed without gpkill, status 1 otherwise.', action='store_true') return parser
def create_parser(): parser = OptParser(option_class=OptChecker, description='update the pg_hba.conf on all segments') addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) parser.add_option('-p', '--pg-hba-info', dest='pg_hba_info', metavar='<pg_hba entries>', help='Entries that get added to pg_hba.conf file') parser.add_option('-d', '--data-dirs', dest='data_dirs', metavar='<list of data dirs>', help='A list of all data directories present on this host') parser.add_option('-b', '--backup', action='store_true', help='Backup the pg_hba.conf file') parser.add_option('-r', '--restore', action='store_true', help='Restore the pg_hba.conf file') parser.add_option('-D', '--delete', action='store_true', help='Cleanup the pg_hba.conf backup file') return parser
def create_parser(): """Create the command line parser object for gpkill""" help = [] parser = OptParser(option_class=OptChecker, description='Check or Terminate a Greenplum Database process.', version='%prog version $Revision: #1 $') parser.setHelp(help) addStandardLoggingAndHelpOptions(parser, True) parser.remove_option('-l') parser.remove_option('-a') addTo = OptionGroup(parser, 'Check Options') parser.add_option_group(addTo) addTo.add_option('--check', metavar='pid', help='Only returns status 0 if pid may be killed without gpkill, status 1 otherwise.', action='store_true') return parser
def create_parser(): parser = OptParser( option_class=OptChecker, description="Greenplum Package Manager", version="%prog version $Revision: #1 $" ) parser.setHelp([]) addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) parser.remove_option("-q") parser.remove_option("-l") add_to = OptionGroup(parser, "General Options") parser.add_option_group(add_to) addMasterDirectoryOptionForSingleClusterProgram(add_to) # TODO: AK: Eventually, these options may need to be flexible enough to accept mutiple packages # in one invocation. If so, the structure of this parser may need to change. add_to.add_option("-i", "--install", help="install the given gppkg", metavar="<package>") add_to.add_option("-u", "--update", help="update the given gppkg", metavar="<package>") add_to.add_option("-r", "--remove", help="remove the given gppkg", metavar="<name>-<version>") add_to.add_option("-q", "--query", help="query the gppkg database or a particular gppkg", action="store_true") add_to.add_option("-b", "--build", help="build a gppkg", metavar="<directory>") add_to.add_option("-c", "--clean", help="clean the cluster of the given gppkg", action="store_true") add_to.add_option( "--migrate", help="migrate gppkgs from a separate $GPHOME", metavar="<from_gphome> <to_gphome>", action="store_true", default=False, ) add_to = OptionGroup(parser, "Query Options") parser.add_option_group(add_to) add_to.add_option( "--info", action="store_true", help="print information about the gppkg including name, version, description" ) add_to.add_option("--list", action="store_true", help="print all the files present in the gppkg") add_to.add_option("--all", action="store_true", help="print all the gppkgs installed by gppkg") return parser
def create_parser(): parser = OptParser(option_class=OptChecker, version='%prog version $Revision: #1 $', description='Persistent tables backp and restore') addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) addTo = OptionGroup(parser, 'Connection opts') parser.add_option_group(addTo) addMasterDirectoryOptionForSingleClusterProgram(addTo) addTo = OptionGroup(parser, 'Persistent tables backup and restore options') addTo.add_option('--backup', metavar="<pickled dbid info>", type="string", help="A list of dbid info where backups need to be done in pickled format") addTo.add_option('--restore', metavar="<pickled dbid info>", type="string", help="A list of dbid info where restore needs to be done in pickled format") addTo.add_option('--validate-backups', metavar="<pickled dbid info>", type="string", help="A list of dbid info where validation needs to be done in pickled format") addTo.add_option('--validate-backup-dir', metavar="<pickled dbid info>", type="string", help="A list of dbid info where validation needs to be done in pickled format") addTo.add_option('--timestamp', metavar="<timestamp of backup>", type="string", help="A timestamp for the backup that needs to be validated") addTo.add_option('--batch-size', metavar="<batch size for the worker pool>", type="int", help="Batch size for parallelism in worker pool") addTo.add_option('--backup-dir', metavar="<backup directory>", type="string", help="Backup directory for persistent tables and transaction logs") addTo.add_option('--perdbpt', metavar="<per database pt filename>", type="string", help="Filenames for per database persistent files") addTo.add_option('--globalpt', metavar="<global pt filenames>", type="string", help="Filenames for global persistent files") addTo.add_option('--validate-source-file-only', action='store_true', default=False, help="validate that required source files existed for backup and restore") parser.setHelp([ """ This tool is used to backup persistent table files. """ ]) return parser
def createParser(): """ Creates the command line options parser object for gpverify. """ description = ("Initiates primary/mirror verification.") help = [] parser = OptParser(option_class=OptChecker, description=' '.join(description.split()), version='%prog version $Revision: #1 $') parser.setHelp(help) addStandardLoggingAndHelpOptions(parser, True) addTo = OptionGroup(parser, "Request Type") parser.add_option_group(addTo) addTo.add_option('--full', dest='full', action='store_true', help='Perform a full verification pass. Use --token option to ' \ 'give the verification pass an identifier.') addTo.add_option('--file', dest='verify_file', metavar='<file>', help='Based on file type, perform either a physical or logical verification of <file>. ' \ 'Use --token option to give the verification request an identifier.') addTo.add_option('--directorytree', dest='verify_dir', metavar='<verify_dir>', help='Perform a full verification pass on the specified directory. ' \ 'Use --token option to assign the verification pass an identifier.' ) addTo = OptionGroup(parser, "Request Options") parser.add_option_group(addTo) addTo.add_option('--token', dest='token', metavar='<token>', help='A token to use for the request. ' \ 'This identifier will be used in the logs and can be used to identify ' \ 'a verification pass to the --abort, --suspend, --resume and --results ' \ 'options.') addTo.add_option( '-c', '--content', dest='content', metavar='<content_id>', help= 'Send verification request only to the primary segment with the given <content_id>.' ) addTo.add_option('--abort', dest='abort', action='store_true', help='Abort a verification request that is in progress. ' \ 'Can use --token option to abort a specific verification request.') addTo.add_option('--suspend', dest='suspend', action='store_true', help='Suspend a verification request that is in progress.' \ 'Can use --token option to suspend a specific verification request.') addTo.add_option('--resume', dest='resume', action='store_true', help='Resume a suspended verification request. Can use the ' \ '--token option to resume a specific verification request.') addTo.add_option('--fileignore', dest='ignore_file', metavar='<ignore_file>', help='Ignore any filenames matching <ignore_file>. Multiple ' \ 'files can be specified using a comma separated list.') addTo.add_option('--dirignore', dest='ignore_dir', metavar='<ignore_dir>', help='Ignore any directories matching <ignore_dir>. Multiple ' \ 'directories can be specified using a comma separated list.') addTo = OptionGroup(parser, "Reporting Options") parser.add_option_group(addTo) addTo.add_option('--results', dest='results', action='store_true', help='Display verification results. Can use' \ 'the --token option to view results of a specific verification request.') addTo.add_option( '--resultslevel', dest='results_level', action='store', metavar='<detail_level>', type=int, help= 'Level of detail to show for results. Valid levels are from 1 to 10.' ) addTo.add_option( '--clean', dest='clean', action='store_true', help= 'Clean up verification artifacts and the gp_verification_history table.' ) addTo = OptionGroup(parser, "Misc. Options") parser.add_option_group(addTo) addTo.add_option( '-B', '--parallel', action='store', default=64, type=int, help='Number of worker threads used to send verification requests.' ) parser.set_defaults() return parser
def create_parser(): parser = OptParser(option_class=OptChecker, version='%prog version $Revision: #1 $', description='Persistent tables backp and restore') addStandardLoggingAndHelpOptions(parser, includeNonInteractiveOption=True) addTo = OptionGroup(parser, 'Connection opts') parser.add_option_group(addTo) addMasterDirectoryOptionForSingleClusterProgram(addTo) addTo = OptionGroup(parser, 'Persistent tables backup and restore options') addTo.add_option( '--backup', metavar="<pickled dbid info>", type="string", help= "A list of dbid info where backups need to be done in pickled format") addTo.add_option( '--restore', metavar="<pickled dbid info>", type="string", help= "A list of dbid info where restore needs to be done in pickled format") addTo.add_option( '--validate-backups', metavar="<pickled dbid info>", type="string", help= "A list of dbid info where validation needs to be done in pickled format" ) addTo.add_option( '--validate-backup-dir', metavar="<pickled dbid info>", type="string", help= "A list of dbid info where validation needs to be done in pickled format" ) addTo.add_option( '--timestamp', metavar="<timestamp of backup>", type="string", help="A timestamp for the backup that needs to be validated") addTo.add_option('--batch-size', metavar="<batch size for the worker pool>", type="int", help="Batch size for parallelism in worker pool") addTo.add_option( '--backup-dir', metavar="<backup directory>", type="string", help="Backup directory for persistent tables and transaction logs") addTo.add_option('--perdbpt', metavar="<per database pt filename>", type="string", help="Filenames for per database persistent files") addTo.add_option('--globalpt', metavar="<global pt filenames>", type="string", help="Filenames for global persistent files") addTo.add_option( '--validate-source-file-only', action='store_true', default=False, help= "validate that required source files existed for backup and restore") parser.setHelp( [""" This tool is used to backup persistent table files. """]) return parser
def createParser(): """ Creates the command line options parser object for gpverify. """ description = ("Initiates primary/mirror verification.") help = [] parser = OptParser(option_class=OptChecker, description=' '.join(description.split()), version='%prog version $Revision: #1 $') parser.setHelp(help) addStandardLoggingAndHelpOptions(parser, True) addTo = OptionGroup(parser, "Request Type") parser.add_option_group(addTo) addTo.add_option('--full', dest='full', action='store_true', help='Perform a full verification pass. Use --token option to ' \ 'give the verification pass an identifier.') addTo.add_option('--file', dest='verify_file', metavar='<file>', help='Based on file type, perform either a physical or logical verification of <file>. ' \ 'Use --token option to give the verification request an identifier.') addTo.add_option('--directorytree', dest='verify_dir', metavar='<verify_dir>', help='Perform a full verification pass on the specified directory. ' \ 'Use --token option to assign the verification pass an identifier.' ) addTo = OptionGroup(parser, "Request Options") parser.add_option_group(addTo) addTo.add_option('--token', dest='token', metavar='<token>', help='A token to use for the request. ' \ 'This identifier will be used in the logs and can be used to identify ' \ 'a verification pass to the --abort, --suspend, --resume and --results ' \ 'options.') addTo.add_option('-c', '--content', dest='content', metavar='<content_id>', help='Send verification request only to the primary segment with the given <content_id>.') addTo.add_option('--abort', dest='abort', action='store_true', help='Abort a verification request that is in progress. ' \ 'Can use --token option to abort a specific verification request.') addTo.add_option('--suspend', dest='suspend', action='store_true', help='Suspend a verification request that is in progress.' \ 'Can use --token option to suspend a specific verification request.') addTo.add_option('--resume', dest='resume', action='store_true', help='Resume a suspended verification request. Can use the ' \ '--token option to resume a specific verification request.') addTo.add_option('--fileignore', dest='ignore_file', metavar='<ignore_file>', help='Ignore any filenames matching <ignore_file>. Multiple ' \ 'files can be specified using a comma separated list.') addTo.add_option('--dirignore', dest='ignore_dir', metavar='<ignore_dir>', help='Ignore any directories matching <ignore_dir>. Multiple ' \ 'directories can be specified using a comma separated list.') addTo = OptionGroup(parser, "Reporting Options") parser.add_option_group(addTo) addTo.add_option('--results', dest='results', action='store_true', help='Display verification results. Can use' \ 'the --token option to view results of a specific verification request.') addTo.add_option('--resultslevel', dest='results_level', action='store', metavar='<detail_level>', type=int, help='Level of detail to show for results. Valid levels are from 1 to 10.') addTo.add_option('--clean', dest='clean', action='store_true', help='Clean up verification artifacts and the gp_verification_history table.') addTo = OptionGroup(parser, "Misc. Options") parser.add_option_group(addTo) addTo.add_option('-B', '--parallel', action='store', default=64, type=int, help='Number of worker threads used to send verification requests.') parser.set_defaults() return parser
def createParser(): """ Creates the command line options parser object for gpverify. """ description = "Initiates primary/mirror verification." help = [] parser = OptParser( option_class=OptChecker, description=" ".join(description.split()), version="%prog version $Revision: #1 $" ) parser.setHelp(help) addStandardLoggingAndHelpOptions(parser, True) addTo = OptionGroup(parser, "Request Type") parser.add_option_group(addTo) addTo.add_option( "--full", dest="full", action="store_true", help="Perform a full verification pass. Use --token option to " "give the verification pass an identifier.", ) addTo.add_option( "--file", dest="verify_file", metavar="<file>", help="Based on file type, perform either a physical or logical verification of <file>. " "Use --token option to give the verification request an identifier.", ) addTo.add_option( "--directorytree", dest="verify_dir", metavar="<verify_dir>", help="Perform a full verification pass on the specified directory. " "Use --token option to assign the verification pass an identifier.", ) addTo = OptionGroup(parser, "Request Options") parser.add_option_group(addTo) addTo.add_option( "--token", dest="token", metavar="<token>", help="A token to use for the request. " "This identifier will be used in the logs and can be used to identify " "a verification pass to the --abort, --suspend, --resume and --results " "options.", ) addTo.add_option( "-c", "--content", dest="content", metavar="<content_id>", help="Send verification request only to the primary segment with the given <content_id>.", ) addTo.add_option( "--abort", dest="abort", action="store_true", help="Abort a verification request that is in progress. " "Can use --token option to abort a specific verification request.", ) addTo.add_option( "--suspend", dest="suspend", action="store_true", help="Suspend a verification request that is in progress." "Can use --token option to suspend a specific verification request.", ) addTo.add_option( "--resume", dest="resume", action="store_true", help="Resume a suspended verification request. Can use the " "--token option to resume a specific verification request.", ) addTo.add_option( "--fileignore", dest="ignore_file", metavar="<ignore_file>", help="Ignore any filenames matching <ignore_file>. Multiple " "files can be specified using a comma separated list.", ) addTo.add_option( "--dirignore", dest="ignore_dir", metavar="<ignore_dir>", help="Ignore any directories matching <ignore_dir>. Multiple " "directories can be specified using a comma separated list.", ) addTo = OptionGroup(parser, "Reporting Options") parser.add_option_group(addTo) addTo.add_option( "--results", dest="results", action="store_true", help="Display verification results. Can use" "the --token option to view results of a specific verification request.", ) addTo.add_option( "--resultslevel", dest="results_level", action="store", metavar="<detail_level>", type=int, help="Level of detail to show for results. Valid levels are from 1 to 10.", ) addTo.add_option( "--clean", dest="clean", action="store_true", help="Clean up verification artifacts and the gp_verification_history table.", ) addTo = OptionGroup(parser, "Misc. Options") parser.add_option_group(addTo) addTo.add_option( "-B", "--parallel", action="store", default=64, type=int, help="Number of worker threads used to send verification requests.", ) parser.set_defaults() return parser