Module implementing the parameter types code.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TTrue(val)
Checks if a given value evaluates to a boolean True value. |
source code
|
|
|
TElemOf(target_list)
Builds a function that checks if a given value is a member of a list. |
source code
|
|
|
|
|
|
|
|
|
TIsLength(size)
Check is the given container is of the given size. |
source code
|
|
|
TAnd(*args)
Combine multiple functions using an AND operation. |
source code
|
|
|
TOr(*args)
Combine multiple functions using an OR operation. |
source code
|
|
|
TMap(fn,
test)
Checks that a modified version of the argument passes the given test. |
source code
|
|
|
TRegex(pobj)
Checks whether a string matches a specific regular expression. |
source code
|
|
|
|
|
TMaybeValueNone(test)
Used for unsetting values. |
source code
|
|
|
|
|
|
|
|
|
TNonNegative(val_type)
a non-negative number (value > 0) |
source code
|
|
|
TPositive(val_type)
a positive number (value >= 0) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
TListOf(my_type)
Checks if a given value is a list with all elements of the same type. |
source code
|
|
|
TTupleOf(*val_types)
Checks if a given value is a list with the proper size and its
elements match the given types. |
source code
|
|
|
TSetOf(val_type)
Checks if a given value is a list with all elements of the same type
and eliminates duplicated elements. |
source code
|
|
|
TDictOf(key_type,
val_type)
Checks a dict type for the type of its key/values. |
source code
|
|
|
|
|
|
|
|
|
TSetParamsMods(fn)
Generates a check for modification lists. |
source code
|
|
|
TStorageType(val)
Builds a function that checks if a given value is a valid storage
type. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_PAREN_RE = re.compile("^[a-zA-Z0-9_-]+$")
|
|
NoDefault = object()
The without-default default value
|
|
TNonEmptyString = WithDesc("NonEmptyString")(TAnd(TString, TTr...
a non-empty string
|
|
TMaybeString = TMaybe(TNonEmptyString)
a maybe non-empty string
|
|
TNegativeInt = TAnd(TInt, WithDesc("LessThanZero")(compat.part...
a negative integer (value < 0)
|
|
TNonNegativeFloat = TAnd(TFloat, WithDesc("EqualOrGreaterThanZ...
a positive float
|
|
TJobId = WithDesc("JobId")(TOr(TNonNegativeInt, TRegex(re.comp...
Job ID
|
|
TNumber = TOr(TInt, TFloat)
Number
|
|
TRelativeJobId = WithDesc("RelativeJobId")(TNegativeInt)
Relative job ID
|
|
TMaybeListOf = lambda item_type:
|
|
TAllocPolicy = TElemOf(constants.VALID_ALLOC_POLICIES)
|
|
TCVErrorCode = TElemOf(constants.CV_ALL_ECODES_STRINGS)
|
|
TQueryResultCode = TElemOf(constants.RS_ALL)
|
|
TExportTarget = TOr(TNonEmptyString, TList)
|
|
TExportMode = TElemOf(constants.EXPORT_MODES)
|
|
TDiskIndex = TAnd(TNonNegativeInt, lambda val: val < constants...
|
|
TReplaceDisksMode = TElemOf(constants.REPLACE_MODES)
|
|
TDiskTemplate = TElemOf(constants.DISK_TEMPLATES)
|
|
TEvacMode = TElemOf(constants.NODE_EVAC_MODES)
|
|
TIAllocatorTestDir = TElemOf(constants.VALID_IALLOCATOR_DIRECT...
|
|
TIAllocatorMode = TElemOf(constants.VALID_IALLOCATOR_MODES)
|
|
TImportExportCompression = TElemOf(constants.IEC_ALL)
|
|
TAdminStateSource = TElemOf(constants.ADMIN_STATE_SOURCES)
|
|
TINicParams = Comment("NIC parameters")(TDictOf(TElemOf(consta...
|
|
TIDiskParams = Comment("Disk parameters")(TDictOf(TNonEmptyStr...
|
|
THypervisor = TElemOf(constants.HYPER_TYPES)
|
|
TMigrationMode = TElemOf(constants.HT_MIGRATION_MODES)
|
|
TNICMode = TElemOf(constants.NIC_VALID_MODES)
|
|
TInstCreateMode = TElemOf(constants.INSTANCE_CREATE_MODES)
|
|
TRebootType = TElemOf(constants.REBOOT_TYPES)
|
|
TFileDriver = TElemOf(constants.FILE_DRIVER)
|
|
TOobCommand = TElemOf(constants.OOB_COMMANDS)
|
|
TQueryTypeOp = TElemOf(set(constants.QR_VIA_OP).union(set(cons...
|
|
TDiskParams = Comment("Disk parameters")(TDictOf(TNonEmptyStri...
|
|
TDiskChanges = TAnd(TIsLength(2), TItems([Comment("Disk index"...
|
|
TRecreateDisksInfo = TOr(TListOf(TNonNegativeInt), TListOf(TDi...
|
|
TTagKind = TElemOf(constants.VALID_TAG_TYPES)
|
|
TDdmSimple = TElemOf(constants.DDMS_VALUES)
|
|
TVerifyOptionalChecks = TElemOf(constants.VERIFY_OPTIONAL_CHECKS)
|
|
TIPv4Address = TAnd(TString, _CheckCIDRAddrNotation)
|
|
TIPv6Address = TAnd(TString, _CheckCIDR6AddrNotation)
|
|
TIPv4Network = TAnd(TString, _CheckCIDRNetNotation)
|
|
TIPv6Network = TAnd(TString, _CheckCIDR6NetNotation)
|
|
TQueryFieldDef = TObjectCheck(objects.QueryFieldDefinition, {"...
|
|
TQueryRow = TListOf(TAnd(TIsLength(2), TItems([TElemOf(constan...
|
|
TQueryResult = TListOf(TQueryRow)
|
|
TQueryResponse = TObjectCheck(objects.QueryResponse, {"fields"...
|
|
TQueryFieldsResponse = TObjectCheck(objects.QueryFieldsRespons...
|
|
TJobIdListItem = TAnd(TIsLength(2), TItems([Comment("success")...
|
|
TJobIdList = TListOf(TJobIdListItem)
|
|
TJobIdListOnly = TStrictDict(True, True, {constants.JOB_IDS_KE...
|
|
TInstanceMultiAllocResponse = TStrictDict(True, True, {constan...
|