diff --git a/03-developer-how-to-for-modules.md b/03-developer-how-to-for-modules.md index 0519a5e2d33758af8c294665e1cdfaa138b102e0..58b7d1142c11afc5b9ab1ce0905f890193c73c06 100644 --- a/03-developer-how-to-for-modules.md +++ b/03-developer-how-to-for-modules.md @@ -631,3 +631,41 @@ To uninstall, just: ```bash python3 -m pip uninstall osmclient ``` + +## kafka messages + +OSM modules interchange messages via kafka. Each message is composed by a topic, a key and a value.. + +Used **kafka topics** at OSM are: (in brakets is indicated modules that produce and consume them with the following leyend: [P: producer] [Ca: consumer by all instances, that is broadcasted] [C: consumer only by one instance, that is load balanced]): + +- admin: [P: NBI,LCM] [Ca: NBI,LCM] administrative or OSM internal issues +- vnfd: [P: NBI] related to vnf descriptor +- nsd: [P: NBI] related to ns descriptor +- nst: [P: NBI] related to netslice template +- pdu: [P: NBI] realted to physical data units +- ns: [P: NBI] [C: NBI,LCM] related to network service +- nsi: [P: NBI] [C: NBI,LCM] related to netslice instance +- vim_account: [P: NBI] [C: LCM] related to VIM target +- wim_account: [P: NBI] [C: LCM] related to WIM target +- sdn: [P: NBI] [C: LCM] related to Software Define Network Controller +- k8scluster: [P: NBI] [C: LCM] related to kubernetes cluster +- k8srepo: [P: NBI] [C: LCM] related to kubernetes repository +- pla: [P: LCM] [C: LCM] related to placement location algorithm +- user: [P: NBI] related to OSM user +- project: [P: NBI] related to OSM user + +Used **kafka keys** are topic dependent, but common keys include and action to do (infinitive), or an action already done (past partiple): + +- create/created: to create/has been created +- delete/deleted: to delete/has been deleted +- edit/edited: to update or change/has been updated or changed +- instantiate/instantiated: to instantiate a `ns` or `nsi` +- terminate/terminated: to remove the instantiation of a `ns` or `nsi` +- scale/scaled: to scale a `ns` or `nsi` +- action/actioned: to perform a day-2 operation over a `ns` or `nsi` +- ping: used for `admin` just to sent a keep alive +- echo: used for `admin` for debuging and kakfa initialization. Receiver just log the content +- revoke_token: used for `admin` at NBI to inform other peers to clean the token cache of one or all +- get_placement/placement: used for `pla` to order a new placement calculation/receive a placement result + +The content of kafka **values** are a dictionary, except for `echo` key that is a text. Dictionary contains at least the `_id` key (OSM identifier) needed for identigy the target element in the database. In the case of ns/nsi it contains also the operation id (`nslcmop_id`/`nsilcmop_id`).