func GetMessageType(path string) (proto.Message) {
  sensorType := strings.Split(path,":")
  switch sensorType[0] {
  case "huawei-bfd":
      return &huaweiV8R10_bfd.Bfd{}

  case "huawei-bgp":
    switch sensorType[1] {
    case "ESTABLISHED":
      return &huaweiV8R10_bgp.ESTABLISHED{}
    case "BACKWARD":
      return &huaweiV8R10_bgp.BACKWARD{}
    }
    return &huaweiV8R10_bgp.ESTABLISHED{}

  case "huawei-devm":
    return &huaweiV8R10_devm.Devm{}

  case "huawei-driver":
    switch sensorType[1] {
    case "hwEntityInvalid":
        return &huaweiV8R10_driver.HwEntityInvalid{}
    case "hwEntityResume":
        return &huaweiV8R10_driver.HwEntityResume{}
    case "hwOpticalInvalid":
      return &huaweiV8R10_driver.HwOpticalInvalid{}
    case "hwOpticalInvalidResume":
      return &huaweiV8R10_driver.HwOpticalInvalidResume{}
    }
    return &huaweiV8R10_driver.HwEntityInvalid{}

  case "huawei-ifm":
    return &huaweiV8R10_ifm.Ifm{}

  case "huawei-isis":
  case "huawei-isiscomm":
    return &huaweiV8R10_isiscomm.IsisAdjacencyChange{}

  case "huawei-mpls":
    return &huaweiV8R10_mpls.Mpls{}

  case "huawei-ospfv2":
    switch sensorType[1] {
    case "ospfNbrStateChange":
      return &huaweiV8R10_ospfv2.OspfNbrStateChange{}
    case "ospfVirtNbrStateChange":
      return &huaweiV8R10_ospfv2.OspfVirtNbrStateChange{}
    }
    return &huaweiV8R10_ospfv2.OspfNbrStateChange{}

  case "huawei-ospfv3":
    return &huaweiV8R10_ospfv3.Ospfv3NbrStateChange{}

  case "huawei-qos":
    return &huaweiV8R10_qos.Qos{}

  case "huawei-sem":
    switch sensorType[1] {
    case "hwCPUUtilizationResume":
      return &huaweiV8R10_sem.HwStorageUtilizationResume{}
    case "hwCPUUtilizationRisingAlarm":
      return &huaweiV8R10_sem.HwCPUUtilizationRisingAlarm{}
    case "hwStorageUtilizationResume":
      return &huaweiV8R10_sem.HwStorageUtilizationResume{}
    case "hwStorageUtilizationRisingAlarm":
      return &huaweiV8R10_sem.HwStorageUtilizationRisingAlarm{}
      }
    return &huaweiV8R10_sem.HwStorageUtilizationResume{}

  case "huawei-telmEmdi":
  case "huawei-emdi":
    return &huaweiV8R10_telemEmdi.TelemEmdi{}

  case "huawei-trafficmng":
    return &huaweiV8R10_trafficmng.Trafficmng{}

  default:
    fmt.Println("Error Sensor Desconocido")
    return &huaweiV8R10_devm.Devm{}
  }
    return &huaweiV8R10_devm.Devm{}
}
/* Returns the protoMessage of the sensor path.
  Huawei have only a few sensors paths for metrics.
  The sensors could be known with the command. "display telemetry sensor-path "
  @params: path (string) - The head of the sensor path. Example: "huawei-ifm"
  @returns: sensor-path proto message
*/
Returns the protoMessage of the sensor path.
Huawei have only a few sensors paths for metrics.
The sensors could be known with the command. "display telemetry sensor-path "
@params: path (string) - The head of the sensor path. Example: "huawei-ifm"
@returns: sensor-path proto message
/ * Returns the protoMessage of the sensor path . Huawei have only a few sensors paths for metrics . The sensors could be known with the command . " display telemetry sensor - path " @params : path ( string ) - The head of the sensor path . Example : " huawei - ifm " @returns : sensor - path proto message * /
func GetMessageType(path string) (proto.Message) {
  sensorType := strings.Split(path,":")
  switch sensorType[0] {
  case "huawei-bfd":
      return &huaweiV8R10_bfd.Bfd{}
  case "huawei-bgp":
    switch sensorType[1] {
    case "ESTABLISHED":
      return &huaweiV8R10_bgp.ESTABLISHED{}
    case "BACKWARD":
      return &huaweiV8R10_bgp.BACKWARD{}
    }
    return &huaweiV8R10_bgp.ESTABLISHED{}
  case "huawei-devm":
    return &huaweiV8R10_devm.Devm{}
  case "huawei-driver":
    switch sensorType[1] {
    case "hwEntityInvalid":
        return &huaweiV8R10_driver.HwEntityInvalid{}
    case "hwEntityResume":
        return &huaweiV8R10_driver.HwEntityResume{}
    case "hwOpticalInvalid":
      return &huaweiV8R10_driver.HwOpticalInvalid{}
    case "hwOpticalInvalidResume":
      return &huaweiV8R10_driver.HwOpticalInvalidResume{}
    }
    return &huaweiV8R10_driver.HwEntityInvalid{}
  case "huawei-ifm":
    return &huaweiV8R10_ifm.Ifm{}
  case "huawei-isis":
  case "huawei-isiscomm":
    return &huaweiV8R10_isiscomm.IsisAdjacencyChange{}
  case "huawei-mpls":
    return &huaweiV8R10_mpls.Mpls{}
  case "huawei-ospfv2":
    switch sensorType[1] {
    case "ospfNbrStateChange":
      return &huaweiV8R10_ospfv2.OspfNbrStateChange{}
    case "ospfVirtNbrStateChange":
      return &huaweiV8R10_ospfv2.OspfVirtNbrStateChange{}
    }
    return &huaweiV8R10_ospfv2.OspfNbrStateChange{}
  case "huawei-ospfv3":
    return &huaweiV8R10_ospfv3.Ospfv3NbrStateChange{}
  case "huawei-qos":
    return &huaweiV8R10_qos.Qos{}
  case "huawei-sem":
    switch sensorType[1] {
    case "hwCPUUtilizationResume":
      return &huaweiV8R10_sem.HwStorageUtilizationResume{}
    case "hwCPUUtilizationRisingAlarm":
      return &huaweiV8R10_sem.HwCPUUtilizationRisingAlarm{}
    case "hwStorageUtilizationResume":
      return &huaweiV8R10_sem.HwStorageUtilizationResume{}
    case "hwStorageUtilizationRisingAlarm":
      return &huaweiV8R10_sem.HwStorageUtilizationRisingAlarm{}
      }
    return &huaweiV8R10_sem.HwStorageUtilizationResume{}
  case "huawei-telmEmdi":
  case "huawei-emdi":
    return &huaweiV8R10_telemEmdi.TelemEmdi{}
  case "huawei-trafficmng":
    return &huaweiV8R10_trafficmng.Trafficmng{}
  default:
    fmt.Println("Error Sensor Desconocido")
    return &huaweiV8R10_devm.Devm{}
  }
    return &huaweiV8R10_devm.Devm{}
}
func GetMessageType ( path string ) ( proto . Message ) { sensorType := strings . Split ( path , " " ) switch sensorType [ 0 ] { case " " : return & huaweiV8R10_bfd . Bfd { } case " " : switch sensorType [ 1 ] { case " " : return & huaweiV8R10_bgp . ESTABLISHED { } case " " : return & huaweiV8R10_bgp . BACKWARD { } } return & huaweiV8R10_bgp . ESTABLISHED { } case " " : return & huaweiV8R10_devm . Devm { } case " " : switch sensorType [ 1 ] { case " " : return & huaweiV8R10_driver . HwEntityInvalid { } case " " : return & huaweiV8R10_driver . HwEntityResume { } case " " : return & huaweiV8R10_driver . HwOpticalInvalid { } case " " : return & huaweiV8R10_driver . HwOpticalInvalidResume { } } return & huaweiV8R10_driver . HwEntityInvalid { } case " " : return & huaweiV8R10_ifm . Ifm { } case " " : case " " : return & huaweiV8R10_isiscomm . IsisAdjacencyChange { } case " " : return & huaweiV8R10_mpls . Mpls { } case " " : switch sensorType [ 1 ] { case " " : return & huaweiV8R10_ospfv2 . OspfNbrStateChange { } case " " : return & huaweiV8R10_ospfv2 . OspfVirtNbrStateChange { } } return & huaweiV8R10_ospfv2 . OspfNbrStateChange { } case " " : return & huaweiV8R10_ospfv3 . Ospfv3NbrStateChange { } case " " : return & huaweiV8R10_qos . Qos { } case " " : switch sensorType [ 1 ] { case " " : return & huaweiV8R10_sem . HwStorageUtilizationResume { } case " " : return & huaweiV8R10_sem . HwCPUUtilizationRisingAlarm { } case " " : return & huaweiV8R10_sem . HwStorageUtilizationResume { } case " " : return & huaweiV8R10_sem . HwStorageUtilizationRisingAlarm { } } return & huaweiV8R10_sem . HwStorageUtilizationResume { } case " " : case " " : return & huaweiV8R10_telemEmdi . TelemEmdi { } case " " : return & huaweiV8R10_trafficmng . Trafficmng { } default : fmt . Println ( " " ) return & huaweiV8R10_devm . Devm { } } return & huaweiV8R10_devm . Devm { } }
Returns the protoMessage of the sensor path.
Returns the protoMessage of the sensor path .