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

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

    description "Openflow role management.";

    revision "2015-07-27" {
        description "Initial revision of role service";
    }

    typedef ofp-role {
        description "role of OFPlugin instance";
        type enumeration {
            enum NOCHANGE {
                description "no change to role";
            }

            enum BECOMEMASTER {
                description "promote current role to MASTER";
            }

            enum BECOMESLAVE {
                description "demote current role to SLAVE";
            }
        }
    }

    rpc set-role {
        description "Setting role to openflow device.";
        input {
            uses tr:transaction-metadata;
            uses "inv:node-context-ref";
            leaf controller-role {
                type ofp-role;
            }
        }
        output {
            uses tr:transaction-aware;
        }
    }
}