From 389d68d7b648a48c322c3451cba36942f77fc659 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 14 Feb 2014 20:31:14 +0100 Subject: [PATCH] BUG-421: Define multipart-transaction-aware This bundles up the 'moreReplies' leaf into a grouping, as it is used in multiple places. The new multipart-transaction-aware is used instead, resulting in a common class shared between the notifications, which should allow for better code reuse. Change-Id: If225ba4a24d64158893c9f67b5115a6b8b19fcd9 Signed-off-by: Robert Varga --- .../main/yang/flow-capable-transaction.yang | 21 +++- .../src/main/yang/sal-table.yang | 5 +- .../yang/opendaylight-flow-statistics.yang | 115 +++++++++--------- .../opendaylight-flow-table-statistics.yang | 53 ++++---- .../yang/opendaylight-group-statistics.yang | 29 ++--- .../yang/opendaylight-meter-statistics.yang | 18 +-- .../yang/opendaylight-port-statistics.yang | 69 +++++------ .../yang/opendaylight-queue-statistics.yang | 87 +++++++------ 8 files changed, 185 insertions(+), 212 deletions(-) diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang index 1c675f015d..160291cf21 100644 --- a/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang +++ b/opendaylight/md-sal/model/model-flow-service/src/main/yang/flow-capable-transaction.yang @@ -1,17 +1,17 @@ module flow-capable-transaction { - namespace "urn:opendaylight:flow:transaction"; + namespace "urn:opendaylight:flow:transaction"; prefix type; import opendaylight-inventory {prefix inv; revision-date "2013-08-19";} import ietf-inet-types {prefix inet; revision-date "2010-09-24";} import yang-ext {prefix ext; revision-date "2013-07-09";} - + revision "2013-11-03" { description "Initial revision"; } typedef transaction-id { - type uint64; + type uint64; } // This refers to MD-SAL transaction reference. grouping transaction-metadata { @@ -19,13 +19,22 @@ module flow-capable-transaction { type inet:uri; } } - + grouping transaction-aware { leaf transaction-id { type transaction-id; } } + grouping multipart-transaction-aware { + uses transaction-aware; + + leaf moreReplies { + type boolean; + default false; + } + } + rpc get-next-transaction-id { input { leaf node { @@ -34,7 +43,7 @@ module flow-capable-transaction { } } output { - uses transaction-aware; + uses transaction-aware; } } @@ -50,4 +59,4 @@ module flow-capable-transaction { } } } -} \ No newline at end of file +} diff --git a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang index 66990d473f..b125116bb1 100644 --- a/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang +++ b/opendaylight/md-sal/model/model-flow-service/src/main/yang/sal-table.yang @@ -33,10 +33,7 @@ module sal-table { notification table-updated { uses "inv:node-context-ref"; - uses tr:transaction-aware; - leaf moreReplies { - type boolean; - } + uses tr:multipart-transaction-aware; uses table-type:table-features; } } diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang index 94e2c0a428..e0df924a0e 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang +++ b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-statistics.yang @@ -10,51 +10,51 @@ module opendaylight-flow-statistics { import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} import flow-capable-transaction {prefix tr;} import ietf-inet-types {prefix inet; revision-date "2010-09-24";} - + revision "2013-08-19" { description "Initial revision of flow statistics service"; } - - //Augment flow statistics data to the flow-capable-node->table->flow - augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" { + + //Augment flow statistics data to the flow-capable-node->table->flow + augment "/inv:nodes/inv:node/flow-node:table/flow-node:flow" { ext:augment-identifier "flow-statistics-data"; uses flow-statistics; } - - grouping flow-statistics { + + grouping flow-statistics { container flow-statistics { //config "false"; - uses flow-types:flow; - uses stat-types:generic-statistics; + uses flow-types:flow; + uses stat-types:generic-statistics; + } + } + + typedef flow-id { + description "flow id"; + type inet:uri; + } + + grouping flow-and-statistics-map-list { + description "List of flow and statistics map"; + list flow-and-statistics-map-list { + key "flow-id"; + leaf flow-id { + type flow-id; + } + uses flow-and-statistics-map; } - } - - typedef flow-id { - description "flow id"; - type inet:uri; - } - - grouping flow-and-statistics-map-list { - description "List of flow and statistics map"; - list flow-and-statistics-map-list { - key "flow-id"; - leaf flow-id { - type flow-id; - } - uses flow-and-statistics-map; - } - } - - grouping flow-and-statistics-map{ - description "Mapping between flow and its statistics"; - uses flow-types:flow; - uses stat-types:generic-statistics; - } - + } + + grouping flow-and-statistics-map{ + description "Mapping between flow and its statistics"; + uses flow-types:flow; + uses stat-types:generic-statistics; + } + // RPC calls to fetch flow statistics rpc get-all-flows-statistics-from-all-flow-tables { - description "Fetch statistics of all the flow present in all the flow tables of the switch"; + description "Fetch statistics of all the flow present in all the flow tables of the switch"; input { uses inv:node-context-ref; } @@ -62,15 +62,15 @@ module opendaylight-flow-statistics { uses flow-and-statistics-map-list; uses tr:transaction-aware; } - + } rpc get-all-flow-statistics-from-flow-table { - description "Fetch statistics of all the flow present in the specific flow table of the switch"; + description "Fetch statistics of all the flow present in the specific flow table of the switch"; input { uses inv:node-context-ref; leaf table-id { - type table-types:table-id; + type table-types:table-id; } } output { @@ -80,7 +80,7 @@ module opendaylight-flow-statistics { } rpc get-flow-statistics-from-flow-table { - description "Fetch statistics of the specific flow present in the specific flow table of the switch"; + description "Fetch statistics of the specific flow present in the specific flow table of the switch"; input { uses inv:node-context-ref; uses flow-types:flow; @@ -92,61 +92,58 @@ module opendaylight-flow-statistics { } notification flows-statistics-update { - description "Flows statistics sent by switch"; - leaf moreReplies { + description "Flows statistics sent by switch"; + leaf moreReplies { type boolean; } uses inv:node; - uses flow-and-statistics-map-list; - uses tr:transaction-aware; + uses flow-and-statistics-map-list; + uses tr:transaction-aware; } - //Models for aggregate flow statistics collection - augment "/inv:nodes/inv:node/flow-node:table" { + //Models for aggregate flow statistics collection + augment "/inv:nodes/inv:node/flow-node:table" { ext:augment-identifier "aggregate-flow-statistics-data"; uses aggregate-flow-statistics; } - - grouping aggregate-flow-statistics { + + grouping aggregate-flow-statistics { container aggregate-flow-statistics { //config "false"; - uses stat-types:aggregate-flow-statistics; + uses stat-types:aggregate-flow-statistics; } - } - + } + // RPC calls to fetch aggregate flow statistics rpc get-aggregate-flow-statistics-from-flow-table-for-all-flows { - description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch"; + description "Fetch aggregate statistics for all the flows present in the specific flow table of the switch"; input { uses inv:node-context-ref; leaf table-id { - type table-types:table-id; + type table-types:table-id; } } output { - uses stat-types:aggregate-flow-statistics; + uses stat-types:aggregate-flow-statistics; uses tr:transaction-aware; } } rpc get-aggregate-flow-statistics-from-flow-table-for-given-match { - description "Fetch aggregate statistics for all the flow matches to the given match from the given table of the switch"; + description "Fetch aggregate statistics for all the flow matches to the given match from the given table of the switch"; input { uses inv:node-context-ref; uses flow-types:flow; } output { - uses stat-types:aggregate-flow-statistics; + uses stat-types:aggregate-flow-statistics; uses tr:transaction-aware; } } notification aggregate-flow-statistics-update { - description "Aggregate flow statistics for a table, sent by switch"; - leaf moreReplies { - type boolean; - } + description "Aggregate flow statistics for a table, sent by switch"; uses inv:node; - uses stat-types:aggregate-flow-statistics; - uses tr:transaction-aware; + uses stat-types:aggregate-flow-statistics; + uses tr:multipart-transaction-aware; } } diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang index ab84f50f31..431ef50624 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang +++ b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-flow-table-statistics.yang @@ -2,7 +2,7 @@ module opendaylight-flow-table-statistics { namespace "urn:opendaylight:flow:table:statistics"; prefix flowtablestat; - import flow-capable-transaction {prefix tr;} + import flow-capable-transaction {prefix tr;} import yang-ext {prefix ext; revision-date "2013-07-09";} import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} @@ -19,50 +19,47 @@ module opendaylight-flow-table-statistics { } //Augment flow table statistics data to the table - augment "/inv:nodes/inv:node/flow-node:table" { + augment "/inv:nodes/inv:node/flow-node:table" { ext:augment-identifier "flow-table-statistics-data"; uses flow-table-statistics; } - - grouping flow-table-statistics { + + grouping flow-table-statistics { container flow-table-statistics { //config "false"; - uses stat-types:generic-table-statistics; + uses stat-types:generic-table-statistics; } - } + } //RPC calls to fetch flow table statistics grouping flow-table-and-statistics-map { - list flow-table-and-statistics-map { - key "table-id"; - leaf table-id { - type table-types:table-id; - } - uses stat-types:generic-table-statistics; - } + list flow-table-and-statistics-map { + key "table-id"; + leaf table-id { + type table-types:table-id; + } + uses stat-types:generic-table-statistics; + } } rpc get-flow-tables-statistics { - description "Fetch statistics of all the flow tables present on the tarnet node"; - input { - uses inv:node-context-ref; - } - output { - uses flow-table-and-statistics-map; - uses tr:transaction-aware; - } + description "Fetch statistics of all the flow tables present on the tarnet node"; + input { + uses inv:node-context-ref; + } + output { + uses flow-table-and-statistics-map; + uses tr:transaction-aware; + } } //Notification to receive table statistics update notification flow-table-statistics-update { - description "Receive flow table statistics update"; - - leaf moreReplies { - type boolean; - } + description "Receive flow table statistics update"; + uses inv:node; - uses flow-table-and-statistics-map; - uses tr:transaction-aware; + uses flow-table-and-statistics-map; + uses tr:multipart-transaction-aware; } } diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang index 2f5c5bbe0a..7779819918 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang +++ b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-group-statistics.yang @@ -16,37 +16,37 @@ module opendaylight-group-statistics { description "Initial revision of group statistics service"; } - grouping group-statistics { + grouping group-statistics { container group-statistics { //config "false"; uses group-types:group-statistics; } - } + } augment "/inv:nodes/inv:node/fni:group" { ext:augment-identifier "node-group-statistics"; uses group-statistics; } - grouping group-desc { + grouping group-desc { container group-desc { //config "false"; uses group-types:group; } - } + } augment "/inv:nodes/inv:node/fni:group" { ext:augment-identifier "node-group-desc-stats"; uses group-desc; } - grouping group-features { - container group-features { + grouping group-features { + container group-features { //config "false"; uses group-types:group-features-reply; } } - + augment "/inv:nodes/inv:node" { ext:augment-identifier "node-group-features"; uses group-features; @@ -103,29 +103,20 @@ module opendaylight-group-statistics { //Notification calls notification group-statistics-updated { - leaf moreReplies { - type boolean; - } uses inv:node; uses group-types:group-statistics-reply; - uses tr:transaction-aware; + uses tr:multipart-transaction-aware; } notification group-desc-stats-updated { - leaf moreReplies { - type boolean; - } uses inv:node; uses group-types:group-desc-stats-reply; - uses tr:transaction-aware; + uses tr:multipart-transaction-aware; } notification group-features-updated { - leaf moreReplies { - type boolean; - } uses inv:node; uses group-types:group-features-reply; - uses tr:transaction-aware; + uses tr:multipart-transaction-aware; } } diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang index b2cf78b61d..0055dc39bd 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang +++ b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-meter-statistics.yang @@ -90,32 +90,20 @@ module opendaylight-meter-statistics { //Notification calls notification meter-statistics-updated { - leaf moreReplies { - type boolean; - } - uses inv:node; uses meter-types:meter-statistics-reply; - uses tr:transaction-aware; + uses tr:multipart-transaction-aware; } notification meter-config-stats-updated { - leaf moreReplies { - type boolean; - } - uses inv:node; uses meter-types:meter-config-stats-reply; - uses tr:transaction-aware; + uses tr:multipart-transaction-aware; } notification meter-features-updated { - leaf moreReplies { - type boolean; - } - uses inv:node; uses meter-types:meter-features-reply; - uses tr:transaction-aware; + uses tr:multipart-transaction-aware; } } diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang index 22f0aca5e7..e711877a02 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang +++ b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-port-statistics.yang @@ -2,7 +2,7 @@ module opendaylight-port-statistics { namespace "urn:opendaylight:port:statistics"; prefix portstat; - import flow-capable-transaction {prefix tr;} + import flow-capable-transaction {prefix tr;} import yang-ext {prefix ext; revision-date "2013-07-09";} import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} import opendaylight-statistics-types {prefix stat-types;revision-date "2013-09-25";} @@ -14,64 +14,61 @@ module opendaylight-port-statistics { revision "2013-12-14" { description "Initial revision of port statistics model"; } - + //Augment port statistics data to the flow-capable-node-connector - augment "/inv:nodes/inv:node/inv:node-connector" { + augment "/inv:nodes/inv:node/inv:node-connector" { ext:augment-identifier "flow-capable-node-connector-statistics-data"; uses flow-capable-node-connector-statistics; } - - grouping flow-capable-node-connector-statistics { + + grouping flow-capable-node-connector-statistics { container flow-capable-node-connector-statistics { //config "false"; uses stat-types:node-connector-statistics; } - } - + } + // RPC calls rpc get-all-node-connectors-statistics { - description "Get statistics for all node connectors from the node"; + description "Get statistics for all node connectors from the node"; input { uses inv:node-context-ref; } output { - uses node-connector-statistics-and-port-number-map; + uses node-connector-statistics-and-port-number-map; uses tr:transaction-aware; } } - + rpc get-node-connector-statistics { - description "Get statistics for given node connector from the node"; - input { - uses inv:node-context-ref; - leaf node-connector-id { - type inv:node-connector-id; - } - } - output { + description "Get statistics for given node connector from the node"; + input { + uses inv:node-context-ref; + leaf node-connector-id { + type inv:node-connector-id; + } + } + output { uses stat-types:node-connector-statistics; uses tr:transaction-aware; - } + } } - - //Notification for node connector statistics update - grouping node-connector-statistics-and-port-number-map { - description "List of map - node connectors and their statistics"; - list node-connector-statistics-and-port-number-map { - key "node-connector-id"; - leaf node-connector-id { - type inv:node-connector-id; - } - uses stat-types:node-connector-statistics; - } - } - notification node-connector-statistics-update { - leaf moreReplies { - type boolean; + //Notification for node connector statistics update + grouping node-connector-statistics-and-port-number-map { + description "List of map - node connectors and their statistics"; + list node-connector-statistics-and-port-number-map { + key "node-connector-id"; + leaf node-connector-id { + type inv:node-connector-id; + } + uses stat-types:node-connector-statistics; } + } + + notification node-connector-statistics-update { uses inv:node; - uses node-connector-statistics-and-port-number-map; - uses tr:transaction-aware; + uses node-connector-statistics-and-port-number-map; + uses tr:multipart-transaction-aware; } } diff --git a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang index 9c48cfdbe8..caf52aa9ef 100644 --- a/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang +++ b/opendaylight/md-sal/model/model-flow-statistics/src/main/yang/opendaylight-queue-statistics.yang @@ -2,7 +2,7 @@ module opendaylight-queue-statistics { namespace "urn:opendaylight:queue:statistics"; prefix queuestat; - import flow-capable-transaction {prefix tr;} + import flow-capable-transaction {prefix tr;} import yang-ext {prefix ext; revision-date "2013-07-09";} import opendaylight-inventory {prefix inv;revision-date "2013-08-19";} import flow-node-inventory {prefix flow-node;revision-date "2013-08-19";} @@ -18,35 +18,35 @@ module opendaylight-queue-statistics { } //Augment queue statistics data to the flow-capable-node-connector - augment "/inv:nodes/inv:node/inv:node-connector/flow-node:queue" { + augment "/inv:nodes/inv:node/inv:node-connector/flow-node:queue" { ext:augment-identifier "flow-capable-node-connector-queue-statistics-data"; uses flow-capable-node-connector-queue-statistics; } - - grouping flow-capable-node-connector-queue-statistics { + + grouping flow-capable-node-connector-queue-statistics { container flow-capable-node-connector-queue-statistics { //config "false"; uses stat-types:generic-queue-statistics; } - } - - //RPC calls to fetch queue statistics + } + + //RPC calls to fetch queue statistics grouping queue-id-and-statistics-map { - list queue-id-and-statistics-map { - key "queue-id node-connector-id"; - leaf queue-id { - type queue-types:queue-id; - } - leaf node-connector-id { - type inv:node-connector-id; - } - + list queue-id-and-statistics-map { + key "queue-id node-connector-id"; + leaf queue-id { + type queue-types:queue-id; + } + leaf node-connector-id { + type inv:node-connector-id; + } + uses stat-types:generic-queue-statistics; - } + } } rpc get-all-queues-statistics-from-all-ports { - description "Get statistics for all the queues attached to all the ports from the node"; + description "Get statistics for all the queues attached to all the ports from the node"; input { uses inv:node-context-ref; } @@ -57,44 +57,41 @@ module opendaylight-queue-statistics { } rpc get-all-queues-statistics-from-given-port { - description "Get statistics for all queues for given port of the node"; - input { - uses inv:node-context-ref; - leaf node-connector-id { - type inv:node-connector-id; - } - } - output { + description "Get statistics for all queues for given port of the node"; + input { + uses inv:node-context-ref; + leaf node-connector-id { + type inv:node-connector-id; + } + } + output { uses queue-id-and-statistics-map; uses tr:transaction-aware; - } + } } rpc get-queue-statistics-from-given-port { - description "Get statistics for given queues from given port of the node"; - input { - uses inv:node-context-ref; - leaf node-connector-id { - type inv:node-connector-id; - } - leaf queue-id { - type queue-types:queue-id; - } - } - output { + description "Get statistics for given queues from given port of the node"; + input { + uses inv:node-context-ref; + leaf node-connector-id { + type inv:node-connector-id; + } + leaf queue-id { + type queue-types:queue-id; + } + } + output { uses queue-id-and-statistics-map; uses tr:transaction-aware; - } + } } //Notification for port statistics update - notification queue-statistics-update { - leaf moreReplies { - type boolean; - } + notification queue-statistics-update { uses inv:node; - uses queue-id-and-statistics-map; - uses tr:transaction-aware; + uses queue-id-and-statistics-map; + uses tr:multipart-transaction-aware; } } -- 2.36.6