module sal-group {
    namespace "urn:opendaylight:group:service";
    prefix group;

    import opendaylight-inventory {prefix inv;revision-date "2013-08-19";}
    import opendaylight-group-types {prefix group-type;revision-date "2013-10-18";}
    import flow-capable-transaction {prefix tr; revision-date "2015-03-04";}

    description "Openflow group management.";

    revision "2013-09-18" {
        description "Initial revision of group service";
    }

    grouping node-group {
        description "Basic group structure suitable for rpc input (contains node-context).";
        uses "inv:node-context-ref";
        uses group-type:group;
    }

    grouping group-update {
        description "DataStore aware update group structure suitable for rpc input (contains node-context).";
        uses "inv:node-context-ref";

        container original-group {
            uses group-type:group;
        }
        container updated-group {
            uses group-type:group;
        }
    }

    rpc add-group {
        description "Adding group to openflow device";
        input {
            uses tr:transaction-metadata;
            leaf group-ref {
                type group-type:group-ref;
            }
            uses node-group;
        }
        output {
            uses tr:transaction-aware;
        }
    }

    rpc remove-group {
        description "Removing group from openflow device";
        input {
            uses tr:transaction-metadata;
            leaf group-ref {
                type group-type:group-ref;
            }
            uses node-group;
        }
        output {
            uses tr:transaction-aware;
        }
    }

    rpc update-group {
        description "Updating group on openflow device";
        input {
            uses tr:transaction-metadata;
            leaf group-ref {
                type group-type:group-ref;
            }
            uses group-update;
        }
        output {
            uses tr:transaction-aware;
        }
    }
}