update at 2023/08/14

This commit is contained in:
2023-08-14 21:41:37 +08:00
parent a039a664f1
commit 44e8cbee2c
255 changed files with 20426 additions and 233 deletions

View File

@@ -9,13 +9,17 @@ import (
"github.com/go-resty/resty/v2"
"ems.agt/lib/dborm"
"ems.agt/lib/log"
"ems.agt/lib/oauth"
"ems.agt/lib/services"
"ems.agt/restagent/config"
)
var (
UriAAAASSO = config.UriPrefix + "/aaaa/{apiVersion}/security/sso" // for external
UriAAAASSO = config.DefaultUriPrefix + "/aaaa/{apiVersion}/security/sso" // for 4A external
CustomUriAAAASSO = config.UriPrefix + "/aaaa/{apiVersion}/security/sso" // for 4A external
)
var client = resty.New()
@@ -64,17 +68,9 @@ func GetSSOFromAAAA(w http.ResponseWriter, r *http.Request) {
log.Debugf("r.RemoteAddr:%s r.Host: %s", r.RemoteAddr, r.Host)
var aaaaIp, omcIp string
addr := strings.Split(r.RemoteAddr, ":")
if len(addr) > 0 {
//aaaaIp := r.RemoteAddr[:strings.Index(r.Host, ":")]
aaaaIp = addr[0]
}
addr = strings.Split(r.Host, ":")
if len(addr) > 0 {
//omcIp := r.Host[:strings.Index(r.Host, ":")]
omcIp = addr[0]
}
aaaaIp := r.RemoteAddr[:strings.Index(r.RemoteAddr, ":")]
omcIp := r.Host[:strings.Index(r.Host, ":")]
log.Debugf("aaaaIp=%s omcIp=%s", aaaaIp, omcIp)
requestURI2NF := fmt.Sprintf("http://%s:8080/qryUserByTicket", aaaaIp)
@@ -107,11 +103,35 @@ func GetSSOFromAAAA(w http.ResponseWriter, r *http.Request) {
if len(ssoResult.SSO.Account) != 0 {
accid = ssoResult.SSO.Account[0].Accid
}
redirectUrl := fmt.Sprintf("http://%s:8888/home.html?user=%s", omcIp, accid)
services.ResponseRedirect(w, redirectUrl)
return
log.Debug("accid:", accid)
exist, err := dborm.XormIsExistUser(accid)
if err != nil {
services.ResponseInternalServerError500ProcessError(w, err)
return
}
token := oauth.GenRandToken() // Generate new token to session ID
affected, err := dborm.XormInsertSession(accid, r.RemoteAddr, token,
config.GetExpiresFromConfig(), config.GetYamlConfig().Auth.Session)
if err != nil {
log.Error("Failed to XormInsertSession:", err)
if affected == -1 {
services.ResponseForbidden403MultiLoginNotAllowed(w)
} else {
services.ResponseBadRequest400IncorrectLogin(w)
}
return
}
if exist == true {
redirectUrl := fmt.Sprintf("http://%s:8888/home.html?user=%s&token=%s", omcIp, accid, token)
services.ResponseRedirect(w, redirectUrl, accid, token)
return
} else {
services.ResponseBadRequest400IncorrectLogin(w)
return
}
default:
services.ResponseNotFound404UriNotExist(w, r)
services.ResponseForbidden403NotPermission(w)
return
}
}

View File

