/
CPS-799 Spike: Define states and state handling for CM handle
CPS-799 Spike: Define states and state handling for CM handle
References
CPS-799: Spike: Define states and state handling for CM handleClosed
Issues/Decisions
Issue | Notes | Decision | |
---|---|---|---|
1 |
|
|
|
Proposal
The state of a given cmhandle consists of the cmhandle state itself as well as the synchronization state information related to the model instance data related to the cmhandle. Below shows the makeup of this state follow by the allowed cmhandle state transitions.
NCMP CRUD / Action requests are only allowed if state.cmhandleState == READY.
CRUD / Action requests are rejected with IllegalStateException for all other cmHandleStates.
Requests to get state / public properties / cmhandle metadata are always allowed on a cmhandle regardless of the value of 'state'.
CmHandle state transitions :
Supported NCMP API Requests (CPS-E-05):
------ Sync : Get the current state of a cmhandle when cmhandle is READY ----------------
Request (sync)
GET {ncmp-root}/ncmp/v1/ch/<cmhandle>/state
Accept: application/json
Response
"state" : {
"cmHandleState" : "READY",
"dataSyncEnabled" : true,
"dataSyncState" : { *
operational {
"state" : "SYNCHRONIZED",
"lastSyncTime" : "2022-04-01 07:37:20"
}
}
}
* runningStoreState is not included in response if it does not exist / is not supported (yet)
------ Sync :Get the current state of a cmhandle when cmhandle is LOCKED ---------------
Request (sync)
GET {ncmp-root}/ncmp/v1/ch/<cmhandle>/state
Accept: application/json
Response
"state" : {
"cmHandleState" : "LOCKED",
"lockReason" : {
"reason" : "LOCKED_MISBEHAVING",
"details" : "Error recovering Modules for cmhandle"
}
}
------ Async : Get the current state of a cmhandle when cmhandle is READY ----------------
Request (async)
GET {ncmp-root}/ncmp/v1/ch/<cmhandle>/state?topic=<topic-name>
Accept: application/json
Response
{
"requestId" : "dffrtg56-rt56"
}
Event :
"requestId" : "dffrtg56-rt56",
"data" : {
"cmhandle" : "dfsdgfw454df",
"state" : {
"cmHandleState" : "READY",
"dataSyncEnabled" : true,
"dataSyncState" : {
operational {
"state" : "SYNCHRONIZED",
"lastSyncTime" : "2022-04-01 07:37:20"
}
}
}
}
, multiple selections available,
Related content
CPS-1733: Upgrade YANG Schema-Set for CM Handle Using a Module Set Tag
CPS-1733: Upgrade YANG Schema-Set for CM Handle Using a Module Set Tag
Read with this
CM-Handle State Changes and Notifications Overview
CM-Handle State Changes and Notifications Overview
More like this
CPS-1152: Spike Conform JSON and dmi-registry Casing Conventions
CPS-1152: Spike Conform JSON and dmi-registry Casing Conventions
More like this
WIP: CPS-896: CMHandle Registration Response structure
WIP: CPS-896: CMHandle Registration Response structure
More like this
CPS-1638: CM Handle Connectivity Freshness/Staleness (Trustlevel)
CPS-1638: CM Handle Connectivity Freshness/Staleness (Trustlevel)
More like this
CPS Data Notifications Overview
CPS Data Notifications Overview
More like this