Package ganeti :: Package client :: Module gnt_filter
[hide private]
[frames] | no frames]

Module gnt_filter

source code

Job filter rule commands

Functions [hide private]
int
AddFilter(opts, args)
Add a job filter rule.
source code
int
ListFilters(opts, args)
List job filter rules and their properties.
source code
int
ListFilterFields(opts, args)
List filter rule fields.
source code
int
ReplaceFilter(opts, args)
Replaces a job filter rule with the given UUID, or creates it, if it doesn't exist already.
source code
int
ShowFilter(_, args)
Show filter rule details.
source code
int
DeleteFilter(_, args)
Remove a job filter rule.
source code
 
Main() source code
Variables [hide private]
  _LIST_DEF_FIELDS = ["uuid", "watermark", "priority", "predicat...
default list of fields for ListFilters
  FILTER_PRIORITY_OPT = cli_option("--priority", dest= "priority...
  FILTER_PREDICATES_OPT = cli_option("--predicates", dest= "pred...
  FILTER_ACTION_OPT = cli_option("--action", dest= "action", act...
  commands = {"add":(AddFilter, ARGS_NONE, [FILTER_PRIORITY_OPT,...

Imports: OOB_TIMEOUT_OPT, MAC_PREFIX_OPT, IPOLICY_STD_SPECS_OPT, SHUTDOWN_TIMEOUT_OPT, ARGS_ONE_GROUP, ARGS_MANY_NODES, IGNORE_REMOVE_FAILURES_OPT, NWSYNC_OPT, IDENTIFY_DEFAULTS_OPT, FormatParamsDictInfo, FormatTimestamp, DEFAULT_IALLOCATOR_PARAMS_OPT, RAPI_CERT_OPT, AUTO_PROMOTE_OPT, RESERVED_LVS_OPT, FormatPolicyInfo, GLOBAL_SHARED_FILEDIR_OPT, MAINTAIN_NODE_HEALTH_OPT, shlex, DRY_RUN_OPT, ARGS_MANY_FILTERS, NIC_PARAMS_OPT, PrintIPolicyCommand, AUTO_REPLACE_OPT, compat, errors, USEUNITS_OPT, NOMODIFY_ETCHOSTS_OPT, VERBOSE_OPT, NEW_NODE_CERT_OPT, HOTPLUG_OPT, GenerateTable, ARGS_ONE_NODE, ALLOW_FAILOVER_OPT, NOSTART_OPT, INSTANCE_COMMUNICATION_NETWORK_OPT, SPECS_NIC_COUNT_OPT, objects, MASTER_NETMASK_OPT, SPICE_CERT_OPT, INTERVAL_OPT, ToStdout, OSPARAMS_OPT, StringIO, RQL_OPT, StdioJobPollReportCb, CAPAB_MASTER_OPT, MODIFY_ETCHOSTS_OPT, SPECS_MEM_SIZE_OPT, TAG_SRC_OPT, NODEGROUP_OPT, SYNC_OPT, ONLINE_INST_OPT, TableColumn, NONPLUS1_OPT, NEW_SSH_KEY_OPT, JobSubmittedException, ARGS_ONE_OS, PollJob, NETWORK_OPT, TIMEOUT_OPT, ON_SECONDARY_OPT, MIGRATION_MODE_OPT, REMOVE_INSTANCE_OPT, SEQUENTIAL_OPT, ZEROING_TIMEOUT_PER_MIB_OPT, DISK_TEMPLATE_OPT, REASON_OPT, NO_INSTALL_OPT, DEFAULT_IALLOCATOR_OPT, NOCONFLICTSCHECK_OPT, SubmitOpCode, LONG_SLEEP_OPT, JobPollReportCbBase, ArgNode, CP_SIZE_OPT, ALLOCATABLE_OPT, PREALLOC_WIPE_DISKS_OPT, IPOLICY_VCPU_RATIO, GetClient, EXT_PARAMS_OPT, ENABLED_HV_OPT, PrintGenericInfo, FIELDS_OPT, GLOBAL_GLUSTER_FILEDIR_OPT, INCLUDEDEFAULTS_OPT, ARGS_ONE_INSTANCE, IPOLICY_SPINDLE_RATIO, IPOLICY_DISK_TEMPLATES, JobPollCbBase, NO_REMEMBER_OPT, NOVOTING_OPT, SPECS_CPU_COUNT_OPT, netutils, SECONDARY_IP_OPT, NETWORK6_OPT, GenericPollJob, ABSOLUTE_OPT, READD_OPT, BACKEND_OPT, FormatTable, FILESTORE_DIR_OPT, OSPARAMS_PRIVATE_OPT, NONAMECHECK_OPT, NODE_POWERED_OPT, TAG_ADD_OPT, ArgOs, HVLIST_OPT, CONFIRM_OPT, ALL_OPT, CalculateOSNames, ENABLED_USER_SHUTDOWN_OPT, FAILURE_ONLY_OPT, ENABLED_DISK_TEMPLATES_OPT, SUBMIT_OPT, GATEWAY_OPT, ADD_UIDS_OPT, logging, IPOLICY_STD_SPECS_STR, NODE_PARAMS_OPT, SPLIT_ISPECS_OPTS, GLOBAL_FILEDIR_OPT, NOSHUTDOWN_OPT, TISPECS_CLUSTER_TYPES, NET_OPT, IGNORE_FAILURES_OPT, SRC_DIR_OPT, REMOVE_UIDS_OPT, HYPERVISOR_OPT, MC_OPT, NODE_FORCE_JOIN_OPT, IGNORE_CONSIST_OPT, RunWhileDaemonsStopped, STATIC_OPT, NONLIVE_OPT, DISK_OPT, REMOVE_RESERVED_IPS_OPT, COMPRESS_OPT, FILESTORE_DRIVER_OPT, CreateIPolicyFromOpts, ArgJobId, ConfirmOperation, HELPER_SHUTDOWN_TIMEOUT_OPT, SHOWCMD_OPT, ArgGroup, OFFLINE_INST_OPT, ListTags, NEW_CLUSTER_DOMAIN_SECRET_OPT, COMMON_OPTS, ParseTimespec, pathutils, ZERO_FREE_SPACE_OPT, ArgFilter, RUNTIME_MEM_OPT, HID_OS_OPT, NOHDR_OPT, ZEROING_IMAGE_OPT, TISPECS_GROUP_TYPES, VG_NAME_OPT, SubmitOpCodeToDrainedQueue, IALLOCATOR_OPT, STARTUP_PAUSED_OPT, DISKIDX_OPT, TO_GROUP_OPT, POWER_DELAY_OPT, OPT_COMPL_ALL, IGNORE_SECONDARIES_OPT, GenericList, CLEANUP_OPT, GetNodeUUIDs, ssh, HOTPLUG_IF_POSSIBLE_OPT, COMMON_CREATE_OPTS, GenericInstanceCreate, ArgChoice, CAPAB_VM_OPT, NODE_PLACEMENT_OPT, FixHvParams, ToStderr, ganeti, ArgExtStorage, FORCE_VARIANT_OPT, AskUser, CLUSTER_DOMAIN_SECRET_OPT, DISK_STATE_OPT, TitledHelpFormatter, ARGS_NONE, IGNORE_SIZE_OPT, SetGenericOpcodeOpts, OS_SIZE_OPT, ARGS_ONE_FILTER, ParseFields, HV_STATE_OPT, ArgNetwork, itertools, SRC_NODE_OPT, NOSSH_KEYCHECK_OPT, INSTANCE_POLICY_OPTS, MASTER_NETDEV_OPT, NOMODIFY_SSH_SETUP_OPT, INSTANCE_COMMUNICATION_OPT, IGNORE_OFFLINE_OPT, IGNORE_ERRORS_OPT, EARLY_RELEASE_OPT, FormatResultError, SplitNodeOption, NEW_SPICE_CERT_OPT, SPECS_DISK_COUNT_OPT, FORCE_FAILOVER_OPT, PRIMARY_ONLY_OPT, RemoveTags, NEW_PRIMARY_OPT, ArgInstance, COMMIT_OPT, MAX_TRACK_OPT, NONICS_OPT, SELECT_OS_OPT, FORCE_OPT, PRINT_JOBID_OPT, PRIORITY_OPT, DRAINED_OPT, IGNORE_SOFT_ERRORS_OPT, VERIFY_CLUTTER_OPT, PRIMARY_IP_VERSION_OPT, NODEGROUP_OPT_NAME, GetNodesSshPorts, SHOW_MACHINE_OPT, sys, FormatQueryResult, HELPER_STARTUP_TIMEOUT_OPT, OFFLINE_OPT, YES_DOIT_OPT, NEW_CONFD_HMAC_KEY_OPT, UsesRPC, ZEROING_TIMEOUT_FIXED_OPT, UIDPOOL_OPT, ALLOC_POLICY_OPT, ArgUnknown, ERROR_CODES_OPT, SPECS_DISK_SIZE_OPT, ARGS_ONE_NETWORK, DEBUG_SIMERR_OPT, textwrap, SUBMIT_OPTS, ROMAN_OPT, ARGS_MANY_NETWORKS, rpcerr, SEP_OPT, USE_EXTERNAL_MIP_SCRIPT, rpc, TRANSPORT_COMPRESSION_OPT, JobExecutor, SINGLE_NODE_OPT, INSTALL_IMAGE_OPT, qlang, SPICE_CACERT_OPT, OSPARAMS_SECRET_OPT, cli_option, HVOPTS_OPT, NEW_RAPI_CERT_OPT, ArgHost, GenericListFields, ParseNicOption, ArgCommand, DEBUG_OPT, ON_PRIMARY_OPT, NEW_CLUSTER_CERT_OPT, AddTags, RunWhileClusterStopped, BLK_OS_OPT, ENABLED_DATA_COLLECTORS_OPT, os, OS_OPT, IGNORE_HVVERSIONS_OPT, USE_REPL_NET_OPT, SendJob, opcodes, errno, REBOOT_TYPE_OPT, ToStdoutAndLoginfo, IGNORE_IPOLICY_OPT, GATEWAY6_OPT, FORTHCOMING_OPT, SECONDARY_ONLY_OPT, GetOnlineNodes, NODE_LIST_OPT, NOIPCHECK_OPT, IPOLICY_BOUNDS_SPECS_STR, DRBD_HELPER_OPT, COMPRESSION_TOOLS_OPT, OptionParser, ARGS_MANY_GROUPS, FormatLogMessage, GenericMain, ArgFile, WFSYNC_OPT, NORUNTIME_CHGS_OPT, ADD_RESERVED_IPS_OPT, ARGS_MANY_INSTANCES, FORCE_FILTER_OPT, FormatError, ArgSuggest, SubmitOrSend, NEW_SECONDARY_OPT, DISK_PARAMS_OPT, DST_NODE_OPT, time, FeedbackFnJobPollReportCb, serializer, constants, utils


Function Details [hide private]

AddFilter(opts, args)

source code 

Add a job filter rule.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should be an empty list
Returns: int
the desired exit code

ListFilters(opts, args)

source code 

List job filter rules and their properties.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - filters to list, or empty for all
Returns: int
the desired exit code

ListFilterFields(opts, args)

source code 

List filter rule fields.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - fields to list, or empty for all
Returns: int
the desired exit code

ReplaceFilter(opts, args)

source code 

Replaces a job filter rule with the given UUID, or creates it, if it doesn't exist already.

Parameters:
  • opts - the command line options selected by the user
  • args (list) - should contain only one element, the UUID of the filter
Returns: int
the desired exit code

ShowFilter(_, args)

source code 

Show filter rule details.

Parameters:
  • args (list) - should either be an empty list, in which case we show information about all filters, or should contain a list of filter UUIDs to be queried for information
Returns: int
the desired exit code

DeleteFilter(_, args)

source code 

Remove a job filter rule.

Parameters:
  • args (list) - a list of length 1 with the UUID of the filter to remove
Returns: int
the desired exit code

Variables Details [hide private]

_LIST_DEF_FIELDS

default list of fields for ListFilters

Value:
["uuid", "watermark", "priority", "predicates", "action", "reason_trai\
l"]

FILTER_PRIORITY_OPT

Value:
cli_option("--priority", dest= "priority", action= "store", default= 0\
, type= "int", help= "Priority for filter processing")

FILTER_PREDICATES_OPT

Value:
cli_option("--predicates", dest= "predicates", action= "store", defaul\
t= [], type= "json", help= "List of predicates in the Ganeti query lan\
guage," " given as a JSON list.")

FILTER_ACTION_OPT

Value:
cli_option("--action", dest= "action", action= "store", default= "CONT\
INUE", type= "filteraction", help= "The effect of the filter. Can be o\
ne of 'ACCEPT'," " 'PAUSE', 'REJECT', 'CONTINUE' and '[RATE_LIMIT, n]'\
," " where n is a positive integer.")

commands

Value:
{"add":(AddFilter, ARGS_NONE, [FILTER_PRIORITY_OPT, FILTER_PREDICATES_\
OPT, FILTER_ACTION_OPT], "", "Adds a new filter rule"), "list":(ListFi\
lters, ARGS_MANY_FILTERS, [NOHDR_OPT, SEP_OPT, FIELDS_OPT, VERBOSE_OPT\
], "[<filter_uuid>...]", "Lists the job filter rules. The available fi\
elds can be shown" " using the \"list-fields\" command (see the man pa\
ge for details)." " The default list is (in order): %s." % utils.Comma\
Join(_LIST_DEF_FIELDS)), "list-fields":(ListFilterFields, [ArgUnknown(\
)], [NOHDR_OPT, SEP_OPT], "[fields...]", "Lists all available fields f\
...