@@ -12,8 +12,11 @@ import (
var (
// License
LicenseUri = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/license"
NeLicenseUri = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/license/{neId}"
LicenseUri = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/{neType}/license"
NeLicenseUri = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/{neType}/license/{neId}"
CustomLicenseUri = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/license"
CustomNeLicenseUri = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/license/{neId}"
)
func UploadLicenseFile(w http.ResponseWriter, r *http.Request) {

View File

@@ -20,13 +20,18 @@ import (
)
var (
UriParamOmcNeConfig = config.UriPrefix + "/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig"
UriParamOmcNeConfig = config.DefaultUriPrefix + "/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig"
// NE CM export/import
NeCmUri = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/cm"
NeCmUri = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/cm"
// NE info
UriNeInfo = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/neInfo"
UriNeInfo = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/neInfo"
// NE backup file
UriNeCmFile = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/neBackup/{fileName}"
UriNeCmFile = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/{neType}/neBackup/{fileName}"
CustomUriParamOmcNeConfig = config.UriPrefix + "/systemManagement/v1/elementType/%s/objectType/config/omcNeConfig"
CustomNeCmUri = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/cm"
CustomUriNeInfo = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/neInfo"
CustomUriNeCmFile = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/neBackup/{fileName}"
)
func init() {

View File

@@ -18,8 +18,11 @@ import (
var (
// parameter config management
ParamConfigUri = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/config/{paraName}"
ParamConfigUrl = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/config/{paraName}"
ParamConfigUri = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/config/{paraName}"
ParamConfigUrl = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/config/{paraName}"
CustomParamConfigUri = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/config/{paraName}"
CustomParamConfigUrl = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/config/{paraName}"
)
func GetParamConfigFromNF(w http.ResponseWriter, r *http.Request) {

View File

@@ -25,8 +25,11 @@ const (
)
var (
UriSoftware = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/software/{version}"
UriSoftwareNE = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/software/{version}/{neId}"
UriSoftware = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/{neType}/software/{version}"
UriSoftwareNE = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/{neType}/software/{version}/{neId}"
CustomUriSoftware = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/software/{version}"
CustomUriSoftwareNE = config.UriPrefix + "/systemManagement/{apiVersion}/{neType}/software/{version}/{neId}"
)
func UploadSoftwareFile(w http.ResponseWriter, r *http.Request) {

View File

@@ -29,15 +29,25 @@ type XormInsertResponse struct {
var (
// database management rest pattern discard
XormGetDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/elementType/{databaseName}/objectType/{tableName}"
XormSelectDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/select/{databaseName}/{tableName}"
XormInsertDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/insert/{databaseName}/{tableName}"
XormUpdateDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/update/{databaseName}/{tableName}"
XormDeleteDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/delete/{databaseName}/{tableName}"
XormGetDataUri = config.DefaultUriPrefix + "/databaseManagement/{apiVersion}/elementType/{databaseName}/objectType/{tableName}"
XormSelectDataUri = config.DefaultUriPrefix + "/databaseManagement/{apiVersion}/select/{databaseName}/{tableName}"
XormInsertDataUri = config.DefaultUriPrefix + "/databaseManagement/{apiVersion}/insert/{databaseName}/{tableName}"
XormUpdateDataUri = config.DefaultUriPrefix + "/databaseManagement/{apiVersion}/update/{databaseName}/{tableName}"
XormDeleteDataUri = config.DefaultUriPrefix + "/databaseManagement/{apiVersion}/delete/{databaseName}/{tableName}"
XormCommonUri = config.UriPrefix + "/databaseManagement/{apiVersion}/{databaseName}/{tableName}" // for internal
XormExtDataUri = config.UriPrefix + "/dataManagement/{apiVersion}/{dataStorage}/{dataObject}" // for external
XormDataSQLUri = config.UriPrefix + "/dataManagement/{apiVersion}/{dataStorage}/{dataObject}" // for external
CustomXormGetDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/elementType/{databaseName}/objectType/{tableName}"
CustomXormSelectDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/select/{databaseName}/{tableName}"
CustomXormInsertDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/insert/{databaseName}/{tableName}"
CustomXormUpdateDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/update/{databaseName}/{tableName}"
CustomXormDeleteDataUri = config.UriPrefix + "/databaseManagement/{apiVersion}/delete/{databaseName}/{tableName}"
XormCommonUri = config.DefaultUriPrefix + "/databaseManagement/{apiVersion}/{databaseName}/{tableName}" // for internal
XormExtDataUri = config.DefaultUriPrefix + "/dataManagement/{apiVersion}/{dataStorage}/{dataObject}" // for external
XormDataSQLUri = config.DefaultUriPrefix + "/dataManagement/{apiVersion}/{dataStorage}/{dataObject}" // for external
CustomXormCommonUri = config.UriPrefix + "/databaseManagement/{apiVersion}/{databaseName}/{tableName}" // for internal
CustomXormExtDataUri = config.UriPrefix + "/dataManagement/{apiVersion}/{dataStorage}/{dataObject}" // for external
CustomXormDataSQLUri = config.UriPrefix + "/dataManagement/{apiVersion}/{dataStorage}/{dataObject}" // for external
)
var xormResponse XormResponse
@@ -259,7 +269,8 @@ func ExtDatabaseGetData(w http.ResponseWriter, r *http.Request) {
tbname := vars["dataObject"]
log.Debugf("token:%s, method:%s, dbname:%s, tbname:%s", token, r.Method, dbname, tbname)
exist, err := dborm.IsPermissionDeny(token, strings.ToLower(r.Method), dbname, tbname)
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), dbname, tbname)
if err != nil {
log.Error("Failed to get permission:", err)
services.ResponseForbidden403NotPermission(w)
@@ -346,14 +357,14 @@ func ExtDatabaseInsertData(w http.ResponseWriter, r *http.Request) {
tbname := vars["dataObject"]
log.Debugf("token:%s, method:%s, dbname:%s, tbname:%s", token, r.Method, dbname, tbname)
exist, err := dborm.IsPermissionDeny(token, strings.ToLower(r.Method), dbname, tbname)
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), dbname, tbname)
if err != nil {
log.Error("Failed to get permission:", err)
services.ResponseForbidden403NotPermission(w)
return
}
if !exist {
log.Error("Not permission!")
log.Error("permission deny!")
services.ResponseForbidden403NotPermission(w)
return
}
@@ -400,7 +411,7 @@ func ExtDatabaseUpdateData(w http.ResponseWriter, r *http.Request) {
tbname := vars["dataObject"]
log.Debugf("token:%s, method:%s, dbname:%s, tbname:%s", token, r.Method, dbname, tbname)
exist, err := dborm.IsPermissionDeny(token, strings.ToLower(r.Method), dbname, tbname)
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), dbname, tbname)
if err != nil {
log.Error("Failed to get permission:", err)
services.ResponseForbidden403NotPermission(w)
@@ -461,7 +472,7 @@ func ExtDatabaseDeleteData(w http.ResponseWriter, r *http.Request) {
tbname := vars["dataObject"]
log.Debugf("token:%s, method:%s, dbname:%s, tbname:%s", token, r.Method, dbname, tbname)
exist, err := dborm.IsPermissionDeny(token, strings.ToLower(r.Method), dbname, tbname)
exist, err := services.CheckUserPermission(token, strings.ToLower(r.Method), dbname, tbname)
if err != nil {
log.Error("Failed to get permission:", err)
services.ResponseForbidden403NotPermission(w)

View File

@@ -11,7 +11,9 @@ import (
var (
// parameter config management
UriFile = config.UriPrefix + "/fileManagement/{apiVersion}/{location}/file"
UriFile = config.DefaultUriPrefix + "/fileManagement/{apiVersion}/{location}/file"
CustomUriFile = config.UriPrefix + "/fileManagement/{apiVersion}/{location}/file"
)
// func init() {

View File

@@ -106,8 +106,11 @@ type AlarmLog struct {
var (
// alarm management
UriAlarms = config.UriPrefix + "/faultManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/alarms"
UriAlarmsFmt = config.UriPrefix + "/faultManagement/v1/elementType/%s/objectType/alarms"
UriAlarms = config.DefaultUriPrefix + "/faultManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/alarms"
UriAlarmsFmt = config.DefaultUriPrefix + "/faultManagement/v1/elementType/%s/objectType/alarms"
CustomUriAlarms = config.UriPrefix + "/faultManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/alarms"
CustomUriAlarmsFmt = config.UriPrefix + "/faultManagement/v1/elementType/%s/objectType/alarms"
)
var xEngine *xorm.Engine
@@ -391,6 +394,12 @@ func PostAlarmFromNF(w http.ResponseWriter, r *http.Request) {
alarmData.ObjectUid = alarmData.NeId
alarmData.ObjectType = "VNFM"
alarmData.EventTime = eventTime
if alarmData.LocationInfo == "" {
alarmData.LocationInfo = fmt.Sprintf("Host:%s", r.RemoteAddr)
}
if alarmData.AddInfo == "" {
alarmData.LocationInfo = fmt.Sprintf("subNeInfo:%s", alarmData.NeType)
}
if IsNeedToAckAlarm(valueJson, &alarmData) == true {
SetAlarmAckInfo(valueJson, &alarmData)
}

View File

@@ -36,10 +36,15 @@ type MMLRequest struct {
var (
// MML interface
UriMML = config.UriPrefix + "/opeartionManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/mml"
UriNeOmMml = config.UriPrefix + "/omManagement/{apiVersion}/mml/{netype}/{neid}"
UriOmMmlExt = config.UriPrefix + "/opeartionManagement/{apiVersion}/elementType/OMC/objectType/mml"
UriOmMmlInt = config.UriPrefix + "/omManagement/{apiVersion}/mml/{neType}/{neId}"
UriMML = config.DefaultUriPrefix + "/opeartionManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/mml"
UriNeOmMml = config.DefaultUriPrefix + "/omManagement/{apiVersion}/mml/{netype}/{neid}"
UriOmMmlExt = config.DefaultUriPrefix + "/opeartionManagement/{apiVersion}/elementType/OMC/objectType/mml"
UriOmMmlInt = config.DefaultUriPrefix + "/omManagement/{apiVersion}/mml/{neType}/{neId}"
CustomUriMML = config.UriPrefix + "/opeartionManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/mml"
CustomUriNeOmMml = config.UriPrefix + "/omManagement/{apiVersion}/mml/{netype}/{neid}"
CustomUriOmMmlExt = config.UriPrefix + "/opeartionManagement/{apiVersion}/elementType/OMC/objectType/mml"
CustomUriOmMmlInt = config.UriPrefix + "/omManagement/{apiVersion}/mml/{neType}/{neId}"
)
func PostMMLToNF(w http.ResponseWriter, r *http.Request) {

View File

@@ -48,8 +48,10 @@ var (
var (
// Northbound interface
GetNRMUri = config.UriPrefix + "/resourceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/{objectTypeValue}"
NorthboundGetAlarmUri = config.UriPrefix + "/faultManagement/{apiVersion}/alarms" // ?alarmIds={alarmIdValues}
GetNRMUri = config.DefaultUriPrefix + "/resourceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/{objectTypeValue}"
NorthboundGetAlarmUri = config.DefaultUriPrefix + "/faultManagement/{apiVersion}/alarms" // ?alarmIds={alarmIdValues}
CustomGetNRMUri = config.UriPrefix + "/resourceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/{objectTypeValue}"
)
func CheckParameterName(r *http.Request) []string {

View File

@@ -62,15 +62,20 @@ type GoldKpi struct {
var (
// performance management
PostPerformanceUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/kpiReport/{index}"
PerformanceUri = config.DefaultUriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/kpiReport/{index}"
MeasureTaskUri = config.DefaultUriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measureTask"
MeasureReportUri = config.DefaultUriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measureReport"
MeasureReportFmt = config.DefaultUriPrefix + "/performanceManagement/v1/elementType/%s/objectType/measureReport"
MeasurementUri = config.DefaultUriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measurement/{index}"
UriMeasureTask = config.DefaultUriPrefix + "/performanceManagement/{apiVersion}/measureTask/{netype}"
// performance management
PostPerformancePattern = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/kpiReport/{index}"
MeasureTaskUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measureTask"
MeasureReportUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measureReport"
MeasureReportFmt = config.UriPrefix + "/performanceManagement/v1/elementType/%s/objectType/measureReport"
MeasurementUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measurement/{index}"
UriMeasureTask = config.UriPrefix + "/performanceManagement/{apiVersion}/measureTask/{netype}"
CustomPerformanceUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/kpiReport/{index}"
CustomMeasureTaskUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measureTask"
CustomMeasureReportUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measureReport"
CustomMeasureReportFmt = config.UriPrefix + "/performanceManagement/v1/elementType/%s/objectType/measureReport"
CustomMeasurementUri = config.UriPrefix + "/performanceManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/measurement/{index}"
CustomUriMeasureTask = config.UriPrefix + "/performanceManagement/{apiVersion}/measureTask/{netype}"
)
var xEngine *xorm.Engine

View File

@@ -14,8 +14,11 @@ import (
)
var (
UriOauthToken = config.UriPrefix + "/securityManagement/{apiVersion}/oauth/token"
UriOauthHandshake = config.UriPrefix + "/securityManagement/{apiVersion}/oauth/handshake"
UriOauthToken = config.DefaultUriPrefix + "/securityManagement/{apiVersion}/oauth/token"
UriOauthHandshake = config.DefaultUriPrefix + "/securityManagement/{apiVersion}/oauth/handshake"
CustomUriOauthToken = config.UriPrefix + "/securityManagement/{apiVersion}/oauth/token"
CustomUriOauthHandshake = config.UriPrefix + "/securityManagement/{apiVersion}/oauth/handshake"
)
func LoginFromOMC(w http.ResponseWriter, r *http.Request) {
@@ -105,36 +108,42 @@ func LoginFromOMC(w http.ResponseWriter, r *http.Request) {
func LogoutFromOMC(w http.ResponseWriter, r *http.Request) {
log.Info("LogoutFromOMC processing... ")
// check media type(content type) only support "application/json"
if services.IsVallidContentType(r, !config.GetYamlConfig().OMC.CheckContentType) {
log.Error("Invalid Content-Type")
services.ResponseUnsupportedMediaType415(w)
token, err := services.CheckFrontValidRequest(w, r)
if err != nil {
log.Error("Request error:", err)
return
}
// // check media type(content type) only support "application/json"
// if services.IsVallidContentType(r, config.GetYamlConfig().OMC.CheckContentType) == false {
// log.Error("Invalid Content-Type")
// services.ResponseUnsupportedMediaType415(w)
// return
// }
// check extend uri, response 404
if !services.IsValidOAuthUri(r) {
log.Error("Uri is invalid")
services.ResponseNotFound404UriNotExist(w, r)
return
}
// // check extend uri, response 404
// if !services.IsValidOAuthUri(r) {
// log.Error("Uri is invalid")
// services.ResponseNotFound404UriNotExist(w, r)
// return
// }
// error processing ...
// 401-1 response
token, ret := oauth.IsCarriedToken(r)
if !ret {
log.Error("AccessToken is not carried")
services.ResponseUnauthorized401AccessTokenNotCarried(w)
return
}
// // error processing ...
// // 401-1 response
// token, ret := oauth.IsCarriedToken(r)
// if ret == false {
// log.Error("AccessToken is not carried")
// services.ResponseUnauthorized401AccessTokenNotCarried(w)
// return
// }
_, err := dborm.XormLogoutUpdateSession(token)
_, err = dborm.XormLogoutUpdateSession(token)
if err != nil {
log.Error("Uri is invalid")
services.ResponseNotFound404UriNotExist(w, r)
return
}
services.ResponseStatusOK200Null(w)
return
}
func HandshakeFromOMC(w http.ResponseWriter, r *http.Request) {
@@ -157,7 +166,7 @@ func HandshakeFromOMC(w http.ResponseWriter, r *http.Request) {
// error processing ...
// 401-1 response
token, ret := oauth.IsCarriedToken(r)
if !ret {
if ret == false {
log.Error("AccessToken is not carried")
services.ResponseUnauthorized401AccessTokenNotCarried(w)
return
@@ -170,4 +179,5 @@ func HandshakeFromOMC(w http.ResponseWriter, r *http.Request) {
return
}
services.ResponseStatusOK200Null(w)
return
}

View File

@@ -125,12 +125,19 @@ type Response struct {
}
var (
UriSysState = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/systemState"
UriSysState2 = config.UriPrefix + "/systemManagement/{apiVersion}/systemState/{elementTypeValue}"
UriSysInfoAll = config.UriPrefix + "/systemManagement/{apiVersion}/sysInfo"
UriSysInfoOne = config.UriPrefix + "/systemManagement/{apiVersion}/sysInfo/{neType}/{neId}"
UriLicenseInfoAll = config.UriPrefix + "/systemManagement/{apiVersion}/licenseInfo"
UriLicenseInfoOne = config.UriPrefix + "/systemManagement/{apiVersion}/licenseInfo/{neType}/{neId}"
UriSysState = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/systemState"
UriSysState2 = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/{elementTypeValue}/systemState"
UriSysInfoAll = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/sysInfo"
UriSysInfoOne = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/sysInfo/{neType}/{neId}"
UriLicenseInfoAll = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/licenseInfo"
UriLicenseInfoOne = config.DefaultUriPrefix + "/systemManagement/{apiVersion}/licenseInfo/{neType}/{neId}"
CustomUriSysState = config.UriPrefix + "/systemManagement/{apiVersion}/elementType/{elementTypeValue}/objectType/systemState"
CustomUriSysState2 = config.UriPrefix + "/systemManagement/{apiVersion}/{elementTypeValue}/systemState"
CustomUriSysInfoAll = config.UriPrefix + "/systemManagement/{apiVersion}/sysInfo"
CustomUriSysInfoOne = config.UriPrefix + "/systemManagement/{apiVersion}/sysInfo/{neType}/{neId}"
CustomUriLicenseInfoAll = config.UriPrefix + "/systemManagement/{apiVersion}/licenseInfo"
CustomUriLicenseInfoOne = config.UriPrefix + "/systemManagement/{apiVersion}/licenseInfo/{neType}/{neId}"
)
var client = resty.New()

View File

@@ -17,8 +17,11 @@ import (
)
var (
UriTraceTaskV1 = config.UriPrefix + "/traceManagement/v1/subscriptions"
UriTraceTask = config.UriPrefix + "/traceManagement/{apiVersion}/subscriptions"
UriTraceTaskV1 = config.DefaultUriPrefix + "/traceManagement/v1/subscriptions"
UriTraceTask = config.DefaultUriPrefix + "/traceManagement/{apiVersion}/subscriptions"
CustomUriTraceTaskV1 = config.UriPrefix + "/traceManagement/v1/subscriptions"
CustomUriTraceTask = config.UriPrefix + "/traceManagement/{apiVersion}/subscriptions"
)
type TraceTask struct {