yumaworks-ycontrol

YumaPro control system message definition.

  • Version: 2014-11-19

    yumaworks-ycontrol@2014-11-19


    
      module yumaworks-ycontrol {
    
        yang-version 1;
    
        namespace
          "http://yumaworks.com/ns/yumaworks-ycontrol";
    
        prefix yctl;
    
        import yuma-ncx {
          prefix ncx;
        }
        import yuma-types {
          prefix yt;
        }
    
        organization "YumaWorks, Inc.";
    
        contact
          "Support <support at yumaworks.com>";
    
        description
          "YumaPro control system message definition.";
    
        revision "2014-11-19" {
          description
            "Support '*' as the service-id to indicate a server
    event message that is intended for the YControl layer
    itself, called ALL_SERVICES.
    Add shutdown-event message for ALL_SERVICES";
        }
    
        revision "2014-04-08" {
          description "Initial version.";
        }
    
    
        container ycontrol {
          ncx:abstract;
          ncx:hidden;
          leaf message-id {
            type uint32 {
              range "1 .. max";
            }
            mandatory true;
            description
              "Message identifier.
    For server-response and subsys-response message types,
    this value is the same as the corresponding request
    message.";
          }
    
          leaf message-type {
            type enumeration {
              enum "server-event" {
                value 0;
                description
                  "Message from server to sub-system.
    No response expected.";
              }
              enum "server-request" {
                value 1;
                description
                  "Request message from server to sub-system.
    A response is expected.";
              }
              enum "server-response" {
                value 2;
                description
                  "Response message from server to sub-system.
    Sent when subsys-req received.
    No response is expected";
              }
              enum "subsys-event" {
                value 3;
                description
                  "Message from sub-system to server.
    No response expected.";
              }
              enum "subsys-request" {
                value 4;
                description
                  "Request message from sub-system to server.
    A response is expected.";
              }
              enum "subsys-response" {
                value 5;
                description
                  "Response message from sub-system to server.
    Sent when server-req received.
    No response is expected";
              }
              enum "ycontrol-error" {
                value 6;
                description
                  "Response message from either sub-system or server.
    Sent when a recoverable YControl or service layer
    error occurs.
    
    If non-recoverable error, then session is dropped
    and no response is sent. Example error: message
    is for a service-id that does not exist.
    No response is expected";
              }
            }
            mandatory true;
            description "Message type";
          }
    
          leaf server-id {
            type union {
              type yt:NcxName;
              type string {
                length "0";
              }
            }
            mandatory true;
            description
              "Server identifier or empty if not known by subsys";
          }
    
          leaf subsys-id {
            type yt:NcxName;
            mandatory true;
            description "Subsystem identifier";
          }
    
          leaf service-id {
            type union {
              type yt:NcxName;
              type string {
                pattern '\*';
              }
            }
            mandatory true;
            description
              "Service identifier. The value '*' indicates a
    server-event message to all services. These messages
    are handled by the ycontrol library, not the individual
    service libraries.";
          }
    
          choice message-payload {
            mandatory true;
            container payload {
              description
                "This <payload> container is augmented with a
    service-specific container from other modules.";
              leaf shutdown-event {
                type empty;
                description
                  "Message type: server-event;
    Purpose: The server is shutting down. Sent to
    all services (service-id = '*')
    
    Expected Response Message: none";
              }
            }  // container payload
            leaf ok {
              type empty;
              description
                "Sent when a request message is processed
    successfully and no data is needed in the
    response.";
            }
            container error {
              leaf error-number {
                type uint32;
                mandatory true;
                description
                  "Internal error number";
              }
    
              leaf transaction-id {
                type string;
                description
                  "Server specific transaction identifier.
    Sent from subsystem to server in
    subsys-response.
    It identifies the transaction in case multiple
    transactions are in progress at once.";
              }
    
              leaf error-message {
                type string;
                description
                  "Internal error message, if different from
    get_error_string(error-number).";
              }
    
              leaf error-index {
                type uint32 {
                  range "1 .. max";
                }
                description
                  "Internal edit index number from <start-transaction>
    message. Set only if an edit-specific error occurred.";
              }
            }  // container error
          }  // choice message-payload
        }  // container ycontrol
      }  // module yumaworks-ycontrol
    

© 2023 YumaWorks, Inc. All rights reserved.