management: FacePersistency field in ControlParameters
Change-Id: I3a93bd658d40f3d77f7790b72e8873646ecc7990
Refs: #2991
diff --git a/src/management/nfd-control-command.cpp b/src/management/nfd-control-command.cpp
index d8ab2c6..746db92 100644
--- a/src/management/nfd-control-command.cpp
+++ b/src/management/nfd-control-command.cpp
@@ -95,10 +95,20 @@
: ControlCommand("faces", "create")
{
m_requestValidator
- .required(CONTROL_PARAMETER_URI);
+ .required(CONTROL_PARAMETER_URI)
+ .optional(CONTROL_PARAMETER_FACE_PERSISTENCY);
m_responseValidator
.required(CONTROL_PARAMETER_URI)
- .required(CONTROL_PARAMETER_FACE_ID);
+ .required(CONTROL_PARAMETER_FACE_ID)
+ .required(CONTROL_PARAMETER_FACE_PERSISTENCY);
+}
+
+void
+FaceCreateCommand::applyDefaultsToRequest(ControlParameters& parameters) const
+{
+ if (!parameters.hasFacePersistency()) {
+ parameters.setFacePersistency(FacePersistency::FACE_PERSISTENCY_PERSISTENT);
+ }
}
void