\label{doc_usecases_specification_enum-specification_md_md_doc_usecases_specification_enum_specification}%
\Hypertarget{doc_usecases_specification_enum-specification_md_md_doc_usecases_specification_enum_specification}%
 \hypertarget{doc_usecases_specification_enum-specification_md_autotoc_md4717}{}\doxysection{Summary}\label{doc_usecases_specification_enum-specification_md_autotoc_md4717}

\begin{DoxyItemize}
\item {\bfseries{Scope\+:}} {\ttfamily spec}
\item {\bfseries{Level\+:}} Developer Goal
\item {\bfseries{Actors\+:}} Dev-\/\+Ops Engineer
\item {\bfseries{Brief\+:}} This use case introduces a enum specification for a part of the dockerd configuration file (daemon.\+json).
\end{DoxyItemize}\hypertarget{doc_usecases_specification_enum-specification_md_autotoc_md4718}{}\doxysection{Scenarios}\label{doc_usecases_specification_enum-specification_md_autotoc_md4718}

\begin{DoxyItemize}
\item {\bfseries{Precondition\+:}} The Dev-\/\+Ops Engineer has a working setup for {\ttfamily docker} and the daemon {\ttfamily dockerd}.
\item {\bfseries{Main success scenario\+:}}
\begin{DoxyItemize}
\item The Dev-\/\+Ops Engineer wants to write a specification for the {\ttfamily log level} in the {\ttfamily dockerd} configuration.
\item The configuration key is {\ttfamily log/level}.
\item The configuration key uses {\ttfamily description}, {\ttfamily default} and {\ttfamily enum} as metakeys.
\item The specification strictly defines all enum values {\ttfamily debug}, {\ttfamily info}, {\ttfamily warn}, {\ttfamily error} and {\ttfamily fatal}.
\item The keys are all stored for the {\ttfamily spec} namespace.
\end{DoxyItemize}
\item {\bfseries{Alternative scenario\+:}} None.
\item {\bfseries{Error scenario\+:}}
\begin{DoxyItemize}
\item Wrong metakeys are used (yielded as error to the user).
\end{DoxyItemize}
\item {\bfseries{Postcondition\+:}} The keys are all stored for the {\ttfamily spec} namespace..
\item {\bfseries{Non-\/functional Constraints\+:}} None.
\end{DoxyItemize}\hypertarget{doc_usecases_specification_enum-specification_md_autotoc_md4719}{}\doxysection{Example}\label{doc_usecases_specification_enum-specification_md_autotoc_md4719}
The {\ttfamily log level} configuration for the {\ttfamily dockerd} could look like\+:


\begin{DoxyCode}{0}
\DoxyCodeLine{[log/level]}
\DoxyCodeLine{meta:/description = Set the logging level}
\DoxyCodeLine{meta:/enum/check = \#4}
\DoxyCodeLine{meta:/enum/check/\#0 = debug}
\DoxyCodeLine{meta:/enum/check/\#1 = info}
\DoxyCodeLine{meta:/enum/check/\#2 = warn}
\DoxyCodeLine{meta:/enum/check/\#3 = error}
\DoxyCodeLine{meta:/enum/check/\#4 = fatal}
\DoxyCodeLine{meta:/default = info}

\end{DoxyCode}


In case the key {\ttfamily log/level} does not exist, {\ttfamily spec} plugin creates a {\ttfamily default} key with value {\ttfamily info} in the default namespace.

For the full specification of the {\ttfamily dockerd} configuration file see \href{/home/jenkins/workspace/libelektra-release/examples/spec/dockerd.ini}{\texttt{ dockerd-\/spec}}. 