Revision 6e8091f9 lib/opcodes.py
b/lib/opcodes.py | ||
---|---|---|
2011 | 2011 |
OP_PARAMS = [ |
2012 | 2012 |
_PNetworkName, |
2013 | 2013 |
_PNetworkType, |
2014 |
("network", None, ht.TAnd(ht.TString ,_CheckCIDRNetNotation), None), |
|
2015 |
("gateway", None, ht.TOr(ht.TNone, _CheckCIDRAddrNotation), None), |
|
2016 |
("network6", None, ht.TOr(ht.TNone, _CheckCIDR6NetNotation), None), |
|
2017 |
("gateway6", None, ht.TOr(ht.TNone, _CheckCIDR6AddrNotation), None), |
|
2018 |
("mac_prefix", None, ht.TMaybeString, None), |
|
2014 |
("network", None, ht.TAnd(ht.TString ,_CheckCIDRNetNotation), |
|
2015 |
"IPv4 Subnet"), |
|
2016 |
("gateway", None, ht.TOr(ht.TNone, _CheckCIDRAddrNotation), |
|
2017 |
"IPv4 Gateway"), |
|
2018 |
("network6", None, ht.TOr(ht.TNone, _CheckCIDR6NetNotation), |
|
2019 |
"IPv6 Subnet"), |
|
2020 |
("gateway6", None, ht.TOr(ht.TNone, _CheckCIDR6AddrNotation), |
|
2021 |
"IPv6 Gateway"), |
|
2022 |
("mac_prefix", None, ht.TMaybeString, |
|
2023 |
"Mac prefix that overrides cluster one"), |
|
2019 | 2024 |
("add_reserved_ips", None, |
2020 |
ht.TOr(ht.TNone, ht.TListOf(_CheckCIDRAddrNotation)), None), |
|
2025 |
ht.TOr(ht.TNone, ht.TListOf(_CheckCIDRAddrNotation)), |
|
2026 |
"Which IPs to reserve"), |
|
2021 | 2027 |
("tags", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), "Network tags"), |
2022 | 2028 |
] |
2029 |
OP_RESULT = ht.TNone |
|
2023 | 2030 |
|
2024 | 2031 |
class OpNetworkRemove(OpCode): |
2025 | 2032 |
"""Remove an existing network from the cluster. |
... | ... | |
2031 | 2038 |
_PNetworkName, |
2032 | 2039 |
_PForce, |
2033 | 2040 |
] |
2041 |
OP_RESULT = ht.TNone |
|
2034 | 2042 |
|
2035 | 2043 |
class OpNetworkSetParams(OpCode): |
2036 | 2044 |
"""Modify Network's parameters except for IPv4 subnet""" |
... | ... | |
2038 | 2046 |
OP_PARAMS = [ |
2039 | 2047 |
_PNetworkName, |
2040 | 2048 |
_PNetworkType, |
2041 |
("gateway", None, ht.TOr(ht.TNone, _CheckCIDRAddrNotation), None), |
|
2042 |
("network6", None, ht.TOr(ht.TNone, _CheckCIDR6NetNotation), None), |
|
2043 |
("gateway6", None, ht.TOr(ht.TNone, _CheckCIDR6AddrNotation), None), |
|
2044 |
("mac_prefix", None, ht.TMaybeString, None), |
|
2049 |
("gateway", None, ht.TOr(ht.TNone, _CheckCIDRAddrNotation), |
|
2050 |
"IPv4 Gateway"), |
|
2051 |
("network6", None, ht.TOr(ht.TNone, _CheckCIDR6NetNotation), |
|
2052 |
"IPv6 Subnet"), |
|
2053 |
("gateway6", None, ht.TOr(ht.TNone, _CheckCIDR6AddrNotation), |
|
2054 |
"IPv6 Gateway"), |
|
2055 |
("mac_prefix", None, ht.TMaybeString, |
|
2056 |
"Mac prefix that overrides cluster one"), |
|
2045 | 2057 |
("add_reserved_ips", None, |
2046 |
ht.TOr(ht.TNone, ht.TListOf(_CheckCIDRAddrNotation)), None), |
|
2058 |
ht.TOr(ht.TNone, ht.TListOf(_CheckCIDRAddrNotation)), |
|
2059 |
"Which external IPs to reserve"), |
|
2047 | 2060 |
("remove_reserved_ips", None, |
2048 |
ht.TOr(ht.TNone, ht.TListOf(_CheckCIDRAddrNotation)), None), |
|
2061 |
ht.TOr(ht.TNone, ht.TListOf(_CheckCIDRAddrNotation)), |
|
2062 |
"Which external IPs to release"), |
|
2049 | 2063 |
] |
2064 |
OP_RESULT = ht.TNone |
|
2050 | 2065 |
|
2051 | 2066 |
class OpNetworkConnect(OpCode): |
2052 | 2067 |
"""Connect a Network to a specific Nodegroup with the defined netparams |
... | ... | |
2060 | 2075 |
OP_PARAMS = [ |
2061 | 2076 |
_PGroupName, |
2062 | 2077 |
_PNetworkName, |
2063 |
("network_mode", None, ht.TString, None),
|
|
2064 |
("network_link", None, ht.TString, None),
|
|
2065 |
("conflicts_check", True, ht.TBool, "Check for conflicting IPs"),
|
|
2078 |
("network_mode", None, ht.TString, "Connectivity mode"),
|
|
2079 |
("network_link", None, ht.TString, "Connectivity link"),
|
|
2080 |
("conflicts_check", True, ht.TBool, "Whether to check for conflicting IPs"),
|
|
2066 | 2081 |
] |
2082 |
OP_RESULT = ht.TNone |
|
2067 | 2083 |
|
2068 | 2084 |
class OpNetworkDisconnect(OpCode): |
2069 | 2085 |
"""Disconnect a Network from a Nodegroup. Produce errors if NICs are |
... | ... | |
2074 | 2090 |
OP_PARAMS = [ |
2075 | 2091 |
_PGroupName, |
2076 | 2092 |
_PNetworkName, |
2077 |
("conflicts_check", True, ht.TBool, "Check for conflicting IPs"),
|
|
2093 |
("conflicts_check", True, ht.TBool, "Whether to check for conflicting IPs"),
|
|
2078 | 2094 |
] |
2095 |
OP_RESULT = ht.TNone |
|
2079 | 2096 |
|
2080 | 2097 |
class OpNetworkQuery(OpCode): |
2081 | 2098 |
"""Compute the list of networks.""" |
... | ... | |
2084 | 2101 |
("names", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), |
2085 | 2102 |
"Empty list to query all groups, group names otherwise"), |
2086 | 2103 |
] |
2104 |
OP_RESULT = ht.TNone |
|
2087 | 2105 |
|
2088 | 2106 |
|
2089 | 2107 |
def _GetOpList(): |
Also available in: Unified diff