Commit 63f4bce5 authored by Hrvoje Ribicic's avatar Hrvoje Ribicic
Browse files

Add NIC VLAN field retrieval to Haskell queries



The field was added to Python queries in an earlier version, and now
has to be added to the Haskell queries as well.
Signed-off-by: default avatarHrvoje Ribicic <riba@google.com>
Reviewed-by: default avatarThomas Thrainer <thomasth@google.com>
parent 6c005975
......@@ -284,6 +284,9 @@ instanceFields =
, (fieldDefinitionCompleter "nic.link/%d" "NicLink/%d" QFTText
("Link" ++ nicDescSuffix),
getIndexedNicField nicpLink, QffNormal)
, (fieldDefinitionCompleter "nic.vlan/%d" "NicVLAN/%d" QFTText
("VLAN" ++ nicDescSuffix),
getOptionalIndexedNicField getNicVlan, QffNormal)
, (fieldDefinitionCompleter "nic.network.name/%d" "NicNetworkName/%d" QFTText
("Network name" ++ nicDescSuffix),
getIndexedNicNetworkNameField, QffNormal)
......@@ -334,6 +337,12 @@ getNicBridge nicParams
| nicpMode nicParams == NMBridged = Just $ nicpLink nicParams
| otherwise = Nothing
-- | Gets the VLAN of a NIC.
getNicVlan :: FilledNicParams -> Maybe String
getNicVlan params
| nicpMode params == NMOvs = Just $ nicpVlan params
| otherwise = Nothing
-- | Fill partial NIC params by using the defaults from the configuration.
fillNicParamsFromConfig :: ConfigData -> PartialNicParams -> FilledNicParams
fillNicParamsFromConfig cfg = fillNicParams (getDefaultNicParams cfg)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment