Merge "Update APIs" into go1.16
diff --git a/api/xapp_rest_api.yaml b/api/xapp_rest_api.yaml
old mode 100755
new mode 100644
index 6f7211e..2890b90
--- a/api/xapp_rest_api.yaml
+++ b/api/xapp_rest_api.yaml
@@ -1,7 +1,7 @@
-swagger: "2.0"
+swagger: '2.0'
info:
description: This is the initial REST API for RIC subscription
- version: 0.0.1
+ version: 0.0.2
title: RIC subscription
license:
name: Apache 2.0
@@ -31,7 +31,7 @@
get:
summary: Returns list of subscriptions
tags:
- - "query"
+ - common
operationId: getAllSubscriptions
produces:
- application/json
@@ -42,22 +42,21 @@
$ref: '#/definitions/SubscriptionList'
'500':
description: Internal error
- /subscriptions/report:
post:
tags:
- - "report"
- summary: Subscribe a list of X2AP event triggers to receive "REPORT" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN
- operationId: subscribeReport
+ - common
+ operationId: Subscribe
+ summary: Subscribe a list of X2AP event triggers to receive messages sent by RAN
consumes:
- application/json
produces:
- application/json
parameters:
- - name: ReportParams
+ - name: SubscriptionParams
in: body
- description: Subscription report parameters
+ description: Subscription parameters
schema:
- $ref: '#/definitions/ReportParams'
+ $ref: '#/definitions/SubscriptionParams'
responses:
'201':
description: Subscription successfully created
@@ -67,35 +66,10 @@
description: Invalid input
'500':
description: Internal error
- /subscriptions/policy:
- post:
- tags:
- - "policy"
- summary: Subscribe and send "POLICY" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION
- operationId: subscribePolicy
- consumes:
- - application/json
- produces:
- - application/json
- parameters:
- - name: PolicyParams
- in: body
- description: Subscription policy parameters
- schema:
- $ref: '#/definitions/PolicyParams'
- responses:
- '201':
- description: Subscription successfully created
- schema:
- $ref: '#/definitions/SubscriptionResponse'
- '400':
- description: Invalid input
- '500':
- description: Internal error
- /subscriptions/{subscriptionId}:
+ '/subscriptions/{subscriptionId}':
delete:
tags:
- - "common"
+ - common
summary: Unsubscribe X2AP events from Subscription Manager
operationId: Unsubscribe
consumes:
@@ -129,9 +103,9 @@
type: string
description: The type of the content
enum:
- - json
- - xml
- - other
+ - json
+ - xml
+ - other
XAppConfig:
type: object
required:
@@ -147,162 +121,130 @@
type: array
items:
$ref: '#/definitions/XAppConfig'
- SubscriptionType:
- type: string
- enum:
- - insert
- - policy
- - report
- ReportParams:
+ ActionDefinition:
+ type: array
+ description: E2SM byte array. ActionDefinition is an OPTIONAL IE
+ items:
+ type: integer
+ SubsequentAction:
+ description: SubsequentAction is an OPTIONAL IE
type: object
required:
- - RANFunctionID
- - ClientEndpoint
- - EventTriggers
+ - SubsequentActionType
+ - TimeToWait
properties:
- Meid:
- type: string
- RANFunctionID:
- type: integer
- ClientEndpoint:
- type: string
- EventTriggers:
- $ref: '#/definitions/EventTriggerList'
- ReportActionDefinitions:
- $ref: '#/definitions/ReportActionDefinition'
- EventTrigger:
- type: object
- properties:
- InterfaceDirection:
- type: integer
- ProcedureCode:
- type: integer
- TypeOfMessage:
- type: integer
- TriggerNature:
+ SubsequentActionType:
type: string
enum:
- - now
- - on change
- PlmnId:
+ - continue
+ - wait
+ TimeToWait:
type: string
- ENBId:
+ enum:
+ - zero
+ - w1ms
+ - w2ms
+ - w5ms
+ - w10ms
+ - w20ms
+ - w30ms
+ - w40ms
+ - w50ms
+ - w100ms
+ - w200ms
+ - w500ms
+ - w1s
+ - w2s
+ - w5s
+ - w10s
+ - w20s
+ - w60s
+ ActionToBeSetup:
+ type: object
+ required:
+ - ActionID
+ - ActionType
+ properties:
+ ActionID:
+ type: integer
+ minimum: 0
+ maximum: 255
+ ActionType:
type: string
- EventTriggerList:
+ enum:
+ - insert
+ - policy
+ - report
+ ActionDefinition:
+ $ref: '#/definitions/ActionDefinition'
+ SubsequentAction:
+ $ref: '#/definitions/SubsequentAction'
+ ActionsToBeSetup:
type: array
items:
- $ref: '#/definitions/EventTrigger'
- ActionParameters:
+ $ref: '#/definitions/ActionToBeSetup'
+ EventTriggerDefinition:
+ type: array
+ description: E2SM byte array
+ items:
+ type: integer
+ SubscriptionDetail:
type: object
required:
- - ActionParameterID
- - ActionParameterValue
+ - XappEventInstanceId
+ - EventTriggers
+ - ActionToBeSetupList
properties:
- ActionParameterID:
+ XappEventInstanceId:
type: integer
- ActionParameterValue:
- type: boolean
- Format1ActionDefinition:
+ minimum: 0
+ maximum: 65535
+ EventTriggers:
+ $ref: '#/definitions/EventTriggerDefinition'
+ ActionToBeSetupList:
+ $ref: '#/definitions/ActionsToBeSetup'
+ SubscriptionDetailsList:
+ type: array
+ items:
+ $ref: '#/definitions/SubscriptionDetail'
+ SubscriptionParams:
type: object
required:
- - StyleID
- - ActionParameters
- properties:
- StyleID:
- type: integer
- ActionParameters:
- type: array
- items:
- $ref: '#/definitions/ActionParameters'
- ReportActionDefinition:
- type: object
- properties:
- ActionDefinitionFormat1:
- $ref: '#/definitions/Format1ActionDefinition'
- PolicyParams:
- type: object
- required:
+ - ClientEndpoint
- Meid
- RANFunctionID
- - ClientEndpoint
- - EventTriggers
- - PolicyActionDefinitions
+ - SubscriptionDetails
properties:
+ SubscriptionId:
+ type: string
+ description: Optional subscription ID (Submgr allocates if not given)
+ ClientEndpoint:
+ type: object
+ description: xApp service address and port
+ properties:
+ Host:
+ description: >-
+ xApp service address name like
+ 'service-ricxapp-xappname-http.ricxapp'
+ type: string
+ HTTPPort:
+ description: xApp HTTP service address port
+ type: integer
+ minimum: 0
+ maximum: 65535
+ RMRPort:
+ description: xApp RMR service address port
+ type: integer
+ minimum: 0
+ maximum: 65535
Meid:
type: string
RANFunctionID:
type: integer
- ClientEndpoint:
- type: string
- EventTriggers:
- $ref: '#/definitions/EventTriggerList'
- PolicyActionDefinitions:
- $ref: '#/definitions/PolicyActionDefinition'
- PolicyActionDefinition:
- type: object
- properties:
- ActionDefinitionFormat2:
- $ref: '#/definitions/Format2ActionDefinition'
- Format2ActionDefinition:
- type: object
- required:
- - RANUeGroupParameters
- properties:
- RANUeGroupParameters:
- type: array
- items:
- $ref: '#/definitions/RANUeGroupList'
- RANUeGroupList:
- type: object
- required:
- - RANUeGroupID
- - RANUeGroupDefinition
- - RANImperativePolicy
- properties:
- RANUeGroupID:
- type: integer
- RANUeGroupDefinition:
- $ref: '#/definitions/RANUeGroupParams'
- RANImperativePolicy:
- $ref: '#/definitions/ImperativePolicyDefinition'
- RANUeGroupParams:
- type: object
- required:
- - RANParameterID
- - RANParameterValue
- properties:
- RANParameterID:
- type: integer
- RANParameterTestCondition:
- type: string
- enum:
- - equal
- - greaterthan
- - lessthan
- - contains
- - present
- RANParameterValue:
- type: integer
- ImperativePolicyDefinition:
- type: object
- required:
- - PolicyParameterID
- - PolicyParameterValue
- properties:
- PolicyParameterID:
- type: integer
- PolicyParameterValue:
- type: integer
- SubscriptionInstance:
- type: object
- required:
- - RequestorId
- - InstanceId
- properties:
- RequestorId:
- type: integer
- InstanceId:
- type: integer
+ minimum: 0
+ maximum: 4095
+ SubscriptionDetails:
+ $ref: '#/definitions/SubscriptionDetailsList'
SubscriptionResponse:
type: object
required:
@@ -315,6 +257,24 @@
type: array
items:
$ref: '#/definitions/SubscriptionInstance'
+ SubscriptionInstance:
+ type: object
+ required:
+ - XappEventInstanceId
+ - E2EventInstanceId
+ - ErrorCause
+ properties:
+ XappEventInstanceId:
+ type: integer
+ minimum: 0
+ maximum: 65535
+ E2EventInstanceId:
+ type: integer
+ minimum: 0
+ maximum: 65535
+ ErrorCause:
+ description: Empty string when no error.
+ type: string
SubscriptionData:
type: object
properties:
@@ -322,12 +282,16 @@
type: integer
Meid:
type: string
- Endpoint:
+ ClientEndpoint:
type: array
items:
type: string
+ SubscriptionInstances:
+ type: array
+ items:
+ $ref: '#/definitions/SubscriptionInstance'
SubscriptionList:
type: array
description: A list of subscriptions
items:
- $ref: '#/definitions/SubscriptionData'
\ No newline at end of file
+ $ref: '#/definitions/SubscriptionData'
diff --git a/config/config-file.json b/config/config-file.json
index e644caf..70fd3ae 100755
--- a/config/config-file.json
+++ b/config/config-file.json
@@ -63,16 +63,14 @@
},
"controls": {
"logger": {
- "level": 3
+ "level": 3,
+ "noFormat": true
},
"subscription": {
- "subscriptionActive": true,
- "functionId": 1,
- "plmnId": "310150",
- "eNBId": "202251",
- "timeout": 5,
- "host": "service-ricplt-submgr-http.ricplt:8088",
- "clientEndpoint": "service-ricxapp-ueec-http.ricxapp:8080"
+ "host": "localhost:8088",
+ "timeout": 2,
+ "retryCount": 10,
+ "retryDelay": 5
},
"waitForSdl": false
},
@@ -80,12 +78,6 @@
"url": "/ric/v1/metrics",
"namespace": "ricxapp"
},
- "subscription": {
- "host": "localhost:8088",
- "timeout": 2,
- "retryCount": 10,
- "retryDelay": 5
- },
"faults": {},
"measurements": []
}
diff --git a/examples/go.mod b/examples/go.mod
old mode 100755
new mode 100644
index 570e3ec..acf0c70
--- a/examples/go.mod
+++ b/examples/go.mod
@@ -2,10 +2,13 @@
module gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/example-xapp
-require gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.7.1
+require (
+ gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0
+ gerrit.o-ran-sc.org/r/ric-plt/xapp-frame v0.7.1
+)
replace gerrit.o-ran-sc.org/r/ric-plt/xapp-frame => gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.7.1
-replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.0
+replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.7.0
replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.2
diff --git a/examples/go.sum b/examples/go.sum
index 7a9fc76..183ccb6 100644
--- a/examples/go.sum
+++ b/examples/go.sum
@@ -1,36 +1,16 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-gerrit.o-ran-sc.org/r/com/golog.git v0.0.1 h1:9RfO/Whehaaq5KiJTT7s+YOzmi9mT1C3HktfhwwMEmw=
-gerrit.o-ran-sc.org/r/com/golog.git v0.0.1/go.mod h1:b8YB31U8/4iRpABioeSzGi/YMzOQ/Zq7hrJmmXKqlJk=
gerrit.o-ran-sc.org/r/com/golog.git v0.0.2 h1:Ix6SgFuzd6yW6Ur6+qDlGhDO65UYs8PiIkeAL1VaQ2o=
gerrit.o-ran-sc.org/r/com/golog.git v0.0.2/go.mod h1:A7hUL52YQSO4dFIZNcj76XQ09C9PftAe3LyL7kqBnok=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.0 h1:Uvyfuq2jyb1aosy2BEzH1g3pe2gy4sMgpsXlvjVeBzI=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2 h1:XNfkp3PwZ7pfkPszX7NaX6DzToCGjcWTLbIHYqCFNu0=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0 h1:OKDsIDlttbaoHwleyjflIWVZPgPvYbDhim6gWF0zf5E=
gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21 h1:eK9nUZOTMJ/EnMpH9bkWtMgOvCn3u4+PNCb9gu10s6w=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.21/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35 h1:TGXHb4DNY8on+ej4S9VUnk2HibIC/5chDy64OE+bQBQ=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35/go.mod h1:QJ1uPPZosGbhxUWpUpeM5fLqFHdnWTrVnvW2DgyOCes=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21 h1:PQ/Mu2ol+8Oh/0BqCWWhPlVVoRCg5dQDEGm4+Opp5w4=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.21/go.mod h1:GXiXLz4ORBeIr0FLIbzENRykgh3Po5uPkX2jICxnRF0=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35 h1:tkM3yE8UzmuH4nf9TqAmiNBSuIZ2CtcMRH2eBIYIzpQ=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21 h1:N3UbqJ9WqC8JEz/TwHHwZwCFAW6VTlZLpD5lnbdD+Y8=
-gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.21/go.mod h1:SQBZLy1HP94i1vQ3y730wGFsrHqZtgPaEkzPgtqBNw0=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35 h1:LcxnUUDwsCzYEISKmkjkyYfg/lnLt8ofkPiGK69vNIA=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35/go.mod h1:2bSaXTpECbZieB8bMnubTqMwF3n+mMBxlTaAXvcduNg=
-gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.0 h1:+P3XuWKSaMbzh5PNtrW9gkZlCN0hKrZq+Cn8JetwBys=
-gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.0/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.0.26 h1:zFsExCZVAX9vTcLEHNsYgxnKDsGREKoVaz/jwRfTTOI=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.0.26/go.mod h1:lW3UYpVXwPiOR39t6JgNCE4kdmMSdPVelMPC/Pp9fQM=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.1 h1:ydw6WM3PNOKI0LAEyCKWCJ4LncHMfyHdpvCAHBYwrdE=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.1/go.mod h1:29CdUcCrNEqVBjQWAlgeGrYxSWqSZ4e67xzhuSf6BkI=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.6 h1:Yhizs1A+0n0TLFxeGZO1YYQy8eBX9UEj4e4PgmK008k=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.4.6/go.mod h1:29CdUcCrNEqVBjQWAlgeGrYxSWqSZ4e67xzhuSf6BkI=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.1 h1:w//eBu78PZNfTgiPD8encOMTfYQUkniNTCoVtQqgE/A=
-gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.6.1/go.mod h1:bjhhEII07w+zPQzyvqTq84TjKQPa6IkcnSyWB1DfGHo=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.7.0 h1:mxlBo54jxwHHFmGYzFI+fBIkOGwarQP4dx2KBxQ8ln8=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.7.0/go.mod h1:KCHu4JkWnw2Ro6P747wU9S2t7zxFLmBNCiYvGZo3CHo=
gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.7.1 h1:gQOQip8Z3kixjL6SOLaJpzNGkm0J6WqO5EIHK+GjGnk=
gerrit.o-ran-sc.org/r/ric-plt/xapp-frame.git v0.7.1/go.mod h1:MRTeTBLROgTA2t91SXYjTbRsxoOhMMvvkK/ChLVRZUU=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
@@ -69,6 +49,8 @@
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
@@ -128,8 +110,8 @@
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
github.com/go-openapi/validate v0.19.6 h1:WsKw9J1WzYBVxWRYwLqEk3325RL6G0SSWksuamkk6q0=
github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
-github.com/go-redis/redis v6.15.3+incompatible h1:NZ0O90AhLSvSrvLZ/S9h7D4kl1mW2PrKyxL7MyBKO2g=
-github.com/go-redis/redis v6.15.3+incompatible/go.mod h1:W2YCLaZryXHirdd9QqwkiVUxCQsrx8SbLq9Uqk7JS7A=
+github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
+github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -139,14 +121,22 @@
github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
-github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs=
-github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -187,12 +177,16 @@
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w=
-github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
-github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
+github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@@ -275,6 +269,8 @@
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -285,12 +281,17 @@
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -302,10 +303,19 @@
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
@@ -320,6 +330,8 @@
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
diff --git a/go.mod b/go.mod
index 20ae62a..a5b90af 100644
--- a/go.mod
+++ b/go.mod
@@ -8,8 +8,8 @@
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35
- gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.5.0
- github.com/fsnotify/fsnotify v1.4.7
+ gerrit.o-ran-sc.org/r/ric-plt/sdlgo v0.7.0
+ github.com/fsnotify/fsnotify v1.4.9
github.com/go-openapi/errors v0.19.3
github.com/go-openapi/loads v0.19.4
github.com/go-openapi/runtime v0.19.4
@@ -17,17 +17,17 @@
github.com/go-openapi/strfmt v0.19.4
github.com/go-openapi/swag v0.19.7
github.com/go-openapi/validate v0.19.6
- github.com/golang/protobuf v1.3.4
+ github.com/golang/protobuf v1.4.2
github.com/gorilla/mux v1.7.1
github.com/jessevdk/go-flags v1.4.0
github.com/prometheus/client_golang v0.9.3
github.com/spf13/viper v1.4.0
github.com/stretchr/testify v1.5.1
- golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297
+ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 // indirect
)
-replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2
+replace gerrit.o-ran-sc.org/r/ric-plt/sdlgo => gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.7.0
replace gerrit.o-ran-sc.org/r/com/golog => gerrit.o-ran-sc.org/r/com/golog.git v0.0.2
diff --git a/go.sum b/go.sum
index 04c9c4e..937605b 100644
--- a/go.sum
+++ b/go.sum
@@ -1,10 +1,6 @@
cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
-gerrit.o-ran-sc.org/r/com/golog.git v0.0.0-20190604083303-aaffc8ebe3f1 h1:WAB8G/FFaUjRkpLuUhIo0EfbeBOY7xjkcFAFkpe3Xns=
-gerrit.o-ran-sc.org/r/com/golog.git v0.0.0-20190604083303-aaffc8ebe3f1/go.mod h1:b8YB31U8/4iRpABioeSzGi/YMzOQ/Zq7hrJmmXKqlJk=
gerrit.o-ran-sc.org/r/com/golog.git v0.0.2 h1:Ix6SgFuzd6yW6Ur6+qDlGhDO65UYs8PiIkeAL1VaQ2o=
gerrit.o-ran-sc.org/r/com/golog.git v0.0.2/go.mod h1:A7hUL52YQSO4dFIZNcj76XQ09C9PftAe3LyL7kqBnok=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2 h1:XNfkp3PwZ7pfkPszX7NaX6DzToCGjcWTLbIHYqCFNu0=
-gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.4.2/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0 h1:OKDsIDlttbaoHwleyjflIWVZPgPvYbDhim6gWF0zf5E=
gerrit.o-ran-sc.org/r/ric-plt/alarm-go.git/alarm v0.5.0/go.mod h1:AdEWKtERGvOQy9ybLhyhrb9w9LLVn8i9xzTwoR5n4BY=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/common v1.0.35 h1:TGXHb4DNY8on+ej4S9VUnk2HibIC/5chDy64OE+bQBQ=
@@ -13,8 +9,8 @@
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/entities v1.0.35/go.mod h1:G+4sUBMbLfQ+RrGS65U15tKmbnP+/1b5oLTPmMfyfT4=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35 h1:LcxnUUDwsCzYEISKmkjkyYfg/lnLt8ofkPiGK69vNIA=
gerrit.o-ran-sc.org/r/ric-plt/nodeb-rnib.git/reader v1.0.35/go.mod h1:2bSaXTpECbZieB8bMnubTqMwF3n+mMBxlTaAXvcduNg=
-gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2 h1:UK7awyRKIkVdokWvvkYvazlg3EWIfMnIqCcJxTnLlDA=
-gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.5.2/go.mod h1:y2WhrCvdLkAKdH+ySdHSOSehACJkTMyZghCGVcqoZzc=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.7.0 h1:mxlBo54jxwHHFmGYzFI+fBIkOGwarQP4dx2KBxQ8ln8=
+gerrit.o-ran-sc.org/r/ric-plt/sdlgo.git v0.7.0/go.mod h1:KCHu4JkWnw2Ro6P747wU9S2t7zxFLmBNCiYvGZo3CHo=
github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU=
@@ -51,6 +47,8 @@
github.com/docker/go-units v0.4.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=
github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
+github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ=
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
github.com/globalsign/mgo v0.0.0-20180905125535-1ca0a4f7cbcb/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
github.com/globalsign/mgo v0.0.0-20181015135952-eeefdecb41b8/go.mod h1:xkRDCp4j0OGD1HRkm4kmhM+pmpv3AKq5SU7GMg4oO/Q=
@@ -110,8 +108,8 @@
github.com/go-openapi/validate v0.19.2/go.mod h1:1tRCw7m3jtI8eNWEEliiAqUIcBztB2KDnRCRMUi7GTA=
github.com/go-openapi/validate v0.19.6 h1:WsKw9J1WzYBVxWRYwLqEk3325RL6G0SSWksuamkk6q0=
github.com/go-openapi/validate v0.19.6/go.mod h1:8DJv2CVJQ6kGNpFW6eV9N3JviE1C85nY1c2z52x1Gk4=
-github.com/go-redis/redis v6.15.3+incompatible h1:NZ0O90AhLSvSrvLZ/S9h7D4kl1mW2PrKyxL7MyBKO2g=
-github.com/go-redis/redis v6.15.3+incompatible/go.mod h1:W2YCLaZryXHirdd9QqwkiVUxCQsrx8SbLq9Uqk7JS7A=
+github.com/go-redis/redis v6.15.9+incompatible h1:K0pv1D7EQUjfyoMql+r/jZqCLizCGKFlFgcHWWmHQjg=
+github.com/go-redis/redis v6.15.9+incompatible/go.mod h1:NAIEuMOZ/fxfXJIrKDQDz8wamY7mA7PouImQ2Jvg6kA=
github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk=
github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
@@ -123,10 +121,20 @@
github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk=
github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw=
+github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8=
+github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA=
+github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs=
+github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w=
+github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0=
+github.com/golang/protobuf v1.4.2 h1:+Z5KGCizgyZCbGh1KZqA0fcLLkwbsjIzS4aV2v7wJX0=
+github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
github.com/google/go-cmp v0.3.0 h1:crn/baboCvb5fXaQ0IJ1SGTsTVrWpDsCWC8EGETZijY=
github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU=
+github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4=
+github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY=
github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
@@ -167,12 +175,16 @@
github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE=
github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/nxadm/tail v1.4.4 h1:DQuhQpB1tVlglWS2hLQ5OV6B5r8aGxSrPc5Qo6uTN78=
+github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A=
github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U=
github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/ginkgo v1.8.0 h1:VkHVNpR4iVnU8XQR6DBm8BqYjN7CRzw+xKUbVVbbW9w=
-github.com/onsi/ginkgo v1.8.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
-github.com/onsi/gomega v1.5.0 h1:izbySO9zDPmjJ8rDjLvkA2zJHIo+HkYXHnf7eN7SSyo=
-github.com/onsi/gomega v1.5.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk=
+github.com/onsi/ginkgo v1.14.0 h1:2mOpI4JVVPBN+WQRa0WKH2eXR+Ey+uK4n7Zj0aYpIQA=
+github.com/onsi/ginkgo v1.14.0/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY=
+github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY=
+github.com/onsi/gomega v1.10.1 h1:o0+MgICZLuZ7xjH7Vx6zS/zcu93/BEp1VwkIW1mEXCE=
+github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo=
github.com/pborman/uuid v1.2.0/go.mod h1:X/NO0urCmaxf9VXbdlT7C2Yzkj2IKimNn4k+gtPdI/k=
github.com/pelletier/go-toml v1.2.0 h1:T5zMGML61Wp+FlcbWjRDT7yAxhJNAiPPLOFECq181zc=
github.com/pelletier/go-toml v1.2.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic=
@@ -254,6 +266,8 @@
golang.org/x/net v0.0.0-20190613194153-d28f0bde5980/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297 h1:k7pJ2yAPLPgbskkFdhRCsA77k2fySZ1zf2zCjvQCiIM=
golang.org/x/net v0.0.0-20190827160401-ba9fcec4b297/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7 h1:AeiKBIuRw3UomYXSbLy0Mc2dDLfdtbT/IVn4keq83P0=
+golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A=
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
@@ -264,12 +278,17 @@
golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
-golang.org/x/sys v0.0.0-20190204203706-41f3e6584952/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190321052220-f7bb7a8bee54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f h1:25KHgbfyiSm6vwQLbM3zZIe1v9p/3ea4Rz+nnM5K/i4=
golang.org/x/sys v0.0.0-20190616124812-15dcb6c0061f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299 h1:DYfZAGf2WMFjMxbgTjaC+2HC7NkNAQs+6Q8b9WEB/F4=
+golang.org/x/sys v0.0.0-20200519105757-fe76b779f299/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs=
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
@@ -281,10 +300,19 @@
golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
golang.org/x/tools v0.0.0-20190614205625-5aca471b1d59/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
golang.org/x/tools v0.0.0-20190617190820-da514acc4774/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4=
+golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
google.golang.org/grpc v1.21.0/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
+google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
+google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
+google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
+google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE=
+google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo=
+google.golang.org/protobuf v1.23.0 h1:4MY060fB1DLGMB/7MBTLnwQUY6+F09GEiz6SsrNqyzM=
+google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU=
gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
@@ -299,6 +327,8 @@
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.4 h1:/eiJrUcujPVeJ3xlSWaiNi3uSVmDGBK1pDHUHAnao1I=
gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU=
+gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
k8s.io/klog/v2 v2.0.0/go.mod h1:PBfzABfn139FHAV07az/IF9Wp1bkk3vpT2XSJ76fSDE=
k8s.io/utils v0.0.0-20201110183641-67b214c5f920 h1:CbnUZsM497iRC5QMVkHwyl8s2tB3g7yaSHkYPkpgelw=
diff --git a/pkg/clientapi/common/common_client.go b/pkg/clientapi/common/common_client.go
index 8db6f11..e3642d4 100644
--- a/pkg/clientapi/common/common_client.go
+++ b/pkg/clientapi/common/common_client.go
@@ -6,13 +6,14 @@
// Editing this file might prove futile when you re-run the swagger generate command
import (
- "github.com/go-openapi/runtime"
+ "fmt"
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
)
// New creates a new common API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
+func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
return &Client{transport: transport, formats: formats}
}
@@ -24,8 +25,53 @@
formats strfmt.Registry
}
+// ClientService is the interface for Client methods
+type ClientService interface {
+ Subscribe(params *SubscribeParams) (*SubscribeCreated, error)
+
+ Unsubscribe(params *UnsubscribeParams) (*UnsubscribeNoContent, error)
+
+ GetAllSubscriptions(params *GetAllSubscriptionsParams) (*GetAllSubscriptionsOK, error)
+
+ SetTransport(transport runtime.ClientTransport)
+}
+
/*
-Unsubscribe unsubscribes x2 a p events from subscription manager
+ Subscribe subscribes a list of x2 a p event triggers to receive messages sent by r a n
+*/
+func (a *Client) Subscribe(params *SubscribeParams) (*SubscribeCreated, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewSubscribeParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "Subscribe",
+ Method: "POST",
+ PathPattern: "/subscriptions",
+ ProducesMediaTypes: []string{"application/json"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"http"},
+ Params: params,
+ Reader: &SubscribeReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, err
+ }
+ success, ok := result.(*SubscribeCreated)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
+ msg := fmt.Sprintf("unexpected success response for Subscribe: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+/*
+ Unsubscribe unsubscribes x2 a p events from subscription manager
*/
func (a *Client) Unsubscribe(params *UnsubscribeParams) (*UnsubscribeNoContent, error) {
// TODO: Validate the params before sending
@@ -48,8 +94,48 @@
if err != nil {
return nil, err
}
- return result.(*UnsubscribeNoContent), nil
+ success, ok := result.(*UnsubscribeNoContent)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
+ msg := fmt.Sprintf("unexpected success response for Unsubscribe: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+/*
+ GetAllSubscriptions returns list of subscriptions
+*/
+func (a *Client) GetAllSubscriptions(params *GetAllSubscriptionsParams) (*GetAllSubscriptionsOK, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewGetAllSubscriptionsParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "getAllSubscriptions",
+ Method: "GET",
+ PathPattern: "/subscriptions",
+ ProducesMediaTypes: []string{"application/json"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"http"},
+ Params: params,
+ Reader: &GetAllSubscriptionsReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, err
+ }
+ success, ok := result.(*GetAllSubscriptionsOK)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
+ msg := fmt.Sprintf("unexpected success response for getAllSubscriptions: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
}
// SetTransport changes the transport on the client
diff --git a/pkg/clientapi/query/get_all_subscriptions_parameters.go b/pkg/clientapi/common/get_all_subscriptions_parameters.go
similarity index 98%
rename from pkg/clientapi/query/get_all_subscriptions_parameters.go
rename to pkg/clientapi/common/get_all_subscriptions_parameters.go
index 94f3b84..9caeeba 100644
--- a/pkg/clientapi/query/get_all_subscriptions_parameters.go
+++ b/pkg/clientapi/common/get_all_subscriptions_parameters.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package query
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@@ -13,8 +13,7 @@
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
-
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/strfmt"
)
// NewGetAllSubscriptionsParams creates a new GetAllSubscriptionsParams object
diff --git a/pkg/clientapi/query/get_all_subscriptions_responses.go b/pkg/clientapi/common/get_all_subscriptions_responses.go
similarity index 92%
rename from pkg/clientapi/query/get_all_subscriptions_responses.go
rename to pkg/clientapi/common/get_all_subscriptions_responses.go
index 801104a..807fc44 100644
--- a/pkg/clientapi/query/get_all_subscriptions_responses.go
+++ b/pkg/clientapi/common/get_all_subscriptions_responses.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package query
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@@ -10,10 +10,9 @@
"io"
"github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
- strfmt "github.com/go-openapi/strfmt"
-
- clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
)
// GetAllSubscriptionsReader is a Reader for the GetAllSubscriptions structure.
@@ -24,14 +23,12 @@
// ReadResponse reads a server response into the received o.
func (o *GetAllSubscriptionsReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
-
case 200:
result := NewGetAllSubscriptionsOK()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
-
case 500:
result := NewGetAllSubscriptionsInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
@@ -61,6 +58,10 @@
return fmt.Sprintf("[GET /subscriptions][%d] getAllSubscriptionsOK %+v", 200, o.Payload)
}
+func (o *GetAllSubscriptionsOK) GetPayload() clientmodel.SubscriptionList {
+ return o.Payload
+}
+
func (o *GetAllSubscriptionsOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
// response payload
diff --git a/pkg/clientapi/common/subscribe_parameters.go b/pkg/clientapi/common/subscribe_parameters.go
new file mode 100644
index 0000000..1447a0f
--- /dev/null
+++ b/pkg/clientapi/common/subscribe_parameters.go
@@ -0,0 +1,138 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package common
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "context"
+ "net/http"
+ "time"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/runtime"
+ cr "github.com/go-openapi/runtime/client"
+ "github.com/go-openapi/strfmt"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
+)
+
+// NewSubscribeParams creates a new SubscribeParams object
+// with the default values initialized.
+func NewSubscribeParams() *SubscribeParams {
+ var ()
+ return &SubscribeParams{
+
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewSubscribeParamsWithTimeout creates a new SubscribeParams object
+// with the default values initialized, and the ability to set a timeout on a request
+func NewSubscribeParamsWithTimeout(timeout time.Duration) *SubscribeParams {
+ var ()
+ return &SubscribeParams{
+
+ timeout: timeout,
+ }
+}
+
+// NewSubscribeParamsWithContext creates a new SubscribeParams object
+// with the default values initialized, and the ability to set a context for a request
+func NewSubscribeParamsWithContext(ctx context.Context) *SubscribeParams {
+ var ()
+ return &SubscribeParams{
+
+ Context: ctx,
+ }
+}
+
+// NewSubscribeParamsWithHTTPClient creates a new SubscribeParams object
+// with the default values initialized, and the ability to set a custom HTTPClient for a request
+func NewSubscribeParamsWithHTTPClient(client *http.Client) *SubscribeParams {
+ var ()
+ return &SubscribeParams{
+ HTTPClient: client,
+ }
+}
+
+/*SubscribeParams contains all the parameters to send to the API endpoint
+for the subscribe operation typically these are written to a http.Request
+*/
+type SubscribeParams struct {
+
+ /*SubscriptionParams
+ Subscription parameters
+
+ */
+ SubscriptionParams *clientmodel.SubscriptionParams
+
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithTimeout adds the timeout to the subscribe params
+func (o *SubscribeParams) WithTimeout(timeout time.Duration) *SubscribeParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the subscribe params
+func (o *SubscribeParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the subscribe params
+func (o *SubscribeParams) WithContext(ctx context.Context) *SubscribeParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the subscribe params
+func (o *SubscribeParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the subscribe params
+func (o *SubscribeParams) WithHTTPClient(client *http.Client) *SubscribeParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the subscribe params
+func (o *SubscribeParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WithSubscriptionParams adds the subscriptionParams to the subscribe params
+func (o *SubscribeParams) WithSubscriptionParams(subscriptionParams *clientmodel.SubscriptionParams) *SubscribeParams {
+ o.SetSubscriptionParams(subscriptionParams)
+ return o
+}
+
+// SetSubscriptionParams adds the subscriptionParams to the subscribe params
+func (o *SubscribeParams) SetSubscriptionParams(subscriptionParams *clientmodel.SubscriptionParams) {
+ o.SubscriptionParams = subscriptionParams
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *SubscribeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
+
+ if err := r.SetTimeout(o.timeout); err != nil {
+ return err
+ }
+ var res []error
+
+ if o.SubscriptionParams != nil {
+ if err := r.SetBodyParam(o.SubscriptionParams); err != nil {
+ return err
+ }
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
diff --git a/pkg/clientapi/common/subscribe_responses.go b/pkg/clientapi/common/subscribe_responses.go
new file mode 100644
index 0000000..db86016
--- /dev/null
+++ b/pkg/clientapi/common/subscribe_responses.go
@@ -0,0 +1,123 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package common
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "fmt"
+ "io"
+
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
+)
+
+// SubscribeReader is a Reader for the Subscribe structure.
+type SubscribeReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *SubscribeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 201:
+ result := NewSubscribeCreated()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 400:
+ result := NewSubscribeBadRequest()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return nil, result
+ case 500:
+ result := NewSubscribeInternalServerError()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return nil, result
+
+ default:
+ return nil, runtime.NewAPIError("unknown error", response, response.Code())
+ }
+}
+
+// NewSubscribeCreated creates a SubscribeCreated with default headers values
+func NewSubscribeCreated() *SubscribeCreated {
+ return &SubscribeCreated{}
+}
+
+/*SubscribeCreated handles this case with default header values.
+
+Subscription successfully created
+*/
+type SubscribeCreated struct {
+ Payload *clientmodel.SubscriptionResponse
+}
+
+func (o *SubscribeCreated) Error() string {
+ return fmt.Sprintf("[POST /subscriptions][%d] subscribeCreated %+v", 201, o.Payload)
+}
+
+func (o *SubscribeCreated) GetPayload() *clientmodel.SubscriptionResponse {
+ return o.Payload
+}
+
+func (o *SubscribeCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ o.Payload = new(clientmodel.SubscriptionResponse)
+
+ // response payload
+ if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
+ return err
+ }
+
+ return nil
+}
+
+// NewSubscribeBadRequest creates a SubscribeBadRequest with default headers values
+func NewSubscribeBadRequest() *SubscribeBadRequest {
+ return &SubscribeBadRequest{}
+}
+
+/*SubscribeBadRequest handles this case with default header values.
+
+Invalid input
+*/
+type SubscribeBadRequest struct {
+}
+
+func (o *SubscribeBadRequest) Error() string {
+ return fmt.Sprintf("[POST /subscriptions][%d] subscribeBadRequest ", 400)
+}
+
+func (o *SubscribeBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
+
+// NewSubscribeInternalServerError creates a SubscribeInternalServerError with default headers values
+func NewSubscribeInternalServerError() *SubscribeInternalServerError {
+ return &SubscribeInternalServerError{}
+}
+
+/*SubscribeInternalServerError handles this case with default header values.
+
+Internal error
+*/
+type SubscribeInternalServerError struct {
+}
+
+func (o *SubscribeInternalServerError) Error() string {
+ return fmt.Sprintf("[POST /subscriptions][%d] subscribeInternalServerError ", 500)
+}
+
+func (o *SubscribeInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/pkg/clientapi/common/unsubscribe_parameters.go b/pkg/clientapi/common/unsubscribe_parameters.go
index 6d32e7e..95c03e0 100644
--- a/pkg/clientapi/common/unsubscribe_parameters.go
+++ b/pkg/clientapi/common/unsubscribe_parameters.go
@@ -13,8 +13,7 @@
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
-
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/strfmt"
)
// NewUnsubscribeParams creates a new UnsubscribeParams object
diff --git a/pkg/clientapi/common/unsubscribe_responses.go b/pkg/clientapi/common/unsubscribe_responses.go
index 8d6b470..276c05c 100644
--- a/pkg/clientapi/common/unsubscribe_responses.go
+++ b/pkg/clientapi/common/unsubscribe_responses.go
@@ -9,8 +9,7 @@
"fmt"
"github.com/go-openapi/runtime"
-
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/strfmt"
)
// UnsubscribeReader is a Reader for the Unsubscribe structure.
@@ -21,21 +20,18 @@
// ReadResponse reads a server response into the received o.
func (o *UnsubscribeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
switch response.Code() {
-
case 204:
result := NewUnsubscribeNoContent()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return result, nil
-
case 400:
result := NewUnsubscribeBadRequest()
if err := result.readResponse(response, consumer, o.formats); err != nil {
return nil, err
}
return nil, result
-
case 500:
result := NewUnsubscribeInternalServerError()
if err := result.readResponse(response, consumer, o.formats); err != nil {
diff --git a/pkg/clientapi/policy/policy_client.go b/pkg/clientapi/policy/policy_client.go
deleted file mode 100644
index b8ca3bb..0000000
--- a/pkg/clientapi/policy/policy_client.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "github.com/go-openapi/runtime"
-
- strfmt "github.com/go-openapi/strfmt"
-)
-
-// New creates a new policy API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
- return &Client{transport: transport, formats: formats}
-}
-
-/*
-Client for policy API
-*/
-type Client struct {
- transport runtime.ClientTransport
- formats strfmt.Registry
-}
-
-/*
-SubscribePolicy subscribes and send p o l i c y message to r a n to execute a specific p o l i c y during call processing in r a n after each occurrence of a defined s u b s c r IP t i o n
-*/
-func (a *Client) SubscribePolicy(params *SubscribePolicyParams) (*SubscribePolicyCreated, error) {
- // TODO: Validate the params before sending
- if params == nil {
- params = NewSubscribePolicyParams()
- }
-
- result, err := a.transport.Submit(&runtime.ClientOperation{
- ID: "subscribePolicy",
- Method: "POST",
- PathPattern: "/subscriptions/policy",
- ProducesMediaTypes: []string{"application/json"},
- ConsumesMediaTypes: []string{"application/json"},
- Schemes: []string{"http"},
- Params: params,
- Reader: &SubscribePolicyReader{formats: a.formats},
- Context: params.Context,
- Client: params.HTTPClient,
- })
- if err != nil {
- return nil, err
- }
- return result.(*SubscribePolicyCreated), nil
-
-}
-
-// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
- a.transport = transport
-}
diff --git a/pkg/clientapi/policy/subscribe_policy_parameters.go b/pkg/clientapi/policy/subscribe_policy_parameters.go
deleted file mode 100644
index 9d4cf92..0000000
--- a/pkg/clientapi/policy/subscribe_policy_parameters.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "net/http"
- "time"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/runtime"
- cr "github.com/go-openapi/runtime/client"
-
- strfmt "github.com/go-openapi/strfmt"
-
- clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
-)
-
-// NewSubscribePolicyParams creates a new SubscribePolicyParams object
-// with the default values initialized.
-func NewSubscribePolicyParams() *SubscribePolicyParams {
- var ()
- return &SubscribePolicyParams{
-
- timeout: cr.DefaultTimeout,
- }
-}
-
-// NewSubscribePolicyParamsWithTimeout creates a new SubscribePolicyParams object
-// with the default values initialized, and the ability to set a timeout on a request
-func NewSubscribePolicyParamsWithTimeout(timeout time.Duration) *SubscribePolicyParams {
- var ()
- return &SubscribePolicyParams{
-
- timeout: timeout,
- }
-}
-
-// NewSubscribePolicyParamsWithContext creates a new SubscribePolicyParams object
-// with the default values initialized, and the ability to set a context for a request
-func NewSubscribePolicyParamsWithContext(ctx context.Context) *SubscribePolicyParams {
- var ()
- return &SubscribePolicyParams{
-
- Context: ctx,
- }
-}
-
-// NewSubscribePolicyParamsWithHTTPClient creates a new SubscribePolicyParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
-func NewSubscribePolicyParamsWithHTTPClient(client *http.Client) *SubscribePolicyParams {
- var ()
- return &SubscribePolicyParams{
- HTTPClient: client,
- }
-}
-
-/*SubscribePolicyParams contains all the parameters to send to the API endpoint
-for the subscribe policy operation typically these are written to a http.Request
-*/
-type SubscribePolicyParams struct {
-
- /*PolicyParams
- Subscription policy parameters
-
- */
- PolicyParams *clientmodel.PolicyParams
-
- timeout time.Duration
- Context context.Context
- HTTPClient *http.Client
-}
-
-// WithTimeout adds the timeout to the subscribe policy params
-func (o *SubscribePolicyParams) WithTimeout(timeout time.Duration) *SubscribePolicyParams {
- o.SetTimeout(timeout)
- return o
-}
-
-// SetTimeout adds the timeout to the subscribe policy params
-func (o *SubscribePolicyParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
-}
-
-// WithContext adds the context to the subscribe policy params
-func (o *SubscribePolicyParams) WithContext(ctx context.Context) *SubscribePolicyParams {
- o.SetContext(ctx)
- return o
-}
-
-// SetContext adds the context to the subscribe policy params
-func (o *SubscribePolicyParams) SetContext(ctx context.Context) {
- o.Context = ctx
-}
-
-// WithHTTPClient adds the HTTPClient to the subscribe policy params
-func (o *SubscribePolicyParams) WithHTTPClient(client *http.Client) *SubscribePolicyParams {
- o.SetHTTPClient(client)
- return o
-}
-
-// SetHTTPClient adds the HTTPClient to the subscribe policy params
-func (o *SubscribePolicyParams) SetHTTPClient(client *http.Client) {
- o.HTTPClient = client
-}
-
-// WithPolicyParams adds the policyParams to the subscribe policy params
-func (o *SubscribePolicyParams) WithPolicyParams(policyParams *clientmodel.PolicyParams) *SubscribePolicyParams {
- o.SetPolicyParams(policyParams)
- return o
-}
-
-// SetPolicyParams adds the policyParams to the subscribe policy params
-func (o *SubscribePolicyParams) SetPolicyParams(policyParams *clientmodel.PolicyParams) {
- o.PolicyParams = policyParams
-}
-
-// WriteToRequest writes these params to a swagger request
-func (o *SubscribePolicyParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
- return err
- }
- var res []error
-
- if o.PolicyParams != nil {
- if err := r.SetBodyParam(o.PolicyParams); err != nil {
- return err
- }
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
diff --git a/pkg/clientapi/policy/subscribe_policy_responses.go b/pkg/clientapi/policy/subscribe_policy_responses.go
deleted file mode 100644
index 6241c82..0000000
--- a/pkg/clientapi/policy/subscribe_policy_responses.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "fmt"
- "io"
-
- "github.com/go-openapi/runtime"
-
- strfmt "github.com/go-openapi/strfmt"
-
- clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
-)
-
-// SubscribePolicyReader is a Reader for the SubscribePolicy structure.
-type SubscribePolicyReader struct {
- formats strfmt.Registry
-}
-
-// ReadResponse reads a server response into the received o.
-func (o *SubscribePolicyReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
- switch response.Code() {
-
- case 201:
- result := NewSubscribePolicyCreated()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return result, nil
-
- case 400:
- result := NewSubscribePolicyBadRequest()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return nil, result
-
- case 500:
- result := NewSubscribePolicyInternalServerError()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return nil, result
-
- default:
- return nil, runtime.NewAPIError("unknown error", response, response.Code())
- }
-}
-
-// NewSubscribePolicyCreated creates a SubscribePolicyCreated with default headers values
-func NewSubscribePolicyCreated() *SubscribePolicyCreated {
- return &SubscribePolicyCreated{}
-}
-
-/*SubscribePolicyCreated handles this case with default header values.
-
-Subscription successfully created
-*/
-type SubscribePolicyCreated struct {
- Payload *clientmodel.SubscriptionResponse
-}
-
-func (o *SubscribePolicyCreated) Error() string {
- return fmt.Sprintf("[POST /subscriptions/policy][%d] subscribePolicyCreated %+v", 201, o.Payload)
-}
-
-func (o *SubscribePolicyCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- o.Payload = new(clientmodel.SubscriptionResponse)
-
- // response payload
- if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
- return err
- }
-
- return nil
-}
-
-// NewSubscribePolicyBadRequest creates a SubscribePolicyBadRequest with default headers values
-func NewSubscribePolicyBadRequest() *SubscribePolicyBadRequest {
- return &SubscribePolicyBadRequest{}
-}
-
-/*SubscribePolicyBadRequest handles this case with default header values.
-
-Invalid input
-*/
-type SubscribePolicyBadRequest struct {
-}
-
-func (o *SubscribePolicyBadRequest) Error() string {
- return fmt.Sprintf("[POST /subscriptions/policy][%d] subscribePolicyBadRequest ", 400)
-}
-
-func (o *SubscribePolicyBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- return nil
-}
-
-// NewSubscribePolicyInternalServerError creates a SubscribePolicyInternalServerError with default headers values
-func NewSubscribePolicyInternalServerError() *SubscribePolicyInternalServerError {
- return &SubscribePolicyInternalServerError{}
-}
-
-/*SubscribePolicyInternalServerError handles this case with default header values.
-
-Internal error
-*/
-type SubscribePolicyInternalServerError struct {
-}
-
-func (o *SubscribePolicyInternalServerError) Error() string {
- return fmt.Sprintf("[POST /subscriptions/policy][%d] subscribePolicyInternalServerError ", 500)
-}
-
-func (o *SubscribePolicyInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- return nil
-}
diff --git a/pkg/clientapi/query/query_client.go b/pkg/clientapi/query/query_client.go
deleted file mode 100644
index a73fd7e..0000000
--- a/pkg/clientapi/query/query_client.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package query
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "github.com/go-openapi/runtime"
-
- strfmt "github.com/go-openapi/strfmt"
-)
-
-// New creates a new query API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
- return &Client{transport: transport, formats: formats}
-}
-
-/*
-Client for query API
-*/
-type Client struct {
- transport runtime.ClientTransport
- formats strfmt.Registry
-}
-
-/*
-GetAllSubscriptions returns list of subscriptions
-*/
-func (a *Client) GetAllSubscriptions(params *GetAllSubscriptionsParams) (*GetAllSubscriptionsOK, error) {
- // TODO: Validate the params before sending
- if params == nil {
- params = NewGetAllSubscriptionsParams()
- }
-
- result, err := a.transport.Submit(&runtime.ClientOperation{
- ID: "getAllSubscriptions",
- Method: "GET",
- PathPattern: "/subscriptions",
- ProducesMediaTypes: []string{"application/json"},
- ConsumesMediaTypes: []string{""},
- Schemes: []string{"http"},
- Params: params,
- Reader: &GetAllSubscriptionsReader{formats: a.formats},
- Context: params.Context,
- Client: params.HTTPClient,
- })
- if err != nil {
- return nil, err
- }
- return result.(*GetAllSubscriptionsOK), nil
-
-}
-
-// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
- a.transport = transport
-}
diff --git a/pkg/clientapi/r_i_c_subscription_client.go b/pkg/clientapi/r_i_c_subscription_client.go
index 2acd8c0..47b7c1c 100644
--- a/pkg/clientapi/r_i_c_subscription_client.go
+++ b/pkg/clientapi/r_i_c_subscription_client.go
@@ -8,13 +8,10 @@
import (
"github.com/go-openapi/runtime"
httptransport "github.com/go-openapi/runtime/client"
-
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/strfmt"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/common"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/policy"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/query"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/report"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/xapp"
)
// Default r i c subscription HTTP client.
@@ -59,15 +56,8 @@
cli := new(RICSubscription)
cli.Transport = transport
-
cli.Common = common.New(transport, formats)
-
- cli.Policy = policy.New(transport, formats)
-
- cli.Query = query.New(transport, formats)
-
- cli.Report = report.New(transport, formats)
-
+ cli.Xapp = xapp.New(transport, formats)
return cli
}
@@ -112,13 +102,9 @@
// RICSubscription is a client for r i c subscription
type RICSubscription struct {
- Common *common.Client
+ Common common.ClientService
- Policy *policy.Client
-
- Query *query.Client
-
- Report *report.Client
+ Xapp xapp.ClientService
Transport runtime.ClientTransport
}
@@ -126,13 +112,6 @@
// SetTransport changes the transport on the client and all its subresources
func (c *RICSubscription) SetTransport(transport runtime.ClientTransport) {
c.Transport = transport
-
c.Common.SetTransport(transport)
-
- c.Policy.SetTransport(transport)
-
- c.Query.SetTransport(transport)
-
- c.Report.SetTransport(transport)
-
+ c.Xapp.SetTransport(transport)
}
diff --git a/pkg/clientapi/report/report_client.go b/pkg/clientapi/report/report_client.go
deleted file mode 100644
index 2f30071..0000000
--- a/pkg/clientapi/report/report_client.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package report
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "github.com/go-openapi/runtime"
-
- strfmt "github.com/go-openapi/strfmt"
-)
-
-// New creates a new report API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
- return &Client{transport: transport, formats: formats}
-}
-
-/*
-Client for report API
-*/
-type Client struct {
- transport runtime.ClientTransport
- formats strfmt.Registry
-}
-
-/*
-SubscribeReport subscribes a list of x2 a p event triggers to receive r e p o r t messages sent by r a n or subscribe to receive the content of g n b n r t table in r e p o r t message sent by r a n
-*/
-func (a *Client) SubscribeReport(params *SubscribeReportParams) (*SubscribeReportCreated, error) {
- // TODO: Validate the params before sending
- if params == nil {
- params = NewSubscribeReportParams()
- }
-
- result, err := a.transport.Submit(&runtime.ClientOperation{
- ID: "subscribeReport",
- Method: "POST",
- PathPattern: "/subscriptions/report",
- ProducesMediaTypes: []string{"application/json"},
- ConsumesMediaTypes: []string{"application/json"},
- Schemes: []string{"http"},
- Params: params,
- Reader: &SubscribeReportReader{formats: a.formats},
- Context: params.Context,
- Client: params.HTTPClient,
- })
- if err != nil {
- return nil, err
- }
- return result.(*SubscribeReportCreated), nil
-
-}
-
-// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
- a.transport = transport
-}
diff --git a/pkg/clientapi/report/subscribe_report_parameters.go b/pkg/clientapi/report/subscribe_report_parameters.go
deleted file mode 100644
index dad7e45..0000000
--- a/pkg/clientapi/report/subscribe_report_parameters.go
+++ /dev/null
@@ -1,139 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package report
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "context"
- "net/http"
- "time"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/runtime"
- cr "github.com/go-openapi/runtime/client"
-
- strfmt "github.com/go-openapi/strfmt"
-
- clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
-)
-
-// NewSubscribeReportParams creates a new SubscribeReportParams object
-// with the default values initialized.
-func NewSubscribeReportParams() *SubscribeReportParams {
- var ()
- return &SubscribeReportParams{
-
- timeout: cr.DefaultTimeout,
- }
-}
-
-// NewSubscribeReportParamsWithTimeout creates a new SubscribeReportParams object
-// with the default values initialized, and the ability to set a timeout on a request
-func NewSubscribeReportParamsWithTimeout(timeout time.Duration) *SubscribeReportParams {
- var ()
- return &SubscribeReportParams{
-
- timeout: timeout,
- }
-}
-
-// NewSubscribeReportParamsWithContext creates a new SubscribeReportParams object
-// with the default values initialized, and the ability to set a context for a request
-func NewSubscribeReportParamsWithContext(ctx context.Context) *SubscribeReportParams {
- var ()
- return &SubscribeReportParams{
-
- Context: ctx,
- }
-}
-
-// NewSubscribeReportParamsWithHTTPClient creates a new SubscribeReportParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
-func NewSubscribeReportParamsWithHTTPClient(client *http.Client) *SubscribeReportParams {
- var ()
- return &SubscribeReportParams{
- HTTPClient: client,
- }
-}
-
-/*SubscribeReportParams contains all the parameters to send to the API endpoint
-for the subscribe report operation typically these are written to a http.Request
-*/
-type SubscribeReportParams struct {
-
- /*ReportParams
- Subscription report parameters
-
- */
- ReportParams *clientmodel.ReportParams
-
- timeout time.Duration
- Context context.Context
- HTTPClient *http.Client
-}
-
-// WithTimeout adds the timeout to the subscribe report params
-func (o *SubscribeReportParams) WithTimeout(timeout time.Duration) *SubscribeReportParams {
- o.SetTimeout(timeout)
- return o
-}
-
-// SetTimeout adds the timeout to the subscribe report params
-func (o *SubscribeReportParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
-}
-
-// WithContext adds the context to the subscribe report params
-func (o *SubscribeReportParams) WithContext(ctx context.Context) *SubscribeReportParams {
- o.SetContext(ctx)
- return o
-}
-
-// SetContext adds the context to the subscribe report params
-func (o *SubscribeReportParams) SetContext(ctx context.Context) {
- o.Context = ctx
-}
-
-// WithHTTPClient adds the HTTPClient to the subscribe report params
-func (o *SubscribeReportParams) WithHTTPClient(client *http.Client) *SubscribeReportParams {
- o.SetHTTPClient(client)
- return o
-}
-
-// SetHTTPClient adds the HTTPClient to the subscribe report params
-func (o *SubscribeReportParams) SetHTTPClient(client *http.Client) {
- o.HTTPClient = client
-}
-
-// WithReportParams adds the reportParams to the subscribe report params
-func (o *SubscribeReportParams) WithReportParams(reportParams *clientmodel.ReportParams) *SubscribeReportParams {
- o.SetReportParams(reportParams)
- return o
-}
-
-// SetReportParams adds the reportParams to the subscribe report params
-func (o *SubscribeReportParams) SetReportParams(reportParams *clientmodel.ReportParams) {
- o.ReportParams = reportParams
-}
-
-// WriteToRequest writes these params to a swagger request
-func (o *SubscribeReportParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
- return err
- }
- var res []error
-
- if o.ReportParams != nil {
- if err := r.SetBodyParam(o.ReportParams); err != nil {
- return err
- }
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
diff --git a/pkg/clientapi/report/subscribe_report_responses.go b/pkg/clientapi/report/subscribe_report_responses.go
deleted file mode 100644
index bace786..0000000
--- a/pkg/clientapi/report/subscribe_report_responses.go
+++ /dev/null
@@ -1,123 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package report
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "fmt"
- "io"
-
- "github.com/go-openapi/runtime"
-
- strfmt "github.com/go-openapi/strfmt"
-
- clientmodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
-)
-
-// SubscribeReportReader is a Reader for the SubscribeReport structure.
-type SubscribeReportReader struct {
- formats strfmt.Registry
-}
-
-// ReadResponse reads a server response into the received o.
-func (o *SubscribeReportReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
- switch response.Code() {
-
- case 201:
- result := NewSubscribeReportCreated()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return result, nil
-
- case 400:
- result := NewSubscribeReportBadRequest()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return nil, result
-
- case 500:
- result := NewSubscribeReportInternalServerError()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return nil, result
-
- default:
- return nil, runtime.NewAPIError("unknown error", response, response.Code())
- }
-}
-
-// NewSubscribeReportCreated creates a SubscribeReportCreated with default headers values
-func NewSubscribeReportCreated() *SubscribeReportCreated {
- return &SubscribeReportCreated{}
-}
-
-/*SubscribeReportCreated handles this case with default header values.
-
-Subscription successfully created
-*/
-type SubscribeReportCreated struct {
- Payload *clientmodel.SubscriptionResponse
-}
-
-func (o *SubscribeReportCreated) Error() string {
- return fmt.Sprintf("[POST /subscriptions/report][%d] subscribeReportCreated %+v", 201, o.Payload)
-}
-
-func (o *SubscribeReportCreated) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- o.Payload = new(clientmodel.SubscriptionResponse)
-
- // response payload
- if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF {
- return err
- }
-
- return nil
-}
-
-// NewSubscribeReportBadRequest creates a SubscribeReportBadRequest with default headers values
-func NewSubscribeReportBadRequest() *SubscribeReportBadRequest {
- return &SubscribeReportBadRequest{}
-}
-
-/*SubscribeReportBadRequest handles this case with default header values.
-
-Invalid input
-*/
-type SubscribeReportBadRequest struct {
-}
-
-func (o *SubscribeReportBadRequest) Error() string {
- return fmt.Sprintf("[POST /subscriptions/report][%d] subscribeReportBadRequest ", 400)
-}
-
-func (o *SubscribeReportBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- return nil
-}
-
-// NewSubscribeReportInternalServerError creates a SubscribeReportInternalServerError with default headers values
-func NewSubscribeReportInternalServerError() *SubscribeReportInternalServerError {
- return &SubscribeReportInternalServerError{}
-}
-
-/*SubscribeReportInternalServerError handles this case with default header values.
-
-Internal error
-*/
-type SubscribeReportInternalServerError struct {
-}
-
-func (o *SubscribeReportInternalServerError) Error() string {
- return fmt.Sprintf("[POST /subscriptions/report][%d] subscribeReportInternalServerError ", 500)
-}
-
-func (o *SubscribeReportInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- return nil
-}
diff --git a/pkg/clientapi/xapp/get_xapp_config_list_parameters.go b/pkg/clientapi/xapp/get_xapp_config_list_parameters.go
new file mode 100644
index 0000000..0dd891b
--- /dev/null
+++ b/pkg/clientapi/xapp/get_xapp_config_list_parameters.go
@@ -0,0 +1,112 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package xapp
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "context"
+ "net/http"
+ "time"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/runtime"
+ cr "github.com/go-openapi/runtime/client"
+ "github.com/go-openapi/strfmt"
+)
+
+// NewGetXappConfigListParams creates a new GetXappConfigListParams object
+// with the default values initialized.
+func NewGetXappConfigListParams() *GetXappConfigListParams {
+
+ return &GetXappConfigListParams{
+
+ timeout: cr.DefaultTimeout,
+ }
+}
+
+// NewGetXappConfigListParamsWithTimeout creates a new GetXappConfigListParams object
+// with the default values initialized, and the ability to set a timeout on a request
+func NewGetXappConfigListParamsWithTimeout(timeout time.Duration) *GetXappConfigListParams {
+
+ return &GetXappConfigListParams{
+
+ timeout: timeout,
+ }
+}
+
+// NewGetXappConfigListParamsWithContext creates a new GetXappConfigListParams object
+// with the default values initialized, and the ability to set a context for a request
+func NewGetXappConfigListParamsWithContext(ctx context.Context) *GetXappConfigListParams {
+
+ return &GetXappConfigListParams{
+
+ Context: ctx,
+ }
+}
+
+// NewGetXappConfigListParamsWithHTTPClient creates a new GetXappConfigListParams object
+// with the default values initialized, and the ability to set a custom HTTPClient for a request
+func NewGetXappConfigListParamsWithHTTPClient(client *http.Client) *GetXappConfigListParams {
+
+ return &GetXappConfigListParams{
+ HTTPClient: client,
+ }
+}
+
+/*GetXappConfigListParams contains all the parameters to send to the API endpoint
+for the get xapp config list operation typically these are written to a http.Request
+*/
+type GetXappConfigListParams struct {
+ timeout time.Duration
+ Context context.Context
+ HTTPClient *http.Client
+}
+
+// WithTimeout adds the timeout to the get xapp config list params
+func (o *GetXappConfigListParams) WithTimeout(timeout time.Duration) *GetXappConfigListParams {
+ o.SetTimeout(timeout)
+ return o
+}
+
+// SetTimeout adds the timeout to the get xapp config list params
+func (o *GetXappConfigListParams) SetTimeout(timeout time.Duration) {
+ o.timeout = timeout
+}
+
+// WithContext adds the context to the get xapp config list params
+func (o *GetXappConfigListParams) WithContext(ctx context.Context) *GetXappConfigListParams {
+ o.SetContext(ctx)
+ return o
+}
+
+// SetContext adds the context to the get xapp config list params
+func (o *GetXappConfigListParams) SetContext(ctx context.Context) {
+ o.Context = ctx
+}
+
+// WithHTTPClient adds the HTTPClient to the get xapp config list params
+func (o *GetXappConfigListParams) WithHTTPClient(client *http.Client) *GetXappConfigListParams {
+ o.SetHTTPClient(client)
+ return o
+}
+
+// SetHTTPClient adds the HTTPClient to the get xapp config list params
+func (o *GetXappConfigListParams) SetHTTPClient(client *http.Client) {
+ o.HTTPClient = client
+}
+
+// WriteToRequest writes these params to a swagger request
+func (o *GetXappConfigListParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
+
+ if err := r.SetTimeout(o.timeout); err != nil {
+ return err
+ }
+ var res []error
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
diff --git a/pkg/clientapi/xapp/get_xapp_config_list_responses.go b/pkg/clientapi/xapp/get_xapp_config_list_responses.go
new file mode 100644
index 0000000..ed07aed
--- /dev/null
+++ b/pkg/clientapi/xapp/get_xapp_config_list_responses.go
@@ -0,0 +1,94 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package xapp
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "fmt"
+ "io"
+
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
+)
+
+// GetXappConfigListReader is a Reader for the GetXappConfigList structure.
+type GetXappConfigListReader struct {
+ formats strfmt.Registry
+}
+
+// ReadResponse reads a server response into the received o.
+func (o *GetXappConfigListReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
+ switch response.Code() {
+ case 200:
+ result := NewGetXappConfigListOK()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return result, nil
+ case 500:
+ result := NewGetXappConfigListInternalServerError()
+ if err := result.readResponse(response, consumer, o.formats); err != nil {
+ return nil, err
+ }
+ return nil, result
+
+ default:
+ return nil, runtime.NewAPIError("unknown error", response, response.Code())
+ }
+}
+
+// NewGetXappConfigListOK creates a GetXappConfigListOK with default headers values
+func NewGetXappConfigListOK() *GetXappConfigListOK {
+ return &GetXappConfigListOK{}
+}
+
+/*GetXappConfigListOK handles this case with default header values.
+
+successful query of xApp config
+*/
+type GetXappConfigListOK struct {
+ Payload clientmodel.XappConfigList
+}
+
+func (o *GetXappConfigListOK) Error() string {
+ return fmt.Sprintf("[GET /config][%d] getXappConfigListOK %+v", 200, o.Payload)
+}
+
+func (o *GetXappConfigListOK) GetPayload() clientmodel.XappConfigList {
+ return o.Payload
+}
+
+func (o *GetXappConfigListOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ // response payload
+ if err := consumer.Consume(response.Body(), &o.Payload); err != nil && err != io.EOF {
+ return err
+ }
+
+ return nil
+}
+
+// NewGetXappConfigListInternalServerError creates a GetXappConfigListInternalServerError with default headers values
+func NewGetXappConfigListInternalServerError() *GetXappConfigListInternalServerError {
+ return &GetXappConfigListInternalServerError{}
+}
+
+/*GetXappConfigListInternalServerError handles this case with default header values.
+
+Internal error
+*/
+type GetXappConfigListInternalServerError struct {
+}
+
+func (o *GetXappConfigListInternalServerError) Error() string {
+ return fmt.Sprintf("[GET /config][%d] getXappConfigListInternalServerError ", 500)
+}
+
+func (o *GetXappConfigListInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
+
+ return nil
+}
diff --git a/pkg/clientapi/xapp/xapp_client.go b/pkg/clientapi/xapp/xapp_client.go
new file mode 100644
index 0000000..fd20c51
--- /dev/null
+++ b/pkg/clientapi/xapp/xapp_client.go
@@ -0,0 +1,72 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package xapp
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "fmt"
+
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/strfmt"
+)
+
+// New creates a new xapp API client.
+func New(transport runtime.ClientTransport, formats strfmt.Registry) ClientService {
+ return &Client{transport: transport, formats: formats}
+}
+
+/*
+Client for xapp API
+*/
+type Client struct {
+ transport runtime.ClientTransport
+ formats strfmt.Registry
+}
+
+// ClientService is the interface for Client methods
+type ClientService interface {
+ GetXappConfigList(params *GetXappConfigListParams) (*GetXappConfigListOK, error)
+
+ SetTransport(transport runtime.ClientTransport)
+}
+
+/*
+ GetXappConfigList returns the configuration of all xapps
+*/
+func (a *Client) GetXappConfigList(params *GetXappConfigListParams) (*GetXappConfigListOK, error) {
+ // TODO: Validate the params before sending
+ if params == nil {
+ params = NewGetXappConfigListParams()
+ }
+
+ result, err := a.transport.Submit(&runtime.ClientOperation{
+ ID: "getXappConfigList",
+ Method: "GET",
+ PathPattern: "/config",
+ ProducesMediaTypes: []string{"application/json", "application/xml"},
+ ConsumesMediaTypes: []string{"application/json"},
+ Schemes: []string{"http"},
+ Params: params,
+ Reader: &GetXappConfigListReader{formats: a.formats},
+ Context: params.Context,
+ Client: params.HTTPClient,
+ })
+ if err != nil {
+ return nil, err
+ }
+ success, ok := result.(*GetXappConfigListOK)
+ if ok {
+ return success, nil
+ }
+ // unexpected success response
+ // safeguard: normally, absent a default response, unknown success responses return an error above: so this is a codegen issue
+ msg := fmt.Sprintf("unexpected success response for getXappConfigList: API contract not enforced by server. Client expected to get an error, but got: %T", result)
+ panic(msg)
+}
+
+// SetTransport changes the transport on the client
+func (a *Client) SetTransport(transport runtime.ClientTransport) {
+ a.transport = transport
+}
diff --git a/pkg/clientmodel/action_definition.go b/pkg/clientmodel/action_definition.go
new file mode 100644
index 0000000..f69c1f4
--- /dev/null
+++ b/pkg/clientmodel/action_definition.go
@@ -0,0 +1,20 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/strfmt"
+)
+
+// ActionDefinition E2SM byte array. ActionDefinition is an OPTIONAL IE
+//
+// swagger:model ActionDefinition
+type ActionDefinition []int64
+
+// Validate validates this action definition
+func (m ActionDefinition) Validate(formats strfmt.Registry) error {
+ return nil
+}
diff --git a/pkg/clientmodel/action_parameters.go b/pkg/clientmodel/action_parameters.go
deleted file mode 100644
index c73f60b..0000000
--- a/pkg/clientmodel/action_parameters.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ActionParameters action parameters
-// swagger:model ActionParameters
-type ActionParameters struct {
-
- // action parameter ID
- // Required: true
- ActionParameterID *int64 `json:"ActionParameterID"`
-
- // action parameter value
- // Required: true
- ActionParameterValue *bool `json:"ActionParameterValue"`
-}
-
-// Validate validates this action parameters
-func (m *ActionParameters) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionParameterID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateActionParameterValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ActionParameters) validateActionParameterID(formats strfmt.Registry) error {
-
- if err := validate.Required("ActionParameterID", "body", m.ActionParameterID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ActionParameters) validateActionParameterValue(formats strfmt.Registry) error {
-
- if err := validate.Required("ActionParameterValue", "body", m.ActionParameterValue); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ActionParameters) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ActionParameters) UnmarshalBinary(b []byte) error {
- var res ActionParameters
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/action_to_be_setup.go b/pkg/clientmodel/action_to_be_setup.go
new file mode 100644
index 0000000..b347c43
--- /dev/null
+++ b/pkg/clientmodel/action_to_be_setup.go
@@ -0,0 +1,179 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// ActionToBeSetup action to be setup
+//
+// swagger:model ActionToBeSetup
+type ActionToBeSetup struct {
+
+ // action definition
+ ActionDefinition ActionDefinition `json:"ActionDefinition,omitempty"`
+
+ // action ID
+ // Required: true
+ // Maximum: 255
+ // Minimum: 0
+ ActionID *int64 `json:"ActionID"`
+
+ // action type
+ // Required: true
+ // Enum: [insert policy report]
+ ActionType *string `json:"ActionType"`
+
+ // subsequent action
+ SubsequentAction *SubsequentAction `json:"SubsequentAction,omitempty"`
+}
+
+// Validate validates this action to be setup
+func (m *ActionToBeSetup) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateActionDefinition(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateActionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateActionType(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSubsequentAction(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *ActionToBeSetup) validateActionDefinition(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.ActionDefinition) { // not required
+ return nil
+ }
+
+ if err := m.ActionDefinition.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ActionDefinition")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *ActionToBeSetup) validateActionID(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionID", "body", m.ActionID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("ActionID", "body", int64(*m.ActionID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("ActionID", "body", int64(*m.ActionID), 255, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+var actionToBeSetupTypeActionTypePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ actionToBeSetupTypeActionTypePropEnum = append(actionToBeSetupTypeActionTypePropEnum, v)
+ }
+}
+
+const (
+
+ // ActionToBeSetupActionTypeInsert captures enum value "insert"
+ ActionToBeSetupActionTypeInsert string = "insert"
+
+ // ActionToBeSetupActionTypePolicy captures enum value "policy"
+ ActionToBeSetupActionTypePolicy string = "policy"
+
+ // ActionToBeSetupActionTypeReport captures enum value "report"
+ ActionToBeSetupActionTypeReport string = "report"
+)
+
+// prop value enum
+func (m *ActionToBeSetup) validateActionTypeEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, actionToBeSetupTypeActionTypePropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *ActionToBeSetup) validateActionType(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionType", "body", m.ActionType); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateActionTypeEnum("ActionType", "body", *m.ActionType); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *ActionToBeSetup) validateSubsequentAction(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.SubsequentAction) { // not required
+ return nil
+ }
+
+ if m.SubsequentAction != nil {
+ if err := m.SubsequentAction.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubsequentAction")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ActionToBeSetup) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ActionToBeSetup) UnmarshalBinary(b []byte) error {
+ var res ActionToBeSetup
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/event_trigger_list.go b/pkg/clientmodel/actions_to_be_setup.go
similarity index 72%
rename from pkg/clientmodel/event_trigger_list.go
rename to pkg/clientmodel/actions_to_be_setup.go
index f205322..6bffaac 100644
--- a/pkg/clientmodel/event_trigger_list.go
+++ b/pkg/clientmodel/actions_to_be_setup.go
@@ -8,18 +8,18 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// ActionsToBeSetup actions to be setup
+//
+// swagger:model ActionsToBeSetup
+type ActionsToBeSetup []*ActionToBeSetup
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this actions to be setup
+func (m ActionsToBeSetup) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
diff --git a/pkg/clientmodel/config_metadata.go b/pkg/clientmodel/config_metadata.go
new file mode 100644
index 0000000..2755a2a
--- /dev/null
+++ b/pkg/clientmodel/config_metadata.go
@@ -0,0 +1,121 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// ConfigMetadata config metadata
+//
+// swagger:model ConfigMetadata
+type ConfigMetadata struct {
+
+ // The type of the content
+ // Required: true
+ // Enum: [json xml other]
+ ConfigType *string `json:"configType"`
+
+ // Name of the xApp
+ // Required: true
+ XappName *string `json:"xappName"`
+}
+
+// Validate validates this config metadata
+func (m *ConfigMetadata) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateConfigType(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateXappName(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+var configMetadataTypeConfigTypePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["json","xml","other"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ configMetadataTypeConfigTypePropEnum = append(configMetadataTypeConfigTypePropEnum, v)
+ }
+}
+
+const (
+
+ // ConfigMetadataConfigTypeJSON captures enum value "json"
+ ConfigMetadataConfigTypeJSON string = "json"
+
+ // ConfigMetadataConfigTypeXML captures enum value "xml"
+ ConfigMetadataConfigTypeXML string = "xml"
+
+ // ConfigMetadataConfigTypeOther captures enum value "other"
+ ConfigMetadataConfigTypeOther string = "other"
+)
+
+// prop value enum
+func (m *ConfigMetadata) validateConfigTypeEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, configMetadataTypeConfigTypePropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *ConfigMetadata) validateConfigType(formats strfmt.Registry) error {
+
+ if err := validate.Required("configType", "body", m.ConfigType); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateConfigTypeEnum("configType", "body", *m.ConfigType); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *ConfigMetadata) validateXappName(formats strfmt.Registry) error {
+
+ if err := validate.Required("xappName", "body", m.XappName); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ConfigMetadata) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ConfigMetadata) UnmarshalBinary(b []byte) error {
+ var res ConfigMetadata
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/event_trigger.go b/pkg/clientmodel/event_trigger.go
deleted file mode 100644
index 02955ce..0000000
--- a/pkg/clientmodel/event_trigger.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "encoding/json"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// EventTrigger event trigger
-// swagger:model EventTrigger
-type EventTrigger struct {
-
- // e n b Id
- ENBID string `json:"ENBId,omitempty"`
-
- // interface direction
- InterfaceDirection int64 `json:"InterfaceDirection,omitempty"`
-
- // plmn Id
- PlmnID string `json:"PlmnId,omitempty"`
-
- // procedure code
- ProcedureCode int64 `json:"ProcedureCode,omitempty"`
-
- // trigger nature
- // Enum: [now on change]
- TriggerNature string `json:"TriggerNature,omitempty"`
-
- // type of message
- TypeOfMessage int64 `json:"TypeOfMessage,omitempty"`
-}
-
-// Validate validates this event trigger
-func (m *EventTrigger) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateTriggerNature(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var eventTriggerTypeTriggerNaturePropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["now","on change"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- eventTriggerTypeTriggerNaturePropEnum = append(eventTriggerTypeTriggerNaturePropEnum, v)
- }
-}
-
-const (
-
- // EventTriggerTriggerNatureNow captures enum value "now"
- EventTriggerTriggerNatureNow string = "now"
-
- // EventTriggerTriggerNatureOnChange captures enum value "on change"
- EventTriggerTriggerNatureOnChange string = "on change"
-)
-
-// prop value enum
-func (m *EventTrigger) validateTriggerNatureEnum(path, location string, value string) error {
- if err := validate.Enum(path, location, value, eventTriggerTypeTriggerNaturePropEnum); err != nil {
- return err
- }
- return nil
-}
-
-func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error {
-
- if swag.IsZero(m.TriggerNature) { // not required
- return nil
- }
-
- // value enum
- if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *EventTrigger) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *EventTrigger) UnmarshalBinary(b []byte) error {
- var res EventTrigger
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/event_trigger_definition.go b/pkg/clientmodel/event_trigger_definition.go
new file mode 100644
index 0000000..2adf2f9
--- /dev/null
+++ b/pkg/clientmodel/event_trigger_definition.go
@@ -0,0 +1,20 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/strfmt"
+)
+
+// EventTriggerDefinition E2SM byte array
+//
+// swagger:model EventTriggerDefinition
+type EventTriggerDefinition []int64
+
+// Validate validates this event trigger definition
+func (m EventTriggerDefinition) Validate(formats strfmt.Registry) error {
+ return nil
+}
diff --git a/pkg/clientmodel/format1_action_definition.go b/pkg/clientmodel/format1_action_definition.go
deleted file mode 100644
index f28039e..0000000
--- a/pkg/clientmodel/format1_action_definition.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "strconv"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Format1ActionDefinition format1 action definition
-// swagger:model Format1ActionDefinition
-type Format1ActionDefinition struct {
-
- // action parameters
- // Required: true
- ActionParameters []*ActionParameters `json:"ActionParameters"`
-
- // style ID
- // Required: true
- StyleID *int64 `json:"StyleID"`
-}
-
-// Validate validates this format1 action definition
-func (m *Format1ActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionParameters(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateStyleID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Format1ActionDefinition) validateActionParameters(formats strfmt.Registry) error {
-
- if err := validate.Required("ActionParameters", "body", m.ActionParameters); err != nil {
- return err
- }
-
- for i := 0; i < len(m.ActionParameters); i++ {
- if swag.IsZero(m.ActionParameters[i]) { // not required
- continue
- }
-
- if m.ActionParameters[i] != nil {
- if err := m.ActionParameters[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ActionParameters" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-func (m *Format1ActionDefinition) validateStyleID(formats strfmt.Registry) error {
-
- if err := validate.Required("StyleID", "body", m.StyleID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Format1ActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Format1ActionDefinition) UnmarshalBinary(b []byte) error {
- var res Format1ActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/format2_action_definition.go b/pkg/clientmodel/format2_action_definition.go
deleted file mode 100644
index 075d07f..0000000
--- a/pkg/clientmodel/format2_action_definition.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "strconv"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Format2ActionDefinition format2 action definition
-// swagger:model Format2ActionDefinition
-type Format2ActionDefinition struct {
-
- // r a n ue group parameters
- // Required: true
- RANUeGroupParameters []*RANUeGroupList `json:"RANUeGroupParameters"`
-}
-
-// Validate validates this format2 action definition
-func (m *Format2ActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRANUeGroupParameters(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Format2ActionDefinition) validateRANUeGroupParameters(formats strfmt.Registry) error {
-
- if err := validate.Required("RANUeGroupParameters", "body", m.RANUeGroupParameters); err != nil {
- return err
- }
-
- for i := 0; i < len(m.RANUeGroupParameters); i++ {
- if swag.IsZero(m.RANUeGroupParameters[i]) { // not required
- continue
- }
-
- if m.RANUeGroupParameters[i] != nil {
- if err := m.RANUeGroupParameters[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("RANUeGroupParameters" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Format2ActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Format2ActionDefinition) UnmarshalBinary(b []byte) error {
- var res Format2ActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/imperative_policy_definition.go b/pkg/clientmodel/imperative_policy_definition.go
deleted file mode 100644
index 3163bf9..0000000
--- a/pkg/clientmodel/imperative_policy_definition.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ImperativePolicyDefinition imperative policy definition
-// swagger:model ImperativePolicyDefinition
-type ImperativePolicyDefinition struct {
-
- // policy parameter ID
- // Required: true
- PolicyParameterID *int64 `json:"PolicyParameterID"`
-
- // policy parameter value
- // Required: true
- PolicyParameterValue *int64 `json:"PolicyParameterValue"`
-}
-
-// Validate validates this imperative policy definition
-func (m *ImperativePolicyDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePolicyParameterID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePolicyParameterValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ImperativePolicyDefinition) validatePolicyParameterID(formats strfmt.Registry) error {
-
- if err := validate.Required("PolicyParameterID", "body", m.PolicyParameterID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ImperativePolicyDefinition) validatePolicyParameterValue(formats strfmt.Registry) error {
-
- if err := validate.Required("PolicyParameterValue", "body", m.PolicyParameterValue); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ImperativePolicyDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ImperativePolicyDefinition) UnmarshalBinary(b []byte) error {
- var res ImperativePolicyDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/policy_action_definition.go b/pkg/clientmodel/policy_action_definition.go
deleted file mode 100644
index 4190913..0000000
--- a/pkg/clientmodel/policy_action_definition.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
-)
-
-// PolicyActionDefinition policy action definition
-// swagger:model PolicyActionDefinition
-type PolicyActionDefinition struct {
-
- // action definition format2
- ActionDefinitionFormat2 *Format2ActionDefinition `json:"ActionDefinitionFormat2,omitempty"`
-}
-
-// Validate validates this policy action definition
-func (m *PolicyActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionDefinitionFormat2(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PolicyActionDefinition) validateActionDefinitionFormat2(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ActionDefinitionFormat2) { // not required
- return nil
- }
-
- if m.ActionDefinitionFormat2 != nil {
- if err := m.ActionDefinitionFormat2.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ActionDefinitionFormat2")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PolicyActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PolicyActionDefinition) UnmarshalBinary(b []byte) error {
- var res PolicyActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/policy_params.go b/pkg/clientmodel/policy_params.go
deleted file mode 100644
index 210fba7..0000000
--- a/pkg/clientmodel/policy_params.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PolicyParams policy params
-// swagger:model PolicyParams
-type PolicyParams struct {
-
- // client endpoint
- // Required: true
- ClientEndpoint *string `json:"ClientEndpoint"`
-
- // event triggers
- // Required: true
- EventTriggers EventTriggerList `json:"EventTriggers"`
-
- // meid
- // Required: true
- Meid *string `json:"Meid"`
-
- // policy action definitions
- // Required: true
- PolicyActionDefinitions *PolicyActionDefinition `json:"PolicyActionDefinitions"`
-
- // r a n function ID
- // Required: true
- RANFunctionID *int64 `json:"RANFunctionID"`
-}
-
-// Validate validates this policy params
-func (m *PolicyParams) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateClientEndpoint(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateEventTriggers(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateMeid(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePolicyActionDefinitions(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANFunctionID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PolicyParams) validateClientEndpoint(formats strfmt.Registry) error {
-
- if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PolicyParams) validateEventTriggers(formats strfmt.Registry) error {
-
- if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
- return err
- }
-
- if err := m.EventTriggers.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("EventTriggers")
- }
- return err
- }
-
- return nil
-}
-
-func (m *PolicyParams) validateMeid(formats strfmt.Registry) error {
-
- if err := validate.Required("Meid", "body", m.Meid); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PolicyParams) validatePolicyActionDefinitions(formats strfmt.Registry) error {
-
- if err := validate.Required("PolicyActionDefinitions", "body", m.PolicyActionDefinitions); err != nil {
- return err
- }
-
- if m.PolicyActionDefinitions != nil {
- if err := m.PolicyActionDefinitions.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("PolicyActionDefinitions")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *PolicyParams) validateRANFunctionID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PolicyParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PolicyParams) UnmarshalBinary(b []byte) error {
- var res PolicyParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/r_a_n_ue_group_list.go b/pkg/clientmodel/r_a_n_ue_group_list.go
deleted file mode 100644
index d9d612f..0000000
--- a/pkg/clientmodel/r_a_n_ue_group_list.go
+++ /dev/null
@@ -1,116 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// RANUeGroupList r a n ue group list
-// swagger:model RANUeGroupList
-type RANUeGroupList struct {
-
- // r a n imperative policy
- // Required: true
- RANImperativePolicy *ImperativePolicyDefinition `json:"RANImperativePolicy"`
-
- // r a n ue group definition
- // Required: true
- RANUeGroupDefinition *RANUeGroupParams `json:"RANUeGroupDefinition"`
-
- // r a n ue group ID
- // Required: true
- RANUeGroupID *int64 `json:"RANUeGroupID"`
-}
-
-// Validate validates this r a n ue group list
-func (m *RANUeGroupList) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRANImperativePolicy(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANUeGroupDefinition(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANUeGroupID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RANUeGroupList) validateRANImperativePolicy(formats strfmt.Registry) error {
-
- if err := validate.Required("RANImperativePolicy", "body", m.RANImperativePolicy); err != nil {
- return err
- }
-
- if m.RANImperativePolicy != nil {
- if err := m.RANImperativePolicy.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("RANImperativePolicy")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RANUeGroupList) validateRANUeGroupDefinition(formats strfmt.Registry) error {
-
- if err := validate.Required("RANUeGroupDefinition", "body", m.RANUeGroupDefinition); err != nil {
- return err
- }
-
- if m.RANUeGroupDefinition != nil {
- if err := m.RANUeGroupDefinition.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("RANUeGroupDefinition")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RANUeGroupList) validateRANUeGroupID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANUeGroupID", "body", m.RANUeGroupID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RANUeGroupList) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RANUeGroupList) UnmarshalBinary(b []byte) error {
- var res RANUeGroupList
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/r_a_n_ue_group_params.go b/pkg/clientmodel/r_a_n_ue_group_params.go
deleted file mode 100644
index ba24f98..0000000
--- a/pkg/clientmodel/r_a_n_ue_group_params.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "encoding/json"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// RANUeGroupParams r a n ue group params
-// swagger:model RANUeGroupParams
-type RANUeGroupParams struct {
-
- // r a n parameter ID
- // Required: true
- RANParameterID *int64 `json:"RANParameterID"`
-
- // r a n parameter test condition
- // Enum: [equal greaterthan lessthan contains present]
- RANParameterTestCondition string `json:"RANParameterTestCondition,omitempty"`
-
- // r a n parameter value
- // Required: true
- RANParameterValue *int64 `json:"RANParameterValue"`
-}
-
-// Validate validates this r a n ue group params
-func (m *RANUeGroupParams) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRANParameterID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANParameterTestCondition(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANParameterValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANParameterID", "body", m.RANParameterID); err != nil {
- return err
- }
-
- return nil
-}
-
-var rANUeGroupParamsTypeRANParameterTestConditionPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["equal","greaterthan","lessthan","contains","present"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- rANUeGroupParamsTypeRANParameterTestConditionPropEnum = append(rANUeGroupParamsTypeRANParameterTestConditionPropEnum, v)
- }
-}
-
-const (
-
- // RANUeGroupParamsRANParameterTestConditionEqual captures enum value "equal"
- RANUeGroupParamsRANParameterTestConditionEqual string = "equal"
-
- // RANUeGroupParamsRANParameterTestConditionGreaterthan captures enum value "greaterthan"
- RANUeGroupParamsRANParameterTestConditionGreaterthan string = "greaterthan"
-
- // RANUeGroupParamsRANParameterTestConditionLessthan captures enum value "lessthan"
- RANUeGroupParamsRANParameterTestConditionLessthan string = "lessthan"
-
- // RANUeGroupParamsRANParameterTestConditionContains captures enum value "contains"
- RANUeGroupParamsRANParameterTestConditionContains string = "contains"
-
- // RANUeGroupParamsRANParameterTestConditionPresent captures enum value "present"
- RANUeGroupParamsRANParameterTestConditionPresent string = "present"
-)
-
-// prop value enum
-func (m *RANUeGroupParams) validateRANParameterTestConditionEnum(path, location string, value string) error {
- if err := validate.Enum(path, location, value, rANUeGroupParamsTypeRANParameterTestConditionPropEnum); err != nil {
- return err
- }
- return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterTestCondition(formats strfmt.Registry) error {
-
- if swag.IsZero(m.RANParameterTestCondition) { // not required
- return nil
- }
-
- // value enum
- if err := m.validateRANParameterTestConditionEnum("RANParameterTestCondition", "body", m.RANParameterTestCondition); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterValue(formats strfmt.Registry) error {
-
- if err := validate.Required("RANParameterValue", "body", m.RANParameterValue); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RANUeGroupParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RANUeGroupParams) UnmarshalBinary(b []byte) error {
- var res RANUeGroupParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/report_action_definition.go b/pkg/clientmodel/report_action_definition.go
deleted file mode 100644
index 1657b44..0000000
--- a/pkg/clientmodel/report_action_definition.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
-)
-
-// ReportActionDefinition report action definition
-// swagger:model ReportActionDefinition
-type ReportActionDefinition struct {
-
- // action definition format1
- ActionDefinitionFormat1 *Format1ActionDefinition `json:"ActionDefinitionFormat1,omitempty"`
-}
-
-// Validate validates this report action definition
-func (m *ReportActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionDefinitionFormat1(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ReportActionDefinition) validateActionDefinitionFormat1(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ActionDefinitionFormat1) { // not required
- return nil
- }
-
- if m.ActionDefinitionFormat1 != nil {
- if err := m.ActionDefinitionFormat1.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ActionDefinitionFormat1")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ReportActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ReportActionDefinition) UnmarshalBinary(b []byte) error {
- var res ReportActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/report_params.go b/pkg/clientmodel/report_params.go
deleted file mode 100644
index 151c2d0..0000000
--- a/pkg/clientmodel/report_params.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ReportParams report params
-// swagger:model ReportParams
-type ReportParams struct {
-
- // client endpoint
- // Required: true
- ClientEndpoint *string `json:"ClientEndpoint"`
-
- // event triggers
- // Required: true
- EventTriggers EventTriggerList `json:"EventTriggers"`
-
- // meid
- Meid string `json:"Meid,omitempty"`
-
- // r a n function ID
- // Required: true
- RANFunctionID *int64 `json:"RANFunctionID"`
-
- // report action definitions
- ReportActionDefinitions *ReportActionDefinition `json:"ReportActionDefinitions,omitempty"`
-}
-
-// Validate validates this report params
-func (m *ReportParams) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateClientEndpoint(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateEventTriggers(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANFunctionID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateReportActionDefinitions(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ReportParams) validateClientEndpoint(formats strfmt.Registry) error {
-
- if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ReportParams) validateEventTriggers(formats strfmt.Registry) error {
-
- if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
- return err
- }
-
- if err := m.EventTriggers.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("EventTriggers")
- }
- return err
- }
-
- return nil
-}
-
-func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ReportParams) validateReportActionDefinitions(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ReportActionDefinitions) { // not required
- return nil
- }
-
- if m.ReportActionDefinitions != nil {
- if err := m.ReportActionDefinitions.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ReportActionDefinitions")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ReportParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ReportParams) UnmarshalBinary(b []byte) error {
- var res ReportParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/subscription_data.go b/pkg/clientmodel/subscription_data.go
index 8d22352..92d7165 100644
--- a/pkg/clientmodel/subscription_data.go
+++ b/pkg/clientmodel/subscription_data.go
@@ -6,27 +6,67 @@
// Editing this file might prove futile when you re-run the swagger generate command
import (
- strfmt "github.com/go-openapi/strfmt"
+ "strconv"
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SubscriptionData subscription data
+//
// swagger:model SubscriptionData
type SubscriptionData struct {
- // endpoint
- Endpoint []string `json:"Endpoint"`
+ // client endpoint
+ ClientEndpoint []string `json:"ClientEndpoint"`
// meid
Meid string `json:"Meid,omitempty"`
// subscription Id
SubscriptionID int64 `json:"SubscriptionId,omitempty"`
+
+ // subscription instances
+ SubscriptionInstances []*SubscriptionInstance `json:"SubscriptionInstances"`
}
// Validate validates this subscription data
func (m *SubscriptionData) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateSubscriptionInstances(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionData) validateSubscriptionInstances(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.SubscriptionInstances) { // not required
+ return nil
+ }
+
+ for i := 0; i < len(m.SubscriptionInstances); i++ {
+ if swag.IsZero(m.SubscriptionInstances[i]) { // not required
+ continue
+ }
+
+ if m.SubscriptionInstances[i] != nil {
+ if err := m.SubscriptionInstances[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubscriptionInstances" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
return nil
}
diff --git a/pkg/clientmodel/subscription_detail.go b/pkg/clientmodel/subscription_detail.go
new file mode 100644
index 0000000..db04cb9
--- /dev/null
+++ b/pkg/clientmodel/subscription_detail.go
@@ -0,0 +1,122 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubscriptionDetail subscription detail
+//
+// swagger:model SubscriptionDetail
+type SubscriptionDetail struct {
+
+ // action to be setup list
+ // Required: true
+ ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
+
+ // event triggers
+ // Required: true
+ EventTriggers EventTriggerDefinition `json:"EventTriggers"`
+
+ // xapp event instance Id
+ // Required: true
+ // Maximum: 65535
+ // Minimum: 0
+ XappEventInstanceID *int64 `json:"XappEventInstanceId"`
+}
+
+// Validate validates this subscription detail
+func (m *SubscriptionDetail) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateActionToBeSetupList(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateEventTriggers(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateXappEventInstanceID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionDetail) validateActionToBeSetupList(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
+ return err
+ }
+
+ if err := m.ActionToBeSetupList.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ActionToBeSetupList")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionDetail) validateEventTriggers(formats strfmt.Registry) error {
+
+ if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
+ return err
+ }
+
+ if err := m.EventTriggers.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("EventTriggers")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionDetail) validateXappEventInstanceID(formats strfmt.Registry) error {
+
+ if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionDetail) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionDetail) UnmarshalBinary(b []byte) error {
+ var res SubscriptionDetail
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/subscription_details.go b/pkg/clientmodel/subscription_details.go
new file mode 100644
index 0000000..05677cd
--- /dev/null
+++ b/pkg/clientmodel/subscription_details.go
@@ -0,0 +1,97 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubscriptionDetails subscription details
+// swagger:model SubscriptionDetails
+type SubscriptionDetails struct {
+
+ // action to be setup list
+ // Required: true
+ ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
+
+ // event trigger list
+ // Required: true
+ EventTriggerList *EventTriggerDefinition `json:"EventTriggerList"`
+}
+
+// Validate validates this subscription details
+func (m *SubscriptionDetails) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateActionToBeSetupList(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateEventTriggerList(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionDetails) validateActionToBeSetupList(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
+ return err
+ }
+
+ if err := m.ActionToBeSetupList.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ActionToBeSetupList")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionDetails) validateEventTriggerList(formats strfmt.Registry) error {
+
+ if err := validate.Required("EventTriggerList", "body", m.EventTriggerList); err != nil {
+ return err
+ }
+
+ if m.EventTriggerList != nil {
+ if err := m.EventTriggerList.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("EventTriggerList")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionDetails) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionDetails) UnmarshalBinary(b []byte) error {
+ var res SubscriptionDetails
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/event_trigger_list.go b/pkg/clientmodel/subscription_details_list.go
similarity index 68%
copy from pkg/clientmodel/event_trigger_list.go
copy to pkg/clientmodel/subscription_details_list.go
index f205322..9d4f60d 100644
--- a/pkg/clientmodel/event_trigger_list.go
+++ b/pkg/clientmodel/subscription_details_list.go
@@ -8,18 +8,18 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// SubscriptionDetailsList subscription details list
+//
+// swagger:model SubscriptionDetailsList
+type SubscriptionDetailsList []*SubscriptionDetail
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this subscription details list
+func (m SubscriptionDetailsList) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
diff --git a/pkg/clientmodel/subscription_instance.go b/pkg/clientmodel/subscription_instance.go
index 4606479..4f099a6 100644
--- a/pkg/clientmodel/subscription_instance.go
+++ b/pkg/clientmodel/subscription_instance.go
@@ -6,35 +6,47 @@
// Editing this file might prove futile when you re-run the swagger generate command
import (
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SubscriptionInstance subscription instance
+//
// swagger:model SubscriptionInstance
type SubscriptionInstance struct {
- // instance Id
+ // e2 event instance Id
// Required: true
- InstanceID *int64 `json:"InstanceId"`
+ // Maximum: 65535
+ // Minimum: 0
+ E2EventInstanceID *int64 `json:"E2EventInstanceId"`
- // requestor Id
+ // Empty string when no error.
// Required: true
- RequestorID *int64 `json:"RequestorId"`
+ ErrorCause *string `json:"ErrorCause"`
+
+ // xapp event instance Id
+ // Required: true
+ // Maximum: 65535
+ // Minimum: 0
+ XappEventInstanceID *int64 `json:"XappEventInstanceId"`
}
// Validate validates this subscription instance
func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
var res []error
- if err := m.validateInstanceID(formats); err != nil {
+ if err := m.validateE2EventInstanceID(formats); err != nil {
res = append(res, err)
}
- if err := m.validateRequestorID(formats); err != nil {
+ if err := m.validateErrorCause(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateXappEventInstanceID(formats); err != nil {
res = append(res, err)
}
@@ -44,18 +56,43 @@
return nil
}
-func (m *SubscriptionInstance) validateInstanceID(formats strfmt.Registry) error {
+func (m *SubscriptionInstance) validateE2EventInstanceID(formats strfmt.Registry) error {
- if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
+ if err := validate.Required("E2EventInstanceId", "body", m.E2EventInstanceID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 65535, false); err != nil {
return err
}
return nil
}
-func (m *SubscriptionInstance) validateRequestorID(formats strfmt.Registry) error {
+func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
- if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
+ if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionInstance) validateXappEventInstanceID(formats strfmt.Registry) error {
+
+ if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
return err
}
diff --git a/pkg/clientmodel/subscription_list.go b/pkg/clientmodel/subscription_list.go
index e5b7479..59a4570 100644
--- a/pkg/clientmodel/subscription_list.go
+++ b/pkg/clientmodel/subscription_list.go
@@ -8,13 +8,13 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SubscriptionList A list of subscriptions
+//
// swagger:model SubscriptionList
type SubscriptionList []*SubscriptionData
diff --git a/pkg/clientmodel/subscription_params.go b/pkg/clientmodel/subscription_params.go
new file mode 100644
index 0000000..fdd41ca
--- /dev/null
+++ b/pkg/clientmodel/subscription_params.go
@@ -0,0 +1,233 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubscriptionParams subscription params
+//
+// swagger:model SubscriptionParams
+type SubscriptionParams struct {
+
+ // client endpoint
+ // Required: true
+ ClientEndpoint *SubscriptionParamsClientEndpoint `json:"ClientEndpoint"`
+
+ // meid
+ // Required: true
+ Meid *string `json:"Meid"`
+
+ // r a n function ID
+ // Required: true
+ // Maximum: 4095
+ // Minimum: 0
+ RANFunctionID *int64 `json:"RANFunctionID"`
+
+ // subscription details
+ // Required: true
+ SubscriptionDetails SubscriptionDetailsList `json:"SubscriptionDetails"`
+
+ // Optional subscription ID (Submgr allocates if not given)
+ SubscriptionID string `json:"SubscriptionId,omitempty"`
+}
+
+// Validate validates this subscription params
+func (m *SubscriptionParams) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateClientEndpoint(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMeid(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRANFunctionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSubscriptionDetails(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionParams) validateClientEndpoint(formats strfmt.Registry) error {
+
+ if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
+ return err
+ }
+
+ if m.ClientEndpoint != nil {
+ if err := m.ClientEndpoint.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ClientEndpoint")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParams) validateMeid(formats strfmt.Registry) error {
+
+ if err := validate.Required("Meid", "body", m.Meid); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParams) validateRANFunctionID(formats strfmt.Registry) error {
+
+ if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 4095, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParams) validateSubscriptionDetails(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubscriptionDetails", "body", m.SubscriptionDetails); err != nil {
+ return err
+ }
+
+ if err := m.SubscriptionDetails.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubscriptionDetails")
+ }
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionParams) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionParams) UnmarshalBinary(b []byte) error {
+ var res SubscriptionParams
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
+
+// SubscriptionParamsClientEndpoint xApp service address and port
+//
+// swagger:model SubscriptionParamsClientEndpoint
+type SubscriptionParamsClientEndpoint struct {
+
+ // xApp HTTP service address port
+ // Maximum: 65535
+ // Minimum: 0
+ HTTPPort *int64 `json:"HTTPPort,omitempty"`
+
+ // xApp service address name like 'service-ricxapp-xappname-http.ricxapp'
+ Host string `json:"Host,omitempty"`
+
+ // xApp RMR service address port
+ // Maximum: 65535
+ // Minimum: 0
+ RMRPort *int64 `json:"RMRPort,omitempty"`
+}
+
+// Validate validates this subscription params client endpoint
+func (m *SubscriptionParamsClientEndpoint) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateHTTPPort(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRMRPort(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionParamsClientEndpoint) validateHTTPPort(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.HTTPPort) { // not required
+ return nil
+ }
+
+ if err := validate.MinimumInt("ClientEndpoint"+"."+"HTTPPort", "body", int64(*m.HTTPPort), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("ClientEndpoint"+"."+"HTTPPort", "body", int64(*m.HTTPPort), 65535, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParamsClientEndpoint) validateRMRPort(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.RMRPort) { // not required
+ return nil
+ }
+
+ if err := validate.MinimumInt("ClientEndpoint"+"."+"RMRPort", "body", int64(*m.RMRPort), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("ClientEndpoint"+"."+"RMRPort", "body", int64(*m.RMRPort), 65535, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionParamsClientEndpoint) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionParamsClientEndpoint) UnmarshalBinary(b []byte) error {
+ var res SubscriptionParamsClientEndpoint
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/subscription_response.go b/pkg/clientmodel/subscription_response.go
index 2714b5b..d325629 100644
--- a/pkg/clientmodel/subscription_response.go
+++ b/pkg/clientmodel/subscription_response.go
@@ -8,14 +8,14 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SubscriptionResponse subscription response
+//
// swagger:model SubscriptionResponse
type SubscriptionResponse struct {
diff --git a/pkg/clientmodel/subscription_response_item.go b/pkg/clientmodel/subscription_response_item.go
deleted file mode 100644
index 8237495..0000000
--- a/pkg/clientmodel/subscription_response_item.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// SubscriptionResponseItem subscription response item
-// swagger:model SubscriptionResponseItem
-type SubscriptionResponseItem struct {
-
- // instance Id
- // Required: true
- InstanceID *int64 `json:"InstanceId"`
-
- // requestor Id
- // Required: true
- RequestorID *int64 `json:"RequestorId"`
-
- // subscription Id
- // Required: true
- SubscriptionID *string `json:"SubscriptionId"`
-}
-
-// Validate validates this subscription response item
-func (m *SubscriptionResponseItem) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateInstanceID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRequestorID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSubscriptionID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *SubscriptionResponseItem) validateInstanceID(formats strfmt.Registry) error {
-
- if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SubscriptionResponseItem) validateRequestorID(formats strfmt.Registry) error {
-
- if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SubscriptionResponseItem) validateSubscriptionID(formats strfmt.Registry) error {
-
- if err := validate.Required("SubscriptionId", "body", m.SubscriptionID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *SubscriptionResponseItem) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *SubscriptionResponseItem) UnmarshalBinary(b []byte) error {
- var res SubscriptionResponseItem
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/clientmodel/subscription_type.go b/pkg/clientmodel/subscription_type.go
deleted file mode 100644
index eafbe57..0000000
--- a/pkg/clientmodel/subscription_type.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package clientmodel
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "encoding/json"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/validate"
-)
-
-// SubscriptionType subscription type
-// swagger:model SubscriptionType
-type SubscriptionType string
-
-const (
-
- // SubscriptionTypeInsert captures enum value "insert"
- SubscriptionTypeInsert SubscriptionType = "insert"
-
- // SubscriptionTypePolicy captures enum value "policy"
- SubscriptionTypePolicy SubscriptionType = "policy"
-
- // SubscriptionTypeReport captures enum value "report"
- SubscriptionTypeReport SubscriptionType = "report"
-)
-
-// for schema
-var subscriptionTypeEnum []interface{}
-
-func init() {
- var res []SubscriptionType
- if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- subscriptionTypeEnum = append(subscriptionTypeEnum, v)
- }
-}
-
-func (m SubscriptionType) validateSubscriptionTypeEnum(path, location string, value SubscriptionType) error {
- if err := validate.Enum(path, location, value, subscriptionTypeEnum); err != nil {
- return err
- }
- return nil
-}
-
-// Validate validates this subscription type
-func (m SubscriptionType) Validate(formats strfmt.Registry) error {
- var res []error
-
- // value enum
- if err := m.validateSubscriptionTypeEnum("", "body", m); err != nil {
- return err
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
diff --git a/pkg/clientmodel/subsequent_action.go b/pkg/clientmodel/subsequent_action.go
new file mode 100644
index 0000000..d9184e3
--- /dev/null
+++ b/pkg/clientmodel/subsequent_action.go
@@ -0,0 +1,201 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubsequentAction SubsequentAction is an OPTIONAL IE
+//
+// swagger:model SubsequentAction
+type SubsequentAction struct {
+
+ // subsequent action type
+ // Required: true
+ // Enum: [continue wait]
+ SubsequentActionType *string `json:"SubsequentActionType"`
+
+ // time to wait
+ // Required: true
+ // Enum: [zero w1ms w2ms w5ms w10ms w20ms w30ms w40ms w50ms w100ms w200ms w500ms w1s w2s w5s w10s w20s w60s]
+ TimeToWait *string `json:"TimeToWait"`
+}
+
+// Validate validates this subsequent action
+func (m *SubsequentAction) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateSubsequentActionType(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTimeToWait(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+var subsequentActionTypeSubsequentActionTypePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["continue","wait"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ subsequentActionTypeSubsequentActionTypePropEnum = append(subsequentActionTypeSubsequentActionTypePropEnum, v)
+ }
+}
+
+const (
+
+ // SubsequentActionSubsequentActionTypeContinue captures enum value "continue"
+ SubsequentActionSubsequentActionTypeContinue string = "continue"
+
+ // SubsequentActionSubsequentActionTypeWait captures enum value "wait"
+ SubsequentActionSubsequentActionTypeWait string = "wait"
+)
+
+// prop value enum
+func (m *SubsequentAction) validateSubsequentActionTypeEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, subsequentActionTypeSubsequentActionTypePropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *SubsequentAction) validateSubsequentActionType(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubsequentActionType", "body", m.SubsequentActionType); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateSubsequentActionTypeEnum("SubsequentActionType", "body", *m.SubsequentActionType); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+var subsequentActionTypeTimeToWaitPropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["zero","w1ms","w2ms","w5ms","w10ms","w20ms","w30ms","w40ms","w50ms","w100ms","w200ms","w500ms","w1s","w2s","w5s","w10s","w20s","w60s"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ subsequentActionTypeTimeToWaitPropEnum = append(subsequentActionTypeTimeToWaitPropEnum, v)
+ }
+}
+
+const (
+
+ // SubsequentActionTimeToWaitZero captures enum value "zero"
+ SubsequentActionTimeToWaitZero string = "zero"
+
+ // SubsequentActionTimeToWaitW1ms captures enum value "w1ms"
+ SubsequentActionTimeToWaitW1ms string = "w1ms"
+
+ // SubsequentActionTimeToWaitW2ms captures enum value "w2ms"
+ SubsequentActionTimeToWaitW2ms string = "w2ms"
+
+ // SubsequentActionTimeToWaitW5ms captures enum value "w5ms"
+ SubsequentActionTimeToWaitW5ms string = "w5ms"
+
+ // SubsequentActionTimeToWaitW10ms captures enum value "w10ms"
+ SubsequentActionTimeToWaitW10ms string = "w10ms"
+
+ // SubsequentActionTimeToWaitW20ms captures enum value "w20ms"
+ SubsequentActionTimeToWaitW20ms string = "w20ms"
+
+ // SubsequentActionTimeToWaitW30ms captures enum value "w30ms"
+ SubsequentActionTimeToWaitW30ms string = "w30ms"
+
+ // SubsequentActionTimeToWaitW40ms captures enum value "w40ms"
+ SubsequentActionTimeToWaitW40ms string = "w40ms"
+
+ // SubsequentActionTimeToWaitW50ms captures enum value "w50ms"
+ SubsequentActionTimeToWaitW50ms string = "w50ms"
+
+ // SubsequentActionTimeToWaitW100ms captures enum value "w100ms"
+ SubsequentActionTimeToWaitW100ms string = "w100ms"
+
+ // SubsequentActionTimeToWaitW200ms captures enum value "w200ms"
+ SubsequentActionTimeToWaitW200ms string = "w200ms"
+
+ // SubsequentActionTimeToWaitW500ms captures enum value "w500ms"
+ SubsequentActionTimeToWaitW500ms string = "w500ms"
+
+ // SubsequentActionTimeToWaitW1s captures enum value "w1s"
+ SubsequentActionTimeToWaitW1s string = "w1s"
+
+ // SubsequentActionTimeToWaitW2s captures enum value "w2s"
+ SubsequentActionTimeToWaitW2s string = "w2s"
+
+ // SubsequentActionTimeToWaitW5s captures enum value "w5s"
+ SubsequentActionTimeToWaitW5s string = "w5s"
+
+ // SubsequentActionTimeToWaitW10s captures enum value "w10s"
+ SubsequentActionTimeToWaitW10s string = "w10s"
+
+ // SubsequentActionTimeToWaitW20s captures enum value "w20s"
+ SubsequentActionTimeToWaitW20s string = "w20s"
+
+ // SubsequentActionTimeToWaitW60s captures enum value "w60s"
+ SubsequentActionTimeToWaitW60s string = "w60s"
+)
+
+// prop value enum
+func (m *SubsequentAction) validateTimeToWaitEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, subsequentActionTypeTimeToWaitPropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *SubsequentAction) validateTimeToWait(formats strfmt.Registry) error {
+
+ if err := validate.Required("TimeToWait", "body", m.TimeToWait); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateTimeToWaitEnum("TimeToWait", "body", *m.TimeToWait); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubsequentAction) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubsequentAction) UnmarshalBinary(b []byte) error {
+ var res SubsequentAction
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/x_app_config.go b/pkg/clientmodel/x_app_config.go
new file mode 100644
index 0000000..1536ae8
--- /dev/null
+++ b/pkg/clientmodel/x_app_config.go
@@ -0,0 +1,90 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package clientmodel
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// XAppConfig x app config
+//
+// swagger:model XAppConfig
+type XAppConfig struct {
+
+ // Configuration in JSON format
+ // Required: true
+ Config interface{} `json:"config"`
+
+ // metadata
+ // Required: true
+ Metadata *ConfigMetadata `json:"metadata"`
+}
+
+// Validate validates this x app config
+func (m *XAppConfig) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateConfig(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMetadata(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *XAppConfig) validateConfig(formats strfmt.Registry) error {
+
+ if err := validate.Required("config", "body", m.Config); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *XAppConfig) validateMetadata(formats strfmt.Registry) error {
+
+ if err := validate.Required("metadata", "body", m.Metadata); err != nil {
+ return err
+ }
+
+ if m.Metadata != nil {
+ if err := m.Metadata.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("metadata")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *XAppConfig) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *XAppConfig) UnmarshalBinary(b []byte) error {
+ var res XAppConfig
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/clientmodel/event_trigger_list.go b/pkg/clientmodel/xapp_config_list.go
similarity index 71%
copy from pkg/clientmodel/event_trigger_list.go
copy to pkg/clientmodel/xapp_config_list.go
index f205322..9f0a8c7 100644
--- a/pkg/clientmodel/event_trigger_list.go
+++ b/pkg/clientmodel/xapp_config_list.go
@@ -8,18 +8,18 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// XappConfigList xapp config list
+//
+// swagger:model XappConfigList
+type XappConfigList []*XAppConfig
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this xapp config list
+func (m XappConfigList) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
diff --git a/pkg/models/action_definition.go b/pkg/models/action_definition.go
new file mode 100644
index 0000000..2cf839a
--- /dev/null
+++ b/pkg/models/action_definition.go
@@ -0,0 +1,20 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/strfmt"
+)
+
+// ActionDefinition E2SM byte array. ActionDefinition is an OPTIONAL IE
+//
+// swagger:model ActionDefinition
+type ActionDefinition []int64
+
+// Validate validates this action definition
+func (m ActionDefinition) Validate(formats strfmt.Registry) error {
+ return nil
+}
diff --git a/pkg/models/action_parameters.go b/pkg/models/action_parameters.go
deleted file mode 100644
index 0173bd3..0000000
--- a/pkg/models/action_parameters.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ActionParameters action parameters
-// swagger:model ActionParameters
-type ActionParameters struct {
-
- // action parameter ID
- // Required: true
- ActionParameterID *int64 `json:"ActionParameterID"`
-
- // action parameter value
- // Required: true
- ActionParameterValue *bool `json:"ActionParameterValue"`
-}
-
-// Validate validates this action parameters
-func (m *ActionParameters) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionParameterID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateActionParameterValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ActionParameters) validateActionParameterID(formats strfmt.Registry) error {
-
- if err := validate.Required("ActionParameterID", "body", m.ActionParameterID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ActionParameters) validateActionParameterValue(formats strfmt.Registry) error {
-
- if err := validate.Required("ActionParameterValue", "body", m.ActionParameterValue); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ActionParameters) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ActionParameters) UnmarshalBinary(b []byte) error {
- var res ActionParameters
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/action_to_be_setup.go b/pkg/models/action_to_be_setup.go
new file mode 100644
index 0000000..2136bf6
--- /dev/null
+++ b/pkg/models/action_to_be_setup.go
@@ -0,0 +1,179 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// ActionToBeSetup action to be setup
+//
+// swagger:model ActionToBeSetup
+type ActionToBeSetup struct {
+
+ // action definition
+ ActionDefinition ActionDefinition `json:"ActionDefinition,omitempty"`
+
+ // action ID
+ // Required: true
+ // Maximum: 255
+ // Minimum: 0
+ ActionID *int64 `json:"ActionID"`
+
+ // action type
+ // Required: true
+ // Enum: [insert policy report]
+ ActionType *string `json:"ActionType"`
+
+ // subsequent action
+ SubsequentAction *SubsequentAction `json:"SubsequentAction,omitempty"`
+}
+
+// Validate validates this action to be setup
+func (m *ActionToBeSetup) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateActionDefinition(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateActionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateActionType(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSubsequentAction(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *ActionToBeSetup) validateActionDefinition(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.ActionDefinition) { // not required
+ return nil
+ }
+
+ if err := m.ActionDefinition.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ActionDefinition")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *ActionToBeSetup) validateActionID(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionID", "body", m.ActionID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("ActionID", "body", int64(*m.ActionID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("ActionID", "body", int64(*m.ActionID), 255, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+var actionToBeSetupTypeActionTypePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ actionToBeSetupTypeActionTypePropEnum = append(actionToBeSetupTypeActionTypePropEnum, v)
+ }
+}
+
+const (
+
+ // ActionToBeSetupActionTypeInsert captures enum value "insert"
+ ActionToBeSetupActionTypeInsert string = "insert"
+
+ // ActionToBeSetupActionTypePolicy captures enum value "policy"
+ ActionToBeSetupActionTypePolicy string = "policy"
+
+ // ActionToBeSetupActionTypeReport captures enum value "report"
+ ActionToBeSetupActionTypeReport string = "report"
+)
+
+// prop value enum
+func (m *ActionToBeSetup) validateActionTypeEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, actionToBeSetupTypeActionTypePropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *ActionToBeSetup) validateActionType(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionType", "body", m.ActionType); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateActionTypeEnum("ActionType", "body", *m.ActionType); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *ActionToBeSetup) validateSubsequentAction(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.SubsequentAction) { // not required
+ return nil
+ }
+
+ if m.SubsequentAction != nil {
+ if err := m.SubsequentAction.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubsequentAction")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *ActionToBeSetup) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *ActionToBeSetup) UnmarshalBinary(b []byte) error {
+ var res ActionToBeSetup
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/models/event_trigger_list.go b/pkg/models/actions_to_be_setup.go
similarity index 72%
rename from pkg/models/event_trigger_list.go
rename to pkg/models/actions_to_be_setup.go
index c3c3dbc..f900148 100644
--- a/pkg/models/event_trigger_list.go
+++ b/pkg/models/actions_to_be_setup.go
@@ -8,18 +8,18 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// ActionsToBeSetup actions to be setup
+//
+// swagger:model ActionsToBeSetup
+type ActionsToBeSetup []*ActionToBeSetup
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this actions to be setup
+func (m ActionsToBeSetup) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
diff --git a/pkg/models/config_metadata.go b/pkg/models/config_metadata.go
index f564287..f2b30e6 100644
--- a/pkg/models/config_metadata.go
+++ b/pkg/models/config_metadata.go
@@ -8,14 +8,14 @@
import (
"encoding/json"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// ConfigMetadata config metadata
+//
// swagger:model ConfigMetadata
type ConfigMetadata struct {
diff --git a/pkg/models/event_trigger.go b/pkg/models/event_trigger.go
deleted file mode 100644
index 43375c4..0000000
--- a/pkg/models/event_trigger.go
+++ /dev/null
@@ -1,115 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "encoding/json"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// EventTrigger event trigger
-// swagger:model EventTrigger
-type EventTrigger struct {
-
- // e n b Id
- ENBID string `json:"ENBId,omitempty"`
-
- // interface direction
- InterfaceDirection int64 `json:"InterfaceDirection,omitempty"`
-
- // plmn Id
- PlmnID string `json:"PlmnId,omitempty"`
-
- // procedure code
- ProcedureCode int64 `json:"ProcedureCode,omitempty"`
-
- // trigger nature
- // Enum: [now on change]
- TriggerNature string `json:"TriggerNature,omitempty"`
-
- // type of message
- TypeOfMessage int64 `json:"TypeOfMessage,omitempty"`
-}
-
-// Validate validates this event trigger
-func (m *EventTrigger) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateTriggerNature(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-var eventTriggerTypeTriggerNaturePropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["now","on change"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- eventTriggerTypeTriggerNaturePropEnum = append(eventTriggerTypeTriggerNaturePropEnum, v)
- }
-}
-
-const (
-
- // EventTriggerTriggerNatureNow captures enum value "now"
- EventTriggerTriggerNatureNow string = "now"
-
- // EventTriggerTriggerNatureOnChange captures enum value "on change"
- EventTriggerTriggerNatureOnChange string = "on change"
-)
-
-// prop value enum
-func (m *EventTrigger) validateTriggerNatureEnum(path, location string, value string) error {
- if err := validate.Enum(path, location, value, eventTriggerTypeTriggerNaturePropEnum); err != nil {
- return err
- }
- return nil
-}
-
-func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error {
-
- if swag.IsZero(m.TriggerNature) { // not required
- return nil
- }
-
- // value enum
- if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *EventTrigger) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *EventTrigger) UnmarshalBinary(b []byte) error {
- var res EventTrigger
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/event_trigger_definition.go b/pkg/models/event_trigger_definition.go
new file mode 100644
index 0000000..d75feda
--- /dev/null
+++ b/pkg/models/event_trigger_definition.go
@@ -0,0 +1,20 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/strfmt"
+)
+
+// EventTriggerDefinition E2SM byte array
+//
+// swagger:model EventTriggerDefinition
+type EventTriggerDefinition []int64
+
+// Validate validates this event trigger definition
+func (m EventTriggerDefinition) Validate(formats strfmt.Registry) error {
+ return nil
+}
diff --git a/pkg/models/format1_action_definition.go b/pkg/models/format1_action_definition.go
deleted file mode 100644
index 9d568a1..0000000
--- a/pkg/models/format1_action_definition.go
+++ /dev/null
@@ -1,99 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "strconv"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Format1ActionDefinition format1 action definition
-// swagger:model Format1ActionDefinition
-type Format1ActionDefinition struct {
-
- // action parameters
- // Required: true
- ActionParameters []*ActionParameters `json:"ActionParameters"`
-
- // style ID
- // Required: true
- StyleID *int64 `json:"StyleID"`
-}
-
-// Validate validates this format1 action definition
-func (m *Format1ActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionParameters(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateStyleID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Format1ActionDefinition) validateActionParameters(formats strfmt.Registry) error {
-
- if err := validate.Required("ActionParameters", "body", m.ActionParameters); err != nil {
- return err
- }
-
- for i := 0; i < len(m.ActionParameters); i++ {
- if swag.IsZero(m.ActionParameters[i]) { // not required
- continue
- }
-
- if m.ActionParameters[i] != nil {
- if err := m.ActionParameters[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ActionParameters" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-func (m *Format1ActionDefinition) validateStyleID(formats strfmt.Registry) error {
-
- if err := validate.Required("StyleID", "body", m.StyleID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Format1ActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Format1ActionDefinition) UnmarshalBinary(b []byte) error {
- var res Format1ActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/format2_action_definition.go b/pkg/models/format2_action_definition.go
deleted file mode 100644
index 351c7ae..0000000
--- a/pkg/models/format2_action_definition.go
+++ /dev/null
@@ -1,82 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "strconv"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// Format2ActionDefinition format2 action definition
-// swagger:model Format2ActionDefinition
-type Format2ActionDefinition struct {
-
- // r a n ue group parameters
- // Required: true
- RANUeGroupParameters []*RANUeGroupList `json:"RANUeGroupParameters"`
-}
-
-// Validate validates this format2 action definition
-func (m *Format2ActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRANUeGroupParameters(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *Format2ActionDefinition) validateRANUeGroupParameters(formats strfmt.Registry) error {
-
- if err := validate.Required("RANUeGroupParameters", "body", m.RANUeGroupParameters); err != nil {
- return err
- }
-
- for i := 0; i < len(m.RANUeGroupParameters); i++ {
- if swag.IsZero(m.RANUeGroupParameters[i]) { // not required
- continue
- }
-
- if m.RANUeGroupParameters[i] != nil {
- if err := m.RANUeGroupParameters[i].Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("RANUeGroupParameters" + "." + strconv.Itoa(i))
- }
- return err
- }
- }
-
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *Format2ActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *Format2ActionDefinition) UnmarshalBinary(b []byte) error {
- var res Format2ActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/imperative_policy_definition.go b/pkg/models/imperative_policy_definition.go
deleted file mode 100644
index 0b2a541..0000000
--- a/pkg/models/imperative_policy_definition.go
+++ /dev/null
@@ -1,81 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ImperativePolicyDefinition imperative policy definition
-// swagger:model ImperativePolicyDefinition
-type ImperativePolicyDefinition struct {
-
- // policy parameter ID
- // Required: true
- PolicyParameterID *int64 `json:"PolicyParameterID"`
-
- // policy parameter value
- // Required: true
- PolicyParameterValue *int64 `json:"PolicyParameterValue"`
-}
-
-// Validate validates this imperative policy definition
-func (m *ImperativePolicyDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validatePolicyParameterID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePolicyParameterValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ImperativePolicyDefinition) validatePolicyParameterID(formats strfmt.Registry) error {
-
- if err := validate.Required("PolicyParameterID", "body", m.PolicyParameterID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ImperativePolicyDefinition) validatePolicyParameterValue(formats strfmt.Registry) error {
-
- if err := validate.Required("PolicyParameterValue", "body", m.PolicyParameterValue); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ImperativePolicyDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ImperativePolicyDefinition) UnmarshalBinary(b []byte) error {
- var res ImperativePolicyDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/policy_action_definition.go b/pkg/models/policy_action_definition.go
deleted file mode 100644
index 841c868..0000000
--- a/pkg/models/policy_action_definition.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
-)
-
-// PolicyActionDefinition policy action definition
-// swagger:model PolicyActionDefinition
-type PolicyActionDefinition struct {
-
- // action definition format2
- ActionDefinitionFormat2 *Format2ActionDefinition `json:"ActionDefinitionFormat2,omitempty"`
-}
-
-// Validate validates this policy action definition
-func (m *PolicyActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionDefinitionFormat2(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PolicyActionDefinition) validateActionDefinitionFormat2(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ActionDefinitionFormat2) { // not required
- return nil
- }
-
- if m.ActionDefinitionFormat2 != nil {
- if err := m.ActionDefinitionFormat2.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ActionDefinitionFormat2")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PolicyActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PolicyActionDefinition) UnmarshalBinary(b []byte) error {
- var res PolicyActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/policy_params.go b/pkg/models/policy_params.go
deleted file mode 100644
index ab7b09d..0000000
--- a/pkg/models/policy_params.go
+++ /dev/null
@@ -1,148 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// PolicyParams policy params
-// swagger:model PolicyParams
-type PolicyParams struct {
-
- // client endpoint
- // Required: true
- ClientEndpoint *string `json:"ClientEndpoint"`
-
- // event triggers
- // Required: true
- EventTriggers EventTriggerList `json:"EventTriggers"`
-
- // meid
- // Required: true
- Meid *string `json:"Meid"`
-
- // policy action definitions
- // Required: true
- PolicyActionDefinitions *PolicyActionDefinition `json:"PolicyActionDefinitions"`
-
- // r a n function ID
- // Required: true
- RANFunctionID *int64 `json:"RANFunctionID"`
-}
-
-// Validate validates this policy params
-func (m *PolicyParams) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateClientEndpoint(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateEventTriggers(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateMeid(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validatePolicyActionDefinitions(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANFunctionID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *PolicyParams) validateClientEndpoint(formats strfmt.Registry) error {
-
- if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PolicyParams) validateEventTriggers(formats strfmt.Registry) error {
-
- if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
- return err
- }
-
- if err := m.EventTriggers.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("EventTriggers")
- }
- return err
- }
-
- return nil
-}
-
-func (m *PolicyParams) validateMeid(formats strfmt.Registry) error {
-
- if err := validate.Required("Meid", "body", m.Meid); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *PolicyParams) validatePolicyActionDefinitions(formats strfmt.Registry) error {
-
- if err := validate.Required("PolicyActionDefinitions", "body", m.PolicyActionDefinitions); err != nil {
- return err
- }
-
- if m.PolicyActionDefinitions != nil {
- if err := m.PolicyActionDefinitions.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("PolicyActionDefinitions")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *PolicyParams) validateRANFunctionID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *PolicyParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *PolicyParams) UnmarshalBinary(b []byte) error {
- var res PolicyParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/r_a_n_ue_group_list.go b/pkg/models/r_a_n_ue_group_list.go
deleted file mode 100644
index b0bbc14..0000000
--- a/pkg/models/r_a_n_ue_group_list.go
+++ /dev/null
@@ -1,116 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// RANUeGroupList r a n ue group list
-// swagger:model RANUeGroupList
-type RANUeGroupList struct {
-
- // r a n imperative policy
- // Required: true
- RANImperativePolicy *ImperativePolicyDefinition `json:"RANImperativePolicy"`
-
- // r a n ue group definition
- // Required: true
- RANUeGroupDefinition *RANUeGroupParams `json:"RANUeGroupDefinition"`
-
- // r a n ue group ID
- // Required: true
- RANUeGroupID *int64 `json:"RANUeGroupID"`
-}
-
-// Validate validates this r a n ue group list
-func (m *RANUeGroupList) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRANImperativePolicy(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANUeGroupDefinition(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANUeGroupID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RANUeGroupList) validateRANImperativePolicy(formats strfmt.Registry) error {
-
- if err := validate.Required("RANImperativePolicy", "body", m.RANImperativePolicy); err != nil {
- return err
- }
-
- if m.RANImperativePolicy != nil {
- if err := m.RANImperativePolicy.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("RANImperativePolicy")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RANUeGroupList) validateRANUeGroupDefinition(formats strfmt.Registry) error {
-
- if err := validate.Required("RANUeGroupDefinition", "body", m.RANUeGroupDefinition); err != nil {
- return err
- }
-
- if m.RANUeGroupDefinition != nil {
- if err := m.RANUeGroupDefinition.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("RANUeGroupDefinition")
- }
- return err
- }
- }
-
- return nil
-}
-
-func (m *RANUeGroupList) validateRANUeGroupID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANUeGroupID", "body", m.RANUeGroupID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RANUeGroupList) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RANUeGroupList) UnmarshalBinary(b []byte) error {
- var res RANUeGroupList
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/r_a_n_ue_group_params.go b/pkg/models/r_a_n_ue_group_params.go
deleted file mode 100644
index 411d6a3..0000000
--- a/pkg/models/r_a_n_ue_group_params.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "encoding/json"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// RANUeGroupParams r a n ue group params
-// swagger:model RANUeGroupParams
-type RANUeGroupParams struct {
-
- // r a n parameter ID
- // Required: true
- RANParameterID *int64 `json:"RANParameterID"`
-
- // r a n parameter test condition
- // Enum: [equal greaterthan lessthan contains present]
- RANParameterTestCondition string `json:"RANParameterTestCondition,omitempty"`
-
- // r a n parameter value
- // Required: true
- RANParameterValue *int64 `json:"RANParameterValue"`
-}
-
-// Validate validates this r a n ue group params
-func (m *RANUeGroupParams) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateRANParameterID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANParameterTestCondition(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANParameterValue(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANParameterID", "body", m.RANParameterID); err != nil {
- return err
- }
-
- return nil
-}
-
-var rANUeGroupParamsTypeRANParameterTestConditionPropEnum []interface{}
-
-func init() {
- var res []string
- if err := json.Unmarshal([]byte(`["equal","greaterthan","lessthan","contains","present"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- rANUeGroupParamsTypeRANParameterTestConditionPropEnum = append(rANUeGroupParamsTypeRANParameterTestConditionPropEnum, v)
- }
-}
-
-const (
-
- // RANUeGroupParamsRANParameterTestConditionEqual captures enum value "equal"
- RANUeGroupParamsRANParameterTestConditionEqual string = "equal"
-
- // RANUeGroupParamsRANParameterTestConditionGreaterthan captures enum value "greaterthan"
- RANUeGroupParamsRANParameterTestConditionGreaterthan string = "greaterthan"
-
- // RANUeGroupParamsRANParameterTestConditionLessthan captures enum value "lessthan"
- RANUeGroupParamsRANParameterTestConditionLessthan string = "lessthan"
-
- // RANUeGroupParamsRANParameterTestConditionContains captures enum value "contains"
- RANUeGroupParamsRANParameterTestConditionContains string = "contains"
-
- // RANUeGroupParamsRANParameterTestConditionPresent captures enum value "present"
- RANUeGroupParamsRANParameterTestConditionPresent string = "present"
-)
-
-// prop value enum
-func (m *RANUeGroupParams) validateRANParameterTestConditionEnum(path, location string, value string) error {
- if err := validate.Enum(path, location, value, rANUeGroupParamsTypeRANParameterTestConditionPropEnum); err != nil {
- return err
- }
- return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterTestCondition(formats strfmt.Registry) error {
-
- if swag.IsZero(m.RANParameterTestCondition) { // not required
- return nil
- }
-
- // value enum
- if err := m.validateRANParameterTestConditionEnum("RANParameterTestCondition", "body", m.RANParameterTestCondition); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *RANUeGroupParams) validateRANParameterValue(formats strfmt.Registry) error {
-
- if err := validate.Required("RANParameterValue", "body", m.RANParameterValue); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *RANUeGroupParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *RANUeGroupParams) UnmarshalBinary(b []byte) error {
- var res RANUeGroupParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/report_action_definition.go b/pkg/models/report_action_definition.go
deleted file mode 100644
index d578394..0000000
--- a/pkg/models/report_action_definition.go
+++ /dev/null
@@ -1,71 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
-)
-
-// ReportActionDefinition report action definition
-// swagger:model ReportActionDefinition
-type ReportActionDefinition struct {
-
- // action definition format1
- ActionDefinitionFormat1 *Format1ActionDefinition `json:"ActionDefinitionFormat1,omitempty"`
-}
-
-// Validate validates this report action definition
-func (m *ReportActionDefinition) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateActionDefinitionFormat1(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ReportActionDefinition) validateActionDefinitionFormat1(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ActionDefinitionFormat1) { // not required
- return nil
- }
-
- if m.ActionDefinitionFormat1 != nil {
- if err := m.ActionDefinitionFormat1.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ActionDefinitionFormat1")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ReportActionDefinition) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ReportActionDefinition) UnmarshalBinary(b []byte) error {
- var res ReportActionDefinition
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/report_params.go b/pkg/models/report_params.go
deleted file mode 100644
index b1d46b8..0000000
--- a/pkg/models/report_params.go
+++ /dev/null
@@ -1,133 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// ReportParams report params
-// swagger:model ReportParams
-type ReportParams struct {
-
- // client endpoint
- // Required: true
- ClientEndpoint *string `json:"ClientEndpoint"`
-
- // event triggers
- // Required: true
- EventTriggers EventTriggerList `json:"EventTriggers"`
-
- // meid
- Meid string `json:"Meid,omitempty"`
-
- // r a n function ID
- // Required: true
- RANFunctionID *int64 `json:"RANFunctionID"`
-
- // report action definitions
- ReportActionDefinitions *ReportActionDefinition `json:"ReportActionDefinitions,omitempty"`
-}
-
-// Validate validates this report params
-func (m *ReportParams) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateClientEndpoint(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateEventTriggers(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRANFunctionID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateReportActionDefinitions(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *ReportParams) validateClientEndpoint(formats strfmt.Registry) error {
-
- if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ReportParams) validateEventTriggers(formats strfmt.Registry) error {
-
- if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
- return err
- }
-
- if err := m.EventTriggers.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("EventTriggers")
- }
- return err
- }
-
- return nil
-}
-
-func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error {
-
- if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *ReportParams) validateReportActionDefinitions(formats strfmt.Registry) error {
-
- if swag.IsZero(m.ReportActionDefinitions) { // not required
- return nil
- }
-
- if m.ReportActionDefinitions != nil {
- if err := m.ReportActionDefinitions.Validate(formats); err != nil {
- if ve, ok := err.(*errors.Validation); ok {
- return ve.ValidateName("ReportActionDefinitions")
- }
- return err
- }
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ReportParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ReportParams) UnmarshalBinary(b []byte) error {
- var res ReportParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/subscription_data.go b/pkg/models/subscription_data.go
index a297e62..c22db46 100644
--- a/pkg/models/subscription_data.go
+++ b/pkg/models/subscription_data.go
@@ -6,27 +6,67 @@
// Editing this file might prove futile when you re-run the swagger generate command
import (
- strfmt "github.com/go-openapi/strfmt"
+ "strconv"
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SubscriptionData subscription data
+//
// swagger:model SubscriptionData
type SubscriptionData struct {
- // endpoint
- Endpoint []string `json:"Endpoint"`
+ // client endpoint
+ ClientEndpoint []string `json:"ClientEndpoint"`
// meid
Meid string `json:"Meid,omitempty"`
// subscription Id
SubscriptionID int64 `json:"SubscriptionId,omitempty"`
+
+ // subscription instances
+ SubscriptionInstances []*SubscriptionInstance `json:"SubscriptionInstances"`
}
// Validate validates this subscription data
func (m *SubscriptionData) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateSubscriptionInstances(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionData) validateSubscriptionInstances(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.SubscriptionInstances) { // not required
+ return nil
+ }
+
+ for i := 0; i < len(m.SubscriptionInstances); i++ {
+ if swag.IsZero(m.SubscriptionInstances[i]) { // not required
+ continue
+ }
+
+ if m.SubscriptionInstances[i] != nil {
+ if err := m.SubscriptionInstances[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubscriptionInstances" + "." + strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
return nil
}
diff --git a/pkg/models/subscription_detail.go b/pkg/models/subscription_detail.go
new file mode 100644
index 0000000..f157aba
--- /dev/null
+++ b/pkg/models/subscription_detail.go
@@ -0,0 +1,122 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubscriptionDetail subscription detail
+//
+// swagger:model SubscriptionDetail
+type SubscriptionDetail struct {
+
+ // action to be setup list
+ // Required: true
+ ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
+
+ // event triggers
+ // Required: true
+ EventTriggers EventTriggerDefinition `json:"EventTriggers"`
+
+ // xapp event instance Id
+ // Required: true
+ // Maximum: 65535
+ // Minimum: 0
+ XappEventInstanceID *int64 `json:"XappEventInstanceId"`
+}
+
+// Validate validates this subscription detail
+func (m *SubscriptionDetail) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateActionToBeSetupList(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateEventTriggers(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateXappEventInstanceID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionDetail) validateActionToBeSetupList(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
+ return err
+ }
+
+ if err := m.ActionToBeSetupList.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ActionToBeSetupList")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionDetail) validateEventTriggers(formats strfmt.Registry) error {
+
+ if err := validate.Required("EventTriggers", "body", m.EventTriggers); err != nil {
+ return err
+ }
+
+ if err := m.EventTriggers.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("EventTriggers")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionDetail) validateXappEventInstanceID(formats strfmt.Registry) error {
+
+ if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionDetail) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionDetail) UnmarshalBinary(b []byte) error {
+ var res SubscriptionDetail
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/models/subscription_details.go b/pkg/models/subscription_details.go
new file mode 100644
index 0000000..69f6121
--- /dev/null
+++ b/pkg/models/subscription_details.go
@@ -0,0 +1,97 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ strfmt "github.com/go-openapi/strfmt"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubscriptionDetails subscription details
+// swagger:model SubscriptionDetails
+type SubscriptionDetails struct {
+
+ // action to be setup list
+ // Required: true
+ ActionToBeSetupList ActionsToBeSetup `json:"ActionToBeSetupList"`
+
+ // event trigger list
+ // Required: true
+ EventTriggerList *EventTriggerDefinition `json:"EventTriggerList"`
+}
+
+// Validate validates this subscription details
+func (m *SubscriptionDetails) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateActionToBeSetupList(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateEventTriggerList(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionDetails) validateActionToBeSetupList(formats strfmt.Registry) error {
+
+ if err := validate.Required("ActionToBeSetupList", "body", m.ActionToBeSetupList); err != nil {
+ return err
+ }
+
+ if err := m.ActionToBeSetupList.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ActionToBeSetupList")
+ }
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionDetails) validateEventTriggerList(formats strfmt.Registry) error {
+
+ if err := validate.Required("EventTriggerList", "body", m.EventTriggerList); err != nil {
+ return err
+ }
+
+ if m.EventTriggerList != nil {
+ if err := m.EventTriggerList.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("EventTriggerList")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionDetails) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionDetails) UnmarshalBinary(b []byte) error {
+ var res SubscriptionDetails
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/models/event_trigger_list.go b/pkg/models/subscription_details_list.go
similarity index 68%
copy from pkg/models/event_trigger_list.go
copy to pkg/models/subscription_details_list.go
index c3c3dbc..c52b06b 100644
--- a/pkg/models/event_trigger_list.go
+++ b/pkg/models/subscription_details_list.go
@@ -8,18 +8,18 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
-// EventTriggerList event trigger list
-// swagger:model EventTriggerList
-type EventTriggerList []*EventTrigger
+// SubscriptionDetailsList subscription details list
+//
+// swagger:model SubscriptionDetailsList
+type SubscriptionDetailsList []*SubscriptionDetail
-// Validate validates this event trigger list
-func (m EventTriggerList) Validate(formats strfmt.Registry) error {
+// Validate validates this subscription details list
+func (m SubscriptionDetailsList) Validate(formats strfmt.Registry) error {
var res []error
for i := 0; i < len(m); i++ {
diff --git a/pkg/models/subscription_instance.go b/pkg/models/subscription_instance.go
index d619166..fa3c3a7 100644
--- a/pkg/models/subscription_instance.go
+++ b/pkg/models/subscription_instance.go
@@ -6,35 +6,47 @@
// Editing this file might prove futile when you re-run the swagger generate command
import (
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SubscriptionInstance subscription instance
+//
// swagger:model SubscriptionInstance
type SubscriptionInstance struct {
- // instance Id
+ // e2 event instance Id
// Required: true
- InstanceID *int64 `json:"InstanceId"`
+ // Maximum: 65535
+ // Minimum: 0
+ E2EventInstanceID *int64 `json:"E2EventInstanceId"`
- // requestor Id
+ // Empty string when no error.
// Required: true
- RequestorID *int64 `json:"RequestorId"`
+ ErrorCause *string `json:"ErrorCause"`
+
+ // xapp event instance Id
+ // Required: true
+ // Maximum: 65535
+ // Minimum: 0
+ XappEventInstanceID *int64 `json:"XappEventInstanceId"`
}
// Validate validates this subscription instance
func (m *SubscriptionInstance) Validate(formats strfmt.Registry) error {
var res []error
- if err := m.validateInstanceID(formats); err != nil {
+ if err := m.validateE2EventInstanceID(formats); err != nil {
res = append(res, err)
}
- if err := m.validateRequestorID(formats); err != nil {
+ if err := m.validateErrorCause(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateXappEventInstanceID(formats); err != nil {
res = append(res, err)
}
@@ -44,18 +56,43 @@
return nil
}
-func (m *SubscriptionInstance) validateInstanceID(formats strfmt.Registry) error {
+func (m *SubscriptionInstance) validateE2EventInstanceID(formats strfmt.Registry) error {
- if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
+ if err := validate.Required("E2EventInstanceId", "body", m.E2EventInstanceID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("E2EventInstanceId", "body", int64(*m.E2EventInstanceID), 65535, false); err != nil {
return err
}
return nil
}
-func (m *SubscriptionInstance) validateRequestorID(formats strfmt.Registry) error {
+func (m *SubscriptionInstance) validateErrorCause(formats strfmt.Registry) error {
- if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
+ if err := validate.Required("ErrorCause", "body", m.ErrorCause); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionInstance) validateXappEventInstanceID(formats strfmt.Registry) error {
+
+ if err := validate.Required("XappEventInstanceId", "body", m.XappEventInstanceID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("XappEventInstanceId", "body", int64(*m.XappEventInstanceID), 65535, false); err != nil {
return err
}
diff --git a/pkg/models/subscription_list.go b/pkg/models/subscription_list.go
index 5059e21..b622142 100644
--- a/pkg/models/subscription_list.go
+++ b/pkg/models/subscription_list.go
@@ -8,13 +8,13 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// SubscriptionList A list of subscriptions
+//
// swagger:model SubscriptionList
type SubscriptionList []*SubscriptionData
diff --git a/pkg/models/subscription_params.go b/pkg/models/subscription_params.go
new file mode 100644
index 0000000..5616e98
--- /dev/null
+++ b/pkg/models/subscription_params.go
@@ -0,0 +1,233 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubscriptionParams subscription params
+//
+// swagger:model SubscriptionParams
+type SubscriptionParams struct {
+
+ // client endpoint
+ // Required: true
+ ClientEndpoint *SubscriptionParamsClientEndpoint `json:"ClientEndpoint"`
+
+ // meid
+ // Required: true
+ Meid *string `json:"Meid"`
+
+ // r a n function ID
+ // Required: true
+ // Maximum: 4095
+ // Minimum: 0
+ RANFunctionID *int64 `json:"RANFunctionID"`
+
+ // subscription details
+ // Required: true
+ SubscriptionDetails SubscriptionDetailsList `json:"SubscriptionDetails"`
+
+ // Optional subscription ID (Submgr allocates if not given)
+ SubscriptionID string `json:"SubscriptionId,omitempty"`
+}
+
+// Validate validates this subscription params
+func (m *SubscriptionParams) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateClientEndpoint(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateMeid(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRANFunctionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateSubscriptionDetails(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionParams) validateClientEndpoint(formats strfmt.Registry) error {
+
+ if err := validate.Required("ClientEndpoint", "body", m.ClientEndpoint); err != nil {
+ return err
+ }
+
+ if m.ClientEndpoint != nil {
+ if err := m.ClientEndpoint.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("ClientEndpoint")
+ }
+ return err
+ }
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParams) validateMeid(formats strfmt.Registry) error {
+
+ if err := validate.Required("Meid", "body", m.Meid); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParams) validateRANFunctionID(formats strfmt.Registry) error {
+
+ if err := validate.Required("RANFunctionID", "body", m.RANFunctionID); err != nil {
+ return err
+ }
+
+ if err := validate.MinimumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("RANFunctionID", "body", int64(*m.RANFunctionID), 4095, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParams) validateSubscriptionDetails(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubscriptionDetails", "body", m.SubscriptionDetails); err != nil {
+ return err
+ }
+
+ if err := m.SubscriptionDetails.Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName("SubscriptionDetails")
+ }
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionParams) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionParams) UnmarshalBinary(b []byte) error {
+ var res SubscriptionParams
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
+
+// SubscriptionParamsClientEndpoint xApp service address and port
+//
+// swagger:model SubscriptionParamsClientEndpoint
+type SubscriptionParamsClientEndpoint struct {
+
+ // xApp HTTP service address port
+ // Maximum: 65535
+ // Minimum: 0
+ HTTPPort *int64 `json:"HTTPPort,omitempty"`
+
+ // xApp service address name like 'service-ricxapp-xappname-http.ricxapp'
+ Host string `json:"Host,omitempty"`
+
+ // xApp RMR service address port
+ // Maximum: 65535
+ // Minimum: 0
+ RMRPort *int64 `json:"RMRPort,omitempty"`
+}
+
+// Validate validates this subscription params client endpoint
+func (m *SubscriptionParamsClientEndpoint) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateHTTPPort(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateRMRPort(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+func (m *SubscriptionParamsClientEndpoint) validateHTTPPort(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.HTTPPort) { // not required
+ return nil
+ }
+
+ if err := validate.MinimumInt("ClientEndpoint"+"."+"HTTPPort", "body", int64(*m.HTTPPort), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("ClientEndpoint"+"."+"HTTPPort", "body", int64(*m.HTTPPort), 65535, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+func (m *SubscriptionParamsClientEndpoint) validateRMRPort(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.RMRPort) { // not required
+ return nil
+ }
+
+ if err := validate.MinimumInt("ClientEndpoint"+"."+"RMRPort", "body", int64(*m.RMRPort), 0, false); err != nil {
+ return err
+ }
+
+ if err := validate.MaximumInt("ClientEndpoint"+"."+"RMRPort", "body", int64(*m.RMRPort), 65535, false); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubscriptionParamsClientEndpoint) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubscriptionParamsClientEndpoint) UnmarshalBinary(b []byte) error {
+ var res SubscriptionParamsClientEndpoint
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/models/subscription_response.go b/pkg/models/subscription_response.go
index c62b4f1..97c937e 100644
--- a/pkg/models/subscription_response.go
+++ b/pkg/models/subscription_response.go
@@ -8,14 +8,14 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// SubscriptionResponse subscription response
+//
// swagger:model SubscriptionResponse
type SubscriptionResponse struct {
diff --git a/pkg/models/subscription_response_item.go b/pkg/models/subscription_response_item.go
deleted file mode 100644
index 2bed019..0000000
--- a/pkg/models/subscription_response_item.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/swag"
- "github.com/go-openapi/validate"
-)
-
-// SubscriptionResponseItem subscription response item
-// swagger:model SubscriptionResponseItem
-type SubscriptionResponseItem struct {
-
- // instance Id
- // Required: true
- InstanceID *int64 `json:"InstanceId"`
-
- // requestor Id
- // Required: true
- RequestorID *int64 `json:"RequestorId"`
-
- // subscription Id
- // Required: true
- SubscriptionID *string `json:"SubscriptionId"`
-}
-
-// Validate validates this subscription response item
-func (m *SubscriptionResponseItem) Validate(formats strfmt.Registry) error {
- var res []error
-
- if err := m.validateInstanceID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateRequestorID(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateSubscriptionID(formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
-
-func (m *SubscriptionResponseItem) validateInstanceID(formats strfmt.Registry) error {
-
- if err := validate.Required("InstanceId", "body", m.InstanceID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SubscriptionResponseItem) validateRequestorID(formats strfmt.Registry) error {
-
- if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
- return err
- }
-
- return nil
-}
-
-func (m *SubscriptionResponseItem) validateSubscriptionID(formats strfmt.Registry) error {
-
- if err := validate.Required("SubscriptionId", "body", m.SubscriptionID); err != nil {
- return err
- }
-
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *SubscriptionResponseItem) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *SubscriptionResponseItem) UnmarshalBinary(b []byte) error {
- var res SubscriptionResponseItem
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
diff --git a/pkg/models/subscription_type.go b/pkg/models/subscription_type.go
deleted file mode 100644
index c7dd86e..0000000
--- a/pkg/models/subscription_type.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package models
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "encoding/json"
-
- strfmt "github.com/go-openapi/strfmt"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/validate"
-)
-
-// SubscriptionType subscription type
-// swagger:model SubscriptionType
-type SubscriptionType string
-
-const (
-
- // SubscriptionTypeInsert captures enum value "insert"
- SubscriptionTypeInsert SubscriptionType = "insert"
-
- // SubscriptionTypePolicy captures enum value "policy"
- SubscriptionTypePolicy SubscriptionType = "policy"
-
- // SubscriptionTypeReport captures enum value "report"
- SubscriptionTypeReport SubscriptionType = "report"
-)
-
-// for schema
-var subscriptionTypeEnum []interface{}
-
-func init() {
- var res []SubscriptionType
- if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
- panic(err)
- }
- for _, v := range res {
- subscriptionTypeEnum = append(subscriptionTypeEnum, v)
- }
-}
-
-func (m SubscriptionType) validateSubscriptionTypeEnum(path, location string, value SubscriptionType) error {
- if err := validate.Enum(path, location, value, subscriptionTypeEnum); err != nil {
- return err
- }
- return nil
-}
-
-// Validate validates this subscription type
-func (m SubscriptionType) Validate(formats strfmt.Registry) error {
- var res []error
-
- // value enum
- if err := m.validateSubscriptionTypeEnum("", "body", m); err != nil {
- return err
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
diff --git a/pkg/models/subsequent_action.go b/pkg/models/subsequent_action.go
new file mode 100644
index 0000000..694725e
--- /dev/null
+++ b/pkg/models/subsequent_action.go
@@ -0,0 +1,201 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package models
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "encoding/json"
+
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/swag"
+ "github.com/go-openapi/validate"
+)
+
+// SubsequentAction SubsequentAction is an OPTIONAL IE
+//
+// swagger:model SubsequentAction
+type SubsequentAction struct {
+
+ // subsequent action type
+ // Required: true
+ // Enum: [continue wait]
+ SubsequentActionType *string `json:"SubsequentActionType"`
+
+ // time to wait
+ // Required: true
+ // Enum: [zero w1ms w2ms w5ms w10ms w20ms w30ms w40ms w50ms w100ms w200ms w500ms w1s w2s w5s w10s w20s w60s]
+ TimeToWait *string `json:"TimeToWait"`
+}
+
+// Validate validates this subsequent action
+func (m *SubsequentAction) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ if err := m.validateSubsequentActionType(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateTimeToWait(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
+
+var subsequentActionTypeSubsequentActionTypePropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["continue","wait"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ subsequentActionTypeSubsequentActionTypePropEnum = append(subsequentActionTypeSubsequentActionTypePropEnum, v)
+ }
+}
+
+const (
+
+ // SubsequentActionSubsequentActionTypeContinue captures enum value "continue"
+ SubsequentActionSubsequentActionTypeContinue string = "continue"
+
+ // SubsequentActionSubsequentActionTypeWait captures enum value "wait"
+ SubsequentActionSubsequentActionTypeWait string = "wait"
+)
+
+// prop value enum
+func (m *SubsequentAction) validateSubsequentActionTypeEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, subsequentActionTypeSubsequentActionTypePropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *SubsequentAction) validateSubsequentActionType(formats strfmt.Registry) error {
+
+ if err := validate.Required("SubsequentActionType", "body", m.SubsequentActionType); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateSubsequentActionTypeEnum("SubsequentActionType", "body", *m.SubsequentActionType); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+var subsequentActionTypeTimeToWaitPropEnum []interface{}
+
+func init() {
+ var res []string
+ if err := json.Unmarshal([]byte(`["zero","w1ms","w2ms","w5ms","w10ms","w20ms","w30ms","w40ms","w50ms","w100ms","w200ms","w500ms","w1s","w2s","w5s","w10s","w20s","w60s"]`), &res); err != nil {
+ panic(err)
+ }
+ for _, v := range res {
+ subsequentActionTypeTimeToWaitPropEnum = append(subsequentActionTypeTimeToWaitPropEnum, v)
+ }
+}
+
+const (
+
+ // SubsequentActionTimeToWaitZero captures enum value "zero"
+ SubsequentActionTimeToWaitZero string = "zero"
+
+ // SubsequentActionTimeToWaitW1ms captures enum value "w1ms"
+ SubsequentActionTimeToWaitW1ms string = "w1ms"
+
+ // SubsequentActionTimeToWaitW2ms captures enum value "w2ms"
+ SubsequentActionTimeToWaitW2ms string = "w2ms"
+
+ // SubsequentActionTimeToWaitW5ms captures enum value "w5ms"
+ SubsequentActionTimeToWaitW5ms string = "w5ms"
+
+ // SubsequentActionTimeToWaitW10ms captures enum value "w10ms"
+ SubsequentActionTimeToWaitW10ms string = "w10ms"
+
+ // SubsequentActionTimeToWaitW20ms captures enum value "w20ms"
+ SubsequentActionTimeToWaitW20ms string = "w20ms"
+
+ // SubsequentActionTimeToWaitW30ms captures enum value "w30ms"
+ SubsequentActionTimeToWaitW30ms string = "w30ms"
+
+ // SubsequentActionTimeToWaitW40ms captures enum value "w40ms"
+ SubsequentActionTimeToWaitW40ms string = "w40ms"
+
+ // SubsequentActionTimeToWaitW50ms captures enum value "w50ms"
+ SubsequentActionTimeToWaitW50ms string = "w50ms"
+
+ // SubsequentActionTimeToWaitW100ms captures enum value "w100ms"
+ SubsequentActionTimeToWaitW100ms string = "w100ms"
+
+ // SubsequentActionTimeToWaitW200ms captures enum value "w200ms"
+ SubsequentActionTimeToWaitW200ms string = "w200ms"
+
+ // SubsequentActionTimeToWaitW500ms captures enum value "w500ms"
+ SubsequentActionTimeToWaitW500ms string = "w500ms"
+
+ // SubsequentActionTimeToWaitW1s captures enum value "w1s"
+ SubsequentActionTimeToWaitW1s string = "w1s"
+
+ // SubsequentActionTimeToWaitW2s captures enum value "w2s"
+ SubsequentActionTimeToWaitW2s string = "w2s"
+
+ // SubsequentActionTimeToWaitW5s captures enum value "w5s"
+ SubsequentActionTimeToWaitW5s string = "w5s"
+
+ // SubsequentActionTimeToWaitW10s captures enum value "w10s"
+ SubsequentActionTimeToWaitW10s string = "w10s"
+
+ // SubsequentActionTimeToWaitW20s captures enum value "w20s"
+ SubsequentActionTimeToWaitW20s string = "w20s"
+
+ // SubsequentActionTimeToWaitW60s captures enum value "w60s"
+ SubsequentActionTimeToWaitW60s string = "w60s"
+)
+
+// prop value enum
+func (m *SubsequentAction) validateTimeToWaitEnum(path, location string, value string) error {
+ if err := validate.Enum(path, location, value, subsequentActionTypeTimeToWaitPropEnum); err != nil {
+ return err
+ }
+ return nil
+}
+
+func (m *SubsequentAction) validateTimeToWait(formats strfmt.Registry) error {
+
+ if err := validate.Required("TimeToWait", "body", m.TimeToWait); err != nil {
+ return err
+ }
+
+ // value enum
+ if err := m.validateTimeToWaitEnum("TimeToWait", "body", *m.TimeToWait); err != nil {
+ return err
+ }
+
+ return nil
+}
+
+// MarshalBinary interface implementation
+func (m *SubsequentAction) MarshalBinary() ([]byte, error) {
+ if m == nil {
+ return nil, nil
+ }
+ return swag.WriteJSON(m)
+}
+
+// UnmarshalBinary interface implementation
+func (m *SubsequentAction) UnmarshalBinary(b []byte) error {
+ var res SubsequentAction
+ if err := swag.ReadJSON(b, &res); err != nil {
+ return err
+ }
+ *m = res
+ return nil
+}
diff --git a/pkg/models/x_app_config.go b/pkg/models/x_app_config.go
index 076e314..f1ec552 100644
--- a/pkg/models/x_app_config.go
+++ b/pkg/models/x_app_config.go
@@ -6,14 +6,14 @@
// Editing this file might prove futile when you re-run the swagger generate command
import (
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"github.com/go-openapi/validate"
)
// XAppConfig x app config
+//
// swagger:model XAppConfig
type XAppConfig struct {
diff --git a/pkg/models/xapp_config_list.go b/pkg/models/xapp_config_list.go
index e57ed02..050538b 100644
--- a/pkg/models/xapp_config_list.go
+++ b/pkg/models/xapp_config_list.go
@@ -8,13 +8,13 @@
import (
"strconv"
- strfmt "github.com/go-openapi/strfmt"
-
"github.com/go-openapi/errors"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
)
// XappConfigList xapp config list
+//
// swagger:model XappConfigList
type XappConfigList []*XAppConfig
diff --git a/pkg/restapi/configure_xapp_framework.go b/pkg/restapi/configure_xapp_framework.go
index 89e112d..e185b0c 100644
--- a/pkg/restapi/configure_xapp_framework.go
+++ b/pkg/restapi/configure_xapp_framework.go
@@ -12,9 +12,7 @@
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/common"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/policy"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/query"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/report"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/xapp"
)
//go:generate swagger generate server --target ../../pkg --name XappFramework --spec ../../api/xapp_rest_api.yaml --exclude-main
@@ -37,24 +35,26 @@
api.JSONProducer = runtime.JSONProducer()
+ api.XMLProducer = runtime.XMLProducer()
+
+ if api.CommonSubscribeHandler == nil {
+ api.CommonSubscribeHandler = common.SubscribeHandlerFunc(func(params common.SubscribeParams) middleware.Responder {
+ return middleware.NotImplemented("operation common.Subscribe has not yet been implemented")
+ })
+ }
if api.CommonUnsubscribeHandler == nil {
api.CommonUnsubscribeHandler = common.UnsubscribeHandlerFunc(func(params common.UnsubscribeParams) middleware.Responder {
return middleware.NotImplemented("operation common.Unsubscribe has not yet been implemented")
})
}
- if api.QueryGetAllSubscriptionsHandler == nil {
- api.QueryGetAllSubscriptionsHandler = query.GetAllSubscriptionsHandlerFunc(func(params query.GetAllSubscriptionsParams) middleware.Responder {
- return middleware.NotImplemented("operation query.GetAllSubscriptions has not yet been implemented")
+ if api.CommonGetAllSubscriptionsHandler == nil {
+ api.CommonGetAllSubscriptionsHandler = common.GetAllSubscriptionsHandlerFunc(func(params common.GetAllSubscriptionsParams) middleware.Responder {
+ return middleware.NotImplemented("operation common.GetAllSubscriptions has not yet been implemented")
})
}
- if api.PolicySubscribePolicyHandler == nil {
- api.PolicySubscribePolicyHandler = policy.SubscribePolicyHandlerFunc(func(params policy.SubscribePolicyParams) middleware.Responder {
- return middleware.NotImplemented("operation policy.SubscribePolicy has not yet been implemented")
- })
- }
- if api.ReportSubscribeReportHandler == nil {
- api.ReportSubscribeReportHandler = report.SubscribeReportHandlerFunc(func(params report.SubscribeReportParams) middleware.Responder {
- return middleware.NotImplemented("operation report.SubscribeReport has not yet been implemented")
+ if api.XappGetXappConfigListHandler == nil {
+ api.XappGetXappConfigListHandler = xapp.GetXappConfigListHandlerFunc(func(params xapp.GetXappConfigListParams) middleware.Responder {
+ return middleware.NotImplemented("operation xapp.GetXappConfigList has not yet been implemented")
})
}
diff --git a/pkg/restapi/doc.go b/pkg/restapi/doc.go
index c73c1aa..62cc84a 100644
--- a/pkg/restapi/doc.go
+++ b/pkg/restapi/doc.go
@@ -1,24 +1,21 @@
// Code generated by go-swagger; DO NOT EDIT.
-/*
-Package restapi RIC subscription
-This is the initial REST API for RIC subscription
-
-
- Schemes:
- http
- Host: hostname
- BasePath: /ric/v1
- Version: 0.0.1
- License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html
-
- Consumes:
- - application/json
-
- Produces:
- - application/json
- - application/xml
-
-swagger:meta
-*/
+// Package restapi RIC subscription
+//
+// This is the initial REST API for RIC subscription
+// Schemes:
+// http
+// Host: hostname
+// BasePath: /ric/v1
+// Version: 0.0.2
+// License: Apache 2.0 http://www.apache.org/licenses/LICENSE-2.0.html
+//
+// Consumes:
+// - application/json
+//
+// Produces:
+// - application/json
+// - application/xml
+//
+// swagger:meta
package restapi
diff --git a/pkg/restapi/embedded_spec.go b/pkg/restapi/embedded_spec.go
index dd67843..4506519 100644
--- a/pkg/restapi/embedded_spec.go
+++ b/pkg/restapi/embedded_spec.go
@@ -29,7 +29,7 @@
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
- "version": "0.0.1"
+ "version": "0.0.2"
},
"host": "hostname",
"basePath": "/ric/v1",
@@ -64,7 +64,7 @@
"application/json"
],
"tags": [
- "query"
+ "common"
],
"summary": "Returns list of subscriptions",
"operationId": "getAllSubscriptions",
@@ -79,9 +79,7 @@
"description": "Internal error"
}
}
- }
- },
- "/subscriptions/policy": {
+ },
"post": {
"consumes": [
"application/json"
@@ -90,56 +88,17 @@
"application/json"
],
"tags": [
- "policy"
+ "common"
],
- "summary": "Subscribe and send \"POLICY\" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION",
- "operationId": "subscribePolicy",
+ "summary": "Subscribe a list of X2AP event triggers to receive messages sent by RAN",
+ "operationId": "Subscribe",
"parameters": [
{
- "description": "Subscription policy parameters",
- "name": "PolicyParams",
+ "description": "Subscription parameters",
+ "name": "SubscriptionParams",
"in": "body",
"schema": {
- "$ref": "#/definitions/PolicyParams"
- }
- }
- ],
- "responses": {
- "201": {
- "description": "Subscription successfully created",
- "schema": {
- "$ref": "#/definitions/SubscriptionResponse"
- }
- },
- "400": {
- "description": "Invalid input"
- },
- "500": {
- "description": "Internal error"
- }
- }
- }
- },
- "/subscriptions/report": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "report"
- ],
- "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN",
- "operationId": "subscribeReport",
- "parameters": [
- {
- "description": "Subscription report parameters",
- "name": "ReportParams",
- "in": "body",
- "schema": {
- "$ref": "#/definitions/ReportParams"
+ "$ref": "#/definitions/SubscriptionParams"
}
}
],
@@ -196,21 +155,46 @@
}
},
"definitions": {
- "ActionParameters": {
+ "ActionDefinition": {
+ "description": "E2SM byte array. ActionDefinition is an OPTIONAL IE",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "ActionToBeSetup": {
"type": "object",
"required": [
- "ActionParameterID",
- "ActionParameterValue"
+ "ActionID",
+ "ActionType"
],
"properties": {
- "ActionParameterID": {
- "type": "integer"
+ "ActionDefinition": {
+ "$ref": "#/definitions/ActionDefinition"
},
- "ActionParameterValue": {
- "type": "boolean"
+ "ActionID": {
+ "type": "integer",
+ "maximum": 255
+ },
+ "ActionType": {
+ "type": "string",
+ "enum": [
+ "insert",
+ "policy",
+ "report"
+ ]
+ },
+ "SubsequentAction": {
+ "$ref": "#/definitions/SubsequentAction"
}
}
},
+ "ActionsToBeSetup": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionToBeSetup"
+ }
+ },
"ConfigMetadata": {
"type": "object",
"required": [
@@ -233,202 +217,17 @@
}
}
},
- "EventTrigger": {
- "type": "object",
- "properties": {
- "ENBId": {
- "type": "string"
- },
- "InterfaceDirection": {
- "type": "integer"
- },
- "PlmnId": {
- "type": "string"
- },
- "ProcedureCode": {
- "type": "integer"
- },
- "TriggerNature": {
- "type": "string",
- "enum": [
- "now",
- "on change"
- ]
- },
- "TypeOfMessage": {
- "type": "integer"
- }
- }
- },
- "EventTriggerList": {
+ "EventTriggerDefinition": {
+ "description": "E2SM byte array",
"type": "array",
"items": {
- "$ref": "#/definitions/EventTrigger"
- }
- },
- "Format1ActionDefinition": {
- "type": "object",
- "required": [
- "StyleID",
- "ActionParameters"
- ],
- "properties": {
- "ActionParameters": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/ActionParameters"
- }
- },
- "StyleID": {
- "type": "integer"
- }
- }
- },
- "Format2ActionDefinition": {
- "type": "object",
- "required": [
- "RANUeGroupParameters"
- ],
- "properties": {
- "RANUeGroupParameters": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/RANUeGroupList"
- }
- }
- }
- },
- "ImperativePolicyDefinition": {
- "type": "object",
- "required": [
- "PolicyParameterID",
- "PolicyParameterValue"
- ],
- "properties": {
- "PolicyParameterID": {
- "type": "integer"
- },
- "PolicyParameterValue": {
- "type": "integer"
- }
- }
- },
- "PolicyActionDefinition": {
- "type": "object",
- "properties": {
- "ActionDefinitionFormat2": {
- "$ref": "#/definitions/Format2ActionDefinition"
- }
- }
- },
- "PolicyParams": {
- "type": "object",
- "required": [
- "Meid",
- "RANFunctionID",
- "ClientEndpoint",
- "EventTriggers",
- "PolicyActionDefinitions"
- ],
- "properties": {
- "ClientEndpoint": {
- "type": "string"
- },
- "EventTriggers": {
- "$ref": "#/definitions/EventTriggerList"
- },
- "Meid": {
- "type": "string"
- },
- "PolicyActionDefinitions": {
- "$ref": "#/definitions/PolicyActionDefinition"
- },
- "RANFunctionID": {
- "type": "integer"
- }
- }
- },
- "RANUeGroupList": {
- "type": "object",
- "required": [
- "RANUeGroupID",
- "RANUeGroupDefinition",
- "RANImperativePolicy"
- ],
- "properties": {
- "RANImperativePolicy": {
- "$ref": "#/definitions/ImperativePolicyDefinition"
- },
- "RANUeGroupDefinition": {
- "$ref": "#/definitions/RANUeGroupParams"
- },
- "RANUeGroupID": {
- "type": "integer"
- }
- }
- },
- "RANUeGroupParams": {
- "type": "object",
- "required": [
- "RANParameterID",
- "RANParameterValue"
- ],
- "properties": {
- "RANParameterID": {
- "type": "integer"
- },
- "RANParameterTestCondition": {
- "type": "string",
- "enum": [
- "equal",
- "greaterthan",
- "lessthan",
- "contains",
- "present"
- ]
- },
- "RANParameterValue": {
- "type": "integer"
- }
- }
- },
- "ReportActionDefinition": {
- "type": "object",
- "properties": {
- "ActionDefinitionFormat1": {
- "$ref": "#/definitions/Format1ActionDefinition"
- }
- }
- },
- "ReportParams": {
- "type": "object",
- "required": [
- "RANFunctionID",
- "ClientEndpoint",
- "EventTriggers"
- ],
- "properties": {
- "ClientEndpoint": {
- "type": "string"
- },
- "EventTriggers": {
- "$ref": "#/definitions/EventTriggerList"
- },
- "Meid": {
- "type": "string"
- },
- "RANFunctionID": {
- "type": "integer"
- },
- "ReportActionDefinitions": {
- "$ref": "#/definitions/ReportActionDefinition"
- }
+ "type": "integer"
}
},
"SubscriptionData": {
"type": "object",
"properties": {
- "Endpoint": {
+ "ClientEndpoint": {
"type": "array",
"items": {
"type": "string"
@@ -439,21 +238,60 @@
},
"SubscriptionId": {
"type": "integer"
+ },
+ "SubscriptionInstances": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/SubscriptionInstance"
+ }
}
}
},
+ "SubscriptionDetail": {
+ "type": "object",
+ "required": [
+ "XappEventInstanceId",
+ "EventTriggers",
+ "ActionToBeSetupList"
+ ],
+ "properties": {
+ "ActionToBeSetupList": {
+ "$ref": "#/definitions/ActionsToBeSetup"
+ },
+ "EventTriggers": {
+ "$ref": "#/definitions/EventTriggerDefinition"
+ },
+ "XappEventInstanceId": {
+ "type": "integer",
+ "maximum": 65535
+ }
+ }
+ },
+ "SubscriptionDetailsList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/SubscriptionDetail"
+ }
+ },
"SubscriptionInstance": {
"type": "object",
"required": [
- "RequestorId",
- "InstanceId"
+ "XappEventInstanceId",
+ "E2EventInstanceId",
+ "ErrorCause"
],
"properties": {
- "InstanceId": {
- "type": "integer"
+ "E2EventInstanceId": {
+ "type": "integer",
+ "maximum": 65535
},
- "RequestorId": {
- "type": "integer"
+ "ErrorCause": {
+ "description": "Empty string when no error.",
+ "type": "string"
+ },
+ "XappEventInstanceId": {
+ "type": "integer",
+ "maximum": 65535
}
}
},
@@ -464,6 +302,51 @@
"$ref": "#/definitions/SubscriptionData"
}
},
+ "SubscriptionParams": {
+ "type": "object",
+ "required": [
+ "ClientEndpoint",
+ "Meid",
+ "RANFunctionID",
+ "SubscriptionDetails"
+ ],
+ "properties": {
+ "ClientEndpoint": {
+ "description": "xApp service address and port",
+ "type": "object",
+ "properties": {
+ "HTTPPort": {
+ "description": "xApp HTTP service address port",
+ "type": "integer",
+ "maximum": 65535
+ },
+ "Host": {
+ "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'",
+ "type": "string"
+ },
+ "RMRPort": {
+ "description": "xApp RMR service address port",
+ "type": "integer",
+ "maximum": 65535
+ }
+ }
+ },
+ "Meid": {
+ "type": "string"
+ },
+ "RANFunctionID": {
+ "type": "integer",
+ "maximum": 4095
+ },
+ "SubscriptionDetails": {
+ "$ref": "#/definitions/SubscriptionDetailsList"
+ },
+ "SubscriptionId": {
+ "description": "Optional subscription ID (Submgr allocates if not given)",
+ "type": "string"
+ }
+ }
+ },
"SubscriptionResponse": {
"type": "object",
"required": [
@@ -482,13 +365,45 @@
}
}
},
- "SubscriptionType": {
- "type": "string",
- "enum": [
- "insert",
- "policy",
- "report"
- ]
+ "SubsequentAction": {
+ "description": "SubsequentAction is an OPTIONAL IE",
+ "type": "object",
+ "required": [
+ "SubsequentActionType",
+ "TimeToWait"
+ ],
+ "properties": {
+ "SubsequentActionType": {
+ "type": "string",
+ "enum": [
+ "continue",
+ "wait"
+ ]
+ },
+ "TimeToWait": {
+ "type": "string",
+ "enum": [
+ "zero",
+ "w1ms",
+ "w2ms",
+ "w5ms",
+ "w10ms",
+ "w20ms",
+ "w30ms",
+ "w40ms",
+ "w50ms",
+ "w100ms",
+ "w200ms",
+ "w500ms",
+ "w1s",
+ "w2s",
+ "w5s",
+ "w10s",
+ "w20s",
+ "w60s"
+ ]
+ }
+ }
},
"XAppConfig": {
"type": "object",
@@ -526,7 +441,7 @@
"name": "Apache 2.0",
"url": "http://www.apache.org/licenses/LICENSE-2.0.html"
},
- "version": "0.0.1"
+ "version": "0.0.2"
},
"host": "hostname",
"basePath": "/ric/v1",
@@ -561,7 +476,7 @@
"application/json"
],
"tags": [
- "query"
+ "common"
],
"summary": "Returns list of subscriptions",
"operationId": "getAllSubscriptions",
@@ -576,9 +491,7 @@
"description": "Internal error"
}
}
- }
- },
- "/subscriptions/policy": {
+ },
"post": {
"consumes": [
"application/json"
@@ -587,56 +500,17 @@
"application/json"
],
"tags": [
- "policy"
+ "common"
],
- "summary": "Subscribe and send \"POLICY\" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION",
- "operationId": "subscribePolicy",
+ "summary": "Subscribe a list of X2AP event triggers to receive messages sent by RAN",
+ "operationId": "Subscribe",
"parameters": [
{
- "description": "Subscription policy parameters",
- "name": "PolicyParams",
+ "description": "Subscription parameters",
+ "name": "SubscriptionParams",
"in": "body",
"schema": {
- "$ref": "#/definitions/PolicyParams"
- }
- }
- ],
- "responses": {
- "201": {
- "description": "Subscription successfully created",
- "schema": {
- "$ref": "#/definitions/SubscriptionResponse"
- }
- },
- "400": {
- "description": "Invalid input"
- },
- "500": {
- "description": "Internal error"
- }
- }
- }
- },
- "/subscriptions/report": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "report"
- ],
- "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN",
- "operationId": "subscribeReport",
- "parameters": [
- {
- "description": "Subscription report parameters",
- "name": "ReportParams",
- "in": "body",
- "schema": {
- "$ref": "#/definitions/ReportParams"
+ "$ref": "#/definitions/SubscriptionParams"
}
}
],
@@ -693,21 +567,47 @@
}
},
"definitions": {
- "ActionParameters": {
+ "ActionDefinition": {
+ "description": "E2SM byte array. ActionDefinition is an OPTIONAL IE",
+ "type": "array",
+ "items": {
+ "type": "integer"
+ }
+ },
+ "ActionToBeSetup": {
"type": "object",
"required": [
- "ActionParameterID",
- "ActionParameterValue"
+ "ActionID",
+ "ActionType"
],
"properties": {
- "ActionParameterID": {
- "type": "integer"
+ "ActionDefinition": {
+ "$ref": "#/definitions/ActionDefinition"
},
- "ActionParameterValue": {
- "type": "boolean"
+ "ActionID": {
+ "type": "integer",
+ "maximum": 255,
+ "minimum": 0
+ },
+ "ActionType": {
+ "type": "string",
+ "enum": [
+ "insert",
+ "policy",
+ "report"
+ ]
+ },
+ "SubsequentAction": {
+ "$ref": "#/definitions/SubsequentAction"
}
}
},
+ "ActionsToBeSetup": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/ActionToBeSetup"
+ }
+ },
"ConfigMetadata": {
"type": "object",
"required": [
@@ -730,202 +630,17 @@
}
}
},
- "EventTrigger": {
- "type": "object",
- "properties": {
- "ENBId": {
- "type": "string"
- },
- "InterfaceDirection": {
- "type": "integer"
- },
- "PlmnId": {
- "type": "string"
- },
- "ProcedureCode": {
- "type": "integer"
- },
- "TriggerNature": {
- "type": "string",
- "enum": [
- "now",
- "on change"
- ]
- },
- "TypeOfMessage": {
- "type": "integer"
- }
- }
- },
- "EventTriggerList": {
+ "EventTriggerDefinition": {
+ "description": "E2SM byte array",
"type": "array",
"items": {
- "$ref": "#/definitions/EventTrigger"
- }
- },
- "Format1ActionDefinition": {
- "type": "object",
- "required": [
- "StyleID",
- "ActionParameters"
- ],
- "properties": {
- "ActionParameters": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/ActionParameters"
- }
- },
- "StyleID": {
- "type": "integer"
- }
- }
- },
- "Format2ActionDefinition": {
- "type": "object",
- "required": [
- "RANUeGroupParameters"
- ],
- "properties": {
- "RANUeGroupParameters": {
- "type": "array",
- "items": {
- "$ref": "#/definitions/RANUeGroupList"
- }
- }
- }
- },
- "ImperativePolicyDefinition": {
- "type": "object",
- "required": [
- "PolicyParameterID",
- "PolicyParameterValue"
- ],
- "properties": {
- "PolicyParameterID": {
- "type": "integer"
- },
- "PolicyParameterValue": {
- "type": "integer"
- }
- }
- },
- "PolicyActionDefinition": {
- "type": "object",
- "properties": {
- "ActionDefinitionFormat2": {
- "$ref": "#/definitions/Format2ActionDefinition"
- }
- }
- },
- "PolicyParams": {
- "type": "object",
- "required": [
- "Meid",
- "RANFunctionID",
- "ClientEndpoint",
- "EventTriggers",
- "PolicyActionDefinitions"
- ],
- "properties": {
- "ClientEndpoint": {
- "type": "string"
- },
- "EventTriggers": {
- "$ref": "#/definitions/EventTriggerList"
- },
- "Meid": {
- "type": "string"
- },
- "PolicyActionDefinitions": {
- "$ref": "#/definitions/PolicyActionDefinition"
- },
- "RANFunctionID": {
- "type": "integer"
- }
- }
- },
- "RANUeGroupList": {
- "type": "object",
- "required": [
- "RANUeGroupID",
- "RANUeGroupDefinition",
- "RANImperativePolicy"
- ],
- "properties": {
- "RANImperativePolicy": {
- "$ref": "#/definitions/ImperativePolicyDefinition"
- },
- "RANUeGroupDefinition": {
- "$ref": "#/definitions/RANUeGroupParams"
- },
- "RANUeGroupID": {
- "type": "integer"
- }
- }
- },
- "RANUeGroupParams": {
- "type": "object",
- "required": [
- "RANParameterID",
- "RANParameterValue"
- ],
- "properties": {
- "RANParameterID": {
- "type": "integer"
- },
- "RANParameterTestCondition": {
- "type": "string",
- "enum": [
- "equal",
- "greaterthan",
- "lessthan",
- "contains",
- "present"
- ]
- },
- "RANParameterValue": {
- "type": "integer"
- }
- }
- },
- "ReportActionDefinition": {
- "type": "object",
- "properties": {
- "ActionDefinitionFormat1": {
- "$ref": "#/definitions/Format1ActionDefinition"
- }
- }
- },
- "ReportParams": {
- "type": "object",
- "required": [
- "RANFunctionID",
- "ClientEndpoint",
- "EventTriggers"
- ],
- "properties": {
- "ClientEndpoint": {
- "type": "string"
- },
- "EventTriggers": {
- "$ref": "#/definitions/EventTriggerList"
- },
- "Meid": {
- "type": "string"
- },
- "RANFunctionID": {
- "type": "integer"
- },
- "ReportActionDefinitions": {
- "$ref": "#/definitions/ReportActionDefinition"
- }
+ "type": "integer"
}
},
"SubscriptionData": {
"type": "object",
"properties": {
- "Endpoint": {
+ "ClientEndpoint": {
"type": "array",
"items": {
"type": "string"
@@ -936,21 +651,63 @@
},
"SubscriptionId": {
"type": "integer"
+ },
+ "SubscriptionInstances": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/SubscriptionInstance"
+ }
}
}
},
+ "SubscriptionDetail": {
+ "type": "object",
+ "required": [
+ "XappEventInstanceId",
+ "EventTriggers",
+ "ActionToBeSetupList"
+ ],
+ "properties": {
+ "ActionToBeSetupList": {
+ "$ref": "#/definitions/ActionsToBeSetup"
+ },
+ "EventTriggers": {
+ "$ref": "#/definitions/EventTriggerDefinition"
+ },
+ "XappEventInstanceId": {
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
+ }
+ }
+ },
+ "SubscriptionDetailsList": {
+ "type": "array",
+ "items": {
+ "$ref": "#/definitions/SubscriptionDetail"
+ }
+ },
"SubscriptionInstance": {
"type": "object",
"required": [
- "RequestorId",
- "InstanceId"
+ "XappEventInstanceId",
+ "E2EventInstanceId",
+ "ErrorCause"
],
"properties": {
- "InstanceId": {
- "type": "integer"
+ "E2EventInstanceId": {
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
},
- "RequestorId": {
- "type": "integer"
+ "ErrorCause": {
+ "description": "Empty string when no error.",
+ "type": "string"
+ },
+ "XappEventInstanceId": {
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
}
}
},
@@ -961,6 +718,76 @@
"$ref": "#/definitions/SubscriptionData"
}
},
+ "SubscriptionParams": {
+ "type": "object",
+ "required": [
+ "ClientEndpoint",
+ "Meid",
+ "RANFunctionID",
+ "SubscriptionDetails"
+ ],
+ "properties": {
+ "ClientEndpoint": {
+ "description": "xApp service address and port",
+ "type": "object",
+ "properties": {
+ "HTTPPort": {
+ "description": "xApp HTTP service address port",
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
+ },
+ "Host": {
+ "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'",
+ "type": "string"
+ },
+ "RMRPort": {
+ "description": "xApp RMR service address port",
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
+ }
+ }
+ },
+ "Meid": {
+ "type": "string"
+ },
+ "RANFunctionID": {
+ "type": "integer",
+ "maximum": 4095,
+ "minimum": 0
+ },
+ "SubscriptionDetails": {
+ "$ref": "#/definitions/SubscriptionDetailsList"
+ },
+ "SubscriptionId": {
+ "description": "Optional subscription ID (Submgr allocates if not given)",
+ "type": "string"
+ }
+ }
+ },
+ "SubscriptionParamsClientEndpoint": {
+ "description": "xApp service address and port",
+ "type": "object",
+ "properties": {
+ "HTTPPort": {
+ "description": "xApp HTTP service address port",
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
+ },
+ "Host": {
+ "description": "xApp service address name like 'service-ricxapp-xappname-http.ricxapp'",
+ "type": "string"
+ },
+ "RMRPort": {
+ "description": "xApp RMR service address port",
+ "type": "integer",
+ "maximum": 65535,
+ "minimum": 0
+ }
+ }
+ },
"SubscriptionResponse": {
"type": "object",
"required": [
@@ -979,13 +806,45 @@
}
}
},
- "SubscriptionType": {
- "type": "string",
- "enum": [
- "insert",
- "policy",
- "report"
- ]
+ "SubsequentAction": {
+ "description": "SubsequentAction is an OPTIONAL IE",
+ "type": "object",
+ "required": [
+ "SubsequentActionType",
+ "TimeToWait"
+ ],
+ "properties": {
+ "SubsequentActionType": {
+ "type": "string",
+ "enum": [
+ "continue",
+ "wait"
+ ]
+ },
+ "TimeToWait": {
+ "type": "string",
+ "enum": [
+ "zero",
+ "w1ms",
+ "w2ms",
+ "w5ms",
+ "w10ms",
+ "w20ms",
+ "w30ms",
+ "w40ms",
+ "w50ms",
+ "w100ms",
+ "w200ms",
+ "w500ms",
+ "w1s",
+ "w2s",
+ "w5s",
+ "w10s",
+ "w20s",
+ "w60s"
+ ]
+ }
+ }
},
"XAppConfig": {
"type": "object",
diff --git a/pkg/restapi/operations/query/get_all_subscriptions.go b/pkg/restapi/operations/common/get_all_subscriptions.go
similarity index 91%
rename from pkg/restapi/operations/query/get_all_subscriptions.go
rename to pkg/restapi/operations/common/get_all_subscriptions.go
index 2a6a6e8..af640e6 100644
--- a/pkg/restapi/operations/query/get_all_subscriptions.go
+++ b/pkg/restapi/operations/common/get_all_subscriptions.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package query
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
@@ -8,7 +8,7 @@
import (
"net/http"
- middleware "github.com/go-openapi/runtime/middleware"
+ "github.com/go-openapi/runtime/middleware"
)
// GetAllSubscriptionsHandlerFunc turns a function with the right signature into a get all subscriptions handler
@@ -29,7 +29,7 @@
return &GetAllSubscriptions{Context: ctx, Handler: handler}
}
-/*GetAllSubscriptions swagger:route GET /subscriptions query getAllSubscriptions
+/*GetAllSubscriptions swagger:route GET /subscriptions common getAllSubscriptions
Returns list of subscriptions
diff --git a/pkg/restapi/operations/query/get_all_subscriptions_parameters.go b/pkg/restapi/operations/common/get_all_subscriptions_parameters.go
similarity index 98%
rename from pkg/restapi/operations/query/get_all_subscriptions_parameters.go
rename to pkg/restapi/operations/common/get_all_subscriptions_parameters.go
index a9aca80..ec58649 100644
--- a/pkg/restapi/operations/query/get_all_subscriptions_parameters.go
+++ b/pkg/restapi/operations/common/get_all_subscriptions_parameters.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package query
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
diff --git a/pkg/restapi/operations/query/get_all_subscriptions_responses.go b/pkg/restapi/operations/common/get_all_subscriptions_responses.go
similarity index 96%
rename from pkg/restapi/operations/query/get_all_subscriptions_responses.go
rename to pkg/restapi/operations/common/get_all_subscriptions_responses.go
index 485f1b8..16ec29d 100644
--- a/pkg/restapi/operations/query/get_all_subscriptions_responses.go
+++ b/pkg/restapi/operations/common/get_all_subscriptions_responses.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package query
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@@ -10,7 +10,7 @@
"github.com/go-openapi/runtime"
- models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
)
// GetAllSubscriptionsOKCode is the HTTP code returned for type GetAllSubscriptionsOK
diff --git a/pkg/restapi/operations/query/get_all_subscriptions_urlbuilder.go b/pkg/restapi/operations/common/get_all_subscriptions_urlbuilder.go
similarity index 99%
rename from pkg/restapi/operations/query/get_all_subscriptions_urlbuilder.go
rename to pkg/restapi/operations/common/get_all_subscriptions_urlbuilder.go
index 7ef157a..4703e12 100644
--- a/pkg/restapi/operations/query/get_all_subscriptions_urlbuilder.go
+++ b/pkg/restapi/operations/common/get_all_subscriptions_urlbuilder.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package query
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
diff --git a/pkg/restapi/operations/common/subscribe.go b/pkg/restapi/operations/common/subscribe.go
new file mode 100644
index 0000000..17d19da
--- /dev/null
+++ b/pkg/restapi/operations/common/subscribe.go
@@ -0,0 +1,58 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package common
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the generate command
+
+import (
+ "net/http"
+
+ "github.com/go-openapi/runtime/middleware"
+)
+
+// SubscribeHandlerFunc turns a function with the right signature into a subscribe handler
+type SubscribeHandlerFunc func(SubscribeParams) middleware.Responder
+
+// Handle executing the request and returning a response
+func (fn SubscribeHandlerFunc) Handle(params SubscribeParams) middleware.Responder {
+ return fn(params)
+}
+
+// SubscribeHandler interface for that can handle valid subscribe params
+type SubscribeHandler interface {
+ Handle(SubscribeParams) middleware.Responder
+}
+
+// NewSubscribe creates a new http.Handler for the subscribe operation
+func NewSubscribe(ctx *middleware.Context, handler SubscribeHandler) *Subscribe {
+ return &Subscribe{Context: ctx, Handler: handler}
+}
+
+/*Subscribe swagger:route POST /subscriptions common subscribe
+
+Subscribe a list of X2AP event triggers to receive messages sent by RAN
+
+*/
+type Subscribe struct {
+ Context *middleware.Context
+ Handler SubscribeHandler
+}
+
+func (o *Subscribe) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
+ route, rCtx, _ := o.Context.RouteInfo(r)
+ if rCtx != nil {
+ r = rCtx
+ }
+ var Params = NewSubscribeParams()
+
+ if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
+ o.Context.Respond(rw, r, route.Produces, route, err)
+ return
+ }
+
+ res := o.Handler.Handle(Params) // actually handle the request
+
+ o.Context.Respond(rw, r, route.Produces, route, res)
+
+}
diff --git a/pkg/restapi/operations/report/subscribe_report_parameters.go b/pkg/restapi/operations/common/subscribe_parameters.go
similarity index 60%
rename from pkg/restapi/operations/report/subscribe_report_parameters.go
rename to pkg/restapi/operations/common/subscribe_parameters.go
index 96adaaf..ae5c234 100644
--- a/pkg/restapi/operations/report/subscribe_report_parameters.go
+++ b/pkg/restapi/operations/common/subscribe_parameters.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package report
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the swagger generate command
@@ -12,45 +12,45 @@
"github.com/go-openapi/runtime"
"github.com/go-openapi/runtime/middleware"
- models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
)
-// NewSubscribeReportParams creates a new SubscribeReportParams object
+// NewSubscribeParams creates a new SubscribeParams object
// no default values defined in spec.
-func NewSubscribeReportParams() SubscribeReportParams {
+func NewSubscribeParams() SubscribeParams {
- return SubscribeReportParams{}
+ return SubscribeParams{}
}
-// SubscribeReportParams contains all the bound params for the subscribe report operation
+// SubscribeParams contains all the bound params for the subscribe operation
// typically these are obtained from a http.Request
//
-// swagger:parameters subscribeReport
-type SubscribeReportParams struct {
+// swagger:parameters Subscribe
+type SubscribeParams struct {
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
- /*Subscription report parameters
+ /*Subscription parameters
In: body
*/
- ReportParams *models.ReportParams
+ SubscriptionParams *models.SubscriptionParams
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// for simple values it will use straight method calls.
//
-// To ensure default values, the struct must have been initialized with NewSubscribeReportParams() beforehand.
-func (o *SubscribeReportParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
+// To ensure default values, the struct must have been initialized with NewSubscribeParams() beforehand.
+func (o *SubscribeParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
var res []error
o.HTTPRequest = r
if runtime.HasBody(r) {
defer r.Body.Close()
- var body models.ReportParams
+ var body models.SubscriptionParams
if err := route.Consumer.Consume(r.Body, &body); err != nil {
- res = append(res, errors.NewParseError("reportParams", "body", "", err))
+ res = append(res, errors.NewParseError("subscriptionParams", "body", "", err))
} else {
// validate body object
if err := body.Validate(route.Formats); err != nil {
@@ -58,7 +58,7 @@
}
if len(res) == 0 {
- o.ReportParams = &body
+ o.SubscriptionParams = &body
}
}
}
diff --git a/pkg/restapi/operations/common/subscribe_responses.go b/pkg/restapi/operations/common/subscribe_responses.go
new file mode 100644
index 0000000..4af5582
--- /dev/null
+++ b/pkg/restapi/operations/common/subscribe_responses.go
@@ -0,0 +1,106 @@
+// Code generated by go-swagger; DO NOT EDIT.
+
+package common
+
+// This file was generated by the swagger tool.
+// Editing this file might prove futile when you re-run the swagger generate command
+
+import (
+ "net/http"
+
+ "github.com/go-openapi/runtime"
+
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
+)
+
+// SubscribeCreatedCode is the HTTP code returned for type SubscribeCreated
+const SubscribeCreatedCode int = 201
+
+/*SubscribeCreated Subscription successfully created
+
+swagger:response subscribeCreated
+*/
+type SubscribeCreated struct {
+
+ /*
+ In: Body
+ */
+ Payload *models.SubscriptionResponse `json:"body,omitempty"`
+}
+
+// NewSubscribeCreated creates SubscribeCreated with default headers values
+func NewSubscribeCreated() *SubscribeCreated {
+
+ return &SubscribeCreated{}
+}
+
+// WithPayload adds the payload to the subscribe created response
+func (o *SubscribeCreated) WithPayload(payload *models.SubscriptionResponse) *SubscribeCreated {
+ o.Payload = payload
+ return o
+}
+
+// SetPayload sets the payload to the subscribe created response
+func (o *SubscribeCreated) SetPayload(payload *models.SubscriptionResponse) {
+ o.Payload = payload
+}
+
+// WriteResponse to the client
+func (o *SubscribeCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.WriteHeader(201)
+ if o.Payload != nil {
+ payload := o.Payload
+ if err := producer.Produce(rw, payload); err != nil {
+ panic(err) // let the recovery middleware deal with this
+ }
+ }
+}
+
+// SubscribeBadRequestCode is the HTTP code returned for type SubscribeBadRequest
+const SubscribeBadRequestCode int = 400
+
+/*SubscribeBadRequest Invalid input
+
+swagger:response subscribeBadRequest
+*/
+type SubscribeBadRequest struct {
+}
+
+// NewSubscribeBadRequest creates SubscribeBadRequest with default headers values
+func NewSubscribeBadRequest() *SubscribeBadRequest {
+
+ return &SubscribeBadRequest{}
+}
+
+// WriteResponse to the client
+func (o *SubscribeBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
+
+ rw.WriteHeader(400)
+}
+
+// SubscribeInternalServerErrorCode is the HTTP code returned for type SubscribeInternalServerError
+const SubscribeInternalServerErrorCode int = 500
+
+/*SubscribeInternalServerError Internal error
+
+swagger:response subscribeInternalServerError
+*/
+type SubscribeInternalServerError struct {
+}
+
+// NewSubscribeInternalServerError creates SubscribeInternalServerError with default headers values
+func NewSubscribeInternalServerError() *SubscribeInternalServerError {
+
+ return &SubscribeInternalServerError{}
+}
+
+// WriteResponse to the client
+func (o *SubscribeInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
+
+ rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
+
+ rw.WriteHeader(500)
+}
diff --git a/pkg/restapi/operations/report/subscribe_report_urlbuilder.go b/pkg/restapi/operations/common/subscribe_urlbuilder.go
similarity index 71%
rename from pkg/restapi/operations/report/subscribe_report_urlbuilder.go
rename to pkg/restapi/operations/common/subscribe_urlbuilder.go
index dc713b6..b3b97e3 100644
--- a/pkg/restapi/operations/report/subscribe_report_urlbuilder.go
+++ b/pkg/restapi/operations/common/subscribe_urlbuilder.go
@@ -1,6 +1,6 @@
// Code generated by go-swagger; DO NOT EDIT.
-package report
+package common
// This file was generated by the swagger tool.
// Editing this file might prove futile when you re-run the generate command
@@ -11,15 +11,15 @@
golangswaggerpaths "path"
)
-// SubscribeReportURL generates an URL for the subscribe report operation
-type SubscribeReportURL struct {
+// SubscribeURL generates an URL for the subscribe operation
+type SubscribeURL struct {
_basePath string
}
// WithBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
-func (o *SubscribeReportURL) WithBasePath(bp string) *SubscribeReportURL {
+func (o *SubscribeURL) WithBasePath(bp string) *SubscribeURL {
o.SetBasePath(bp)
return o
}
@@ -27,15 +27,15 @@
// SetBasePath sets the base path for this url builder, only required when it's different from the
// base path specified in the swagger spec.
// When the value of the base path is an empty string
-func (o *SubscribeReportURL) SetBasePath(bp string) {
+func (o *SubscribeURL) SetBasePath(bp string) {
o._basePath = bp
}
// Build a url path and query string
-func (o *SubscribeReportURL) Build() (*url.URL, error) {
+func (o *SubscribeURL) Build() (*url.URL, error) {
var _result url.URL
- var _path = "/subscriptions/report"
+ var _path = "/subscriptions"
_basePath := o._basePath
if _basePath == "" {
@@ -47,7 +47,7 @@
}
// Must is a helper function to panic when the url builder returns an error
-func (o *SubscribeReportURL) Must(u *url.URL, err error) *url.URL {
+func (o *SubscribeURL) Must(u *url.URL, err error) *url.URL {
if err != nil {
panic(err)
}
@@ -58,17 +58,17 @@
}
// String returns the string representation of the path with query string
-func (o *SubscribeReportURL) String() string {
+func (o *SubscribeURL) String() string {
return o.Must(o.Build()).String()
}
// BuildFull builds a full url with scheme, host, path and query string
-func (o *SubscribeReportURL) BuildFull(scheme, host string) (*url.URL, error) {
+func (o *SubscribeURL) BuildFull(scheme, host string) (*url.URL, error) {
if scheme == "" {
- return nil, errors.New("scheme is required for a full url on SubscribeReportURL")
+ return nil, errors.New("scheme is required for a full url on SubscribeURL")
}
if host == "" {
- return nil, errors.New("host is required for a full url on SubscribeReportURL")
+ return nil, errors.New("host is required for a full url on SubscribeURL")
}
base, err := o.Build()
@@ -82,6 +82,6 @@
}
// StringFull returns the string representation of a complete url
-func (o *SubscribeReportURL) StringFull(scheme, host string) string {
+func (o *SubscribeURL) StringFull(scheme, host string) string {
return o.Must(o.BuildFull(scheme, host)).String()
}
diff --git a/pkg/restapi/operations/common/unsubscribe.go b/pkg/restapi/operations/common/unsubscribe.go
index 84dac86..a8efd36 100644
--- a/pkg/restapi/operations/common/unsubscribe.go
+++ b/pkg/restapi/operations/common/unsubscribe.go
@@ -8,7 +8,7 @@
import (
"net/http"
- middleware "github.com/go-openapi/runtime/middleware"
+ "github.com/go-openapi/runtime/middleware"
)
// UnsubscribeHandlerFunc turns a function with the right signature into a unsubscribe handler
diff --git a/pkg/restapi/operations/common/unsubscribe_parameters.go b/pkg/restapi/operations/common/unsubscribe_parameters.go
index 19f5111..4458fb1 100644
--- a/pkg/restapi/operations/common/unsubscribe_parameters.go
+++ b/pkg/restapi/operations/common/unsubscribe_parameters.go
@@ -10,8 +10,7 @@
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
-
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/strfmt"
)
// NewUnsubscribeParams creates a new UnsubscribeParams object
diff --git a/pkg/restapi/operations/policy/subscribe_policy.go b/pkg/restapi/operations/policy/subscribe_policy.go
deleted file mode 100644
index f812cec..0000000
--- a/pkg/restapi/operations/policy/subscribe_policy.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the generate command
-
-import (
- "net/http"
-
- middleware "github.com/go-openapi/runtime/middleware"
-)
-
-// SubscribePolicyHandlerFunc turns a function with the right signature into a subscribe policy handler
-type SubscribePolicyHandlerFunc func(SubscribePolicyParams) middleware.Responder
-
-// Handle executing the request and returning a response
-func (fn SubscribePolicyHandlerFunc) Handle(params SubscribePolicyParams) middleware.Responder {
- return fn(params)
-}
-
-// SubscribePolicyHandler interface for that can handle valid subscribe policy params
-type SubscribePolicyHandler interface {
- Handle(SubscribePolicyParams) middleware.Responder
-}
-
-// NewSubscribePolicy creates a new http.Handler for the subscribe policy operation
-func NewSubscribePolicy(ctx *middleware.Context, handler SubscribePolicyHandler) *SubscribePolicy {
- return &SubscribePolicy{Context: ctx, Handler: handler}
-}
-
-/*SubscribePolicy swagger:route POST /subscriptions/policy policy subscribePolicy
-
-Subscribe and send "POLICY" message to RAN to execute a specific POLICY during call processing in RAN after each occurrence of a defined SUBSCRIPTION
-
-*/
-type SubscribePolicy struct {
- Context *middleware.Context
- Handler SubscribePolicyHandler
-}
-
-func (o *SubscribePolicy) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
- route, rCtx, _ := o.Context.RouteInfo(r)
- if rCtx != nil {
- r = rCtx
- }
- var Params = NewSubscribePolicyParams()
-
- if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
- o.Context.Respond(rw, r, route.Produces, route, err)
- return
- }
-
- res := o.Handler.Handle(Params) // actually handle the request
-
- o.Context.Respond(rw, r, route.Produces, route, res)
-
-}
diff --git a/pkg/restapi/operations/policy/subscribe_policy_parameters.go b/pkg/restapi/operations/policy/subscribe_policy_parameters.go
deleted file mode 100644
index ca6cb28..0000000
--- a/pkg/restapi/operations/policy/subscribe_policy_parameters.go
+++ /dev/null
@@ -1,69 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "net/http"
-
- "github.com/go-openapi/errors"
- "github.com/go-openapi/runtime"
- "github.com/go-openapi/runtime/middleware"
-
- models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
-)
-
-// NewSubscribePolicyParams creates a new SubscribePolicyParams object
-// no default values defined in spec.
-func NewSubscribePolicyParams() SubscribePolicyParams {
-
- return SubscribePolicyParams{}
-}
-
-// SubscribePolicyParams contains all the bound params for the subscribe policy operation
-// typically these are obtained from a http.Request
-//
-// swagger:parameters subscribePolicy
-type SubscribePolicyParams struct {
-
- // HTTP Request Object
- HTTPRequest *http.Request `json:"-"`
-
- /*Subscription policy parameters
- In: body
- */
- PolicyParams *models.PolicyParams
-}
-
-// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
-// for simple values it will use straight method calls.
-//
-// To ensure default values, the struct must have been initialized with NewSubscribePolicyParams() beforehand.
-func (o *SubscribePolicyParams) BindRequest(r *http.Request, route *middleware.MatchedRoute) error {
- var res []error
-
- o.HTTPRequest = r
-
- if runtime.HasBody(r) {
- defer r.Body.Close()
- var body models.PolicyParams
- if err := route.Consumer.Consume(r.Body, &body); err != nil {
- res = append(res, errors.NewParseError("policyParams", "body", "", err))
- } else {
- // validate body object
- if err := body.Validate(route.Formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) == 0 {
- o.PolicyParams = &body
- }
- }
- }
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
diff --git a/pkg/restapi/operations/policy/subscribe_policy_responses.go b/pkg/restapi/operations/policy/subscribe_policy_responses.go
deleted file mode 100644
index 4a56d34..0000000
--- a/pkg/restapi/operations/policy/subscribe_policy_responses.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "net/http"
-
- "github.com/go-openapi/runtime"
-
- models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
-)
-
-// SubscribePolicyCreatedCode is the HTTP code returned for type SubscribePolicyCreated
-const SubscribePolicyCreatedCode int = 201
-
-/*SubscribePolicyCreated Subscription successfully created
-
-swagger:response subscribePolicyCreated
-*/
-type SubscribePolicyCreated struct {
-
- /*
- In: Body
- */
- Payload *models.SubscriptionResponse `json:"body,omitempty"`
-}
-
-// NewSubscribePolicyCreated creates SubscribePolicyCreated with default headers values
-func NewSubscribePolicyCreated() *SubscribePolicyCreated {
-
- return &SubscribePolicyCreated{}
-}
-
-// WithPayload adds the payload to the subscribe policy created response
-func (o *SubscribePolicyCreated) WithPayload(payload *models.SubscriptionResponse) *SubscribePolicyCreated {
- o.Payload = payload
- return o
-}
-
-// SetPayload sets the payload to the subscribe policy created response
-func (o *SubscribePolicyCreated) SetPayload(payload *models.SubscriptionResponse) {
- o.Payload = payload
-}
-
-// WriteResponse to the client
-func (o *SubscribePolicyCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.WriteHeader(201)
- if o.Payload != nil {
- payload := o.Payload
- if err := producer.Produce(rw, payload); err != nil {
- panic(err) // let the recovery middleware deal with this
- }
- }
-}
-
-// SubscribePolicyBadRequestCode is the HTTP code returned for type SubscribePolicyBadRequest
-const SubscribePolicyBadRequestCode int = 400
-
-/*SubscribePolicyBadRequest Invalid input
-
-swagger:response subscribePolicyBadRequest
-*/
-type SubscribePolicyBadRequest struct {
-}
-
-// NewSubscribePolicyBadRequest creates SubscribePolicyBadRequest with default headers values
-func NewSubscribePolicyBadRequest() *SubscribePolicyBadRequest {
-
- return &SubscribePolicyBadRequest{}
-}
-
-// WriteResponse to the client
-func (o *SubscribePolicyBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
-
- rw.WriteHeader(400)
-}
-
-// SubscribePolicyInternalServerErrorCode is the HTTP code returned for type SubscribePolicyInternalServerError
-const SubscribePolicyInternalServerErrorCode int = 500
-
-/*SubscribePolicyInternalServerError Internal error
-
-swagger:response subscribePolicyInternalServerError
-*/
-type SubscribePolicyInternalServerError struct {
-}
-
-// NewSubscribePolicyInternalServerError creates SubscribePolicyInternalServerError with default headers values
-func NewSubscribePolicyInternalServerError() *SubscribePolicyInternalServerError {
-
- return &SubscribePolicyInternalServerError{}
-}
-
-// WriteResponse to the client
-func (o *SubscribePolicyInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
-
- rw.WriteHeader(500)
-}
diff --git a/pkg/restapi/operations/policy/subscribe_policy_urlbuilder.go b/pkg/restapi/operations/policy/subscribe_policy_urlbuilder.go
deleted file mode 100644
index 2274f40..0000000
--- a/pkg/restapi/operations/policy/subscribe_policy_urlbuilder.go
+++ /dev/null
@@ -1,87 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package policy
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the generate command
-
-import (
- "errors"
- "net/url"
- golangswaggerpaths "path"
-)
-
-// SubscribePolicyURL generates an URL for the subscribe policy operation
-type SubscribePolicyURL struct {
- _basePath string
-}
-
-// WithBasePath sets the base path for this url builder, only required when it's different from the
-// base path specified in the swagger spec.
-// When the value of the base path is an empty string
-func (o *SubscribePolicyURL) WithBasePath(bp string) *SubscribePolicyURL {
- o.SetBasePath(bp)
- return o
-}
-
-// SetBasePath sets the base path for this url builder, only required when it's different from the
-// base path specified in the swagger spec.
-// When the value of the base path is an empty string
-func (o *SubscribePolicyURL) SetBasePath(bp string) {
- o._basePath = bp
-}
-
-// Build a url path and query string
-func (o *SubscribePolicyURL) Build() (*url.URL, error) {
- var _result url.URL
-
- var _path = "/subscriptions/policy"
-
- _basePath := o._basePath
- if _basePath == "" {
- _basePath = "/ric/v1"
- }
- _result.Path = golangswaggerpaths.Join(_basePath, _path)
-
- return &_result, nil
-}
-
-// Must is a helper function to panic when the url builder returns an error
-func (o *SubscribePolicyURL) Must(u *url.URL, err error) *url.URL {
- if err != nil {
- panic(err)
- }
- if u == nil {
- panic("url can't be nil")
- }
- return u
-}
-
-// String returns the string representation of the path with query string
-func (o *SubscribePolicyURL) String() string {
- return o.Must(o.Build()).String()
-}
-
-// BuildFull builds a full url with scheme, host, path and query string
-func (o *SubscribePolicyURL) BuildFull(scheme, host string) (*url.URL, error) {
- if scheme == "" {
- return nil, errors.New("scheme is required for a full url on SubscribePolicyURL")
- }
- if host == "" {
- return nil, errors.New("host is required for a full url on SubscribePolicyURL")
- }
-
- base, err := o.Build()
- if err != nil {
- return nil, err
- }
-
- base.Scheme = scheme
- base.Host = host
- return base, nil
-}
-
-// StringFull returns the string representation of a complete url
-func (o *SubscribePolicyURL) StringFull(scheme, host string) string {
- return o.Must(o.BuildFull(scheme, host)).String()
-}
diff --git a/pkg/restapi/operations/report/subscribe_report.go b/pkg/restapi/operations/report/subscribe_report.go
deleted file mode 100644
index d0ea85e..0000000
--- a/pkg/restapi/operations/report/subscribe_report.go
+++ /dev/null
@@ -1,58 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package report
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the generate command
-
-import (
- "net/http"
-
- middleware "github.com/go-openapi/runtime/middleware"
-)
-
-// SubscribeReportHandlerFunc turns a function with the right signature into a subscribe report handler
-type SubscribeReportHandlerFunc func(SubscribeReportParams) middleware.Responder
-
-// Handle executing the request and returning a response
-func (fn SubscribeReportHandlerFunc) Handle(params SubscribeReportParams) middleware.Responder {
- return fn(params)
-}
-
-// SubscribeReportHandler interface for that can handle valid subscribe report params
-type SubscribeReportHandler interface {
- Handle(SubscribeReportParams) middleware.Responder
-}
-
-// NewSubscribeReport creates a new http.Handler for the subscribe report operation
-func NewSubscribeReport(ctx *middleware.Context, handler SubscribeReportHandler) *SubscribeReport {
- return &SubscribeReport{Context: ctx, Handler: handler}
-}
-
-/*SubscribeReport swagger:route POST /subscriptions/report report subscribeReport
-
-Subscribe a list of X2AP event triggers to receive "REPORT" messages sent by RAN or Subscribe to receive the content of gNB NRT table in REPORT message sent by RAN
-
-*/
-type SubscribeReport struct {
- Context *middleware.Context
- Handler SubscribeReportHandler
-}
-
-func (o *SubscribeReport) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
- route, rCtx, _ := o.Context.RouteInfo(r)
- if rCtx != nil {
- r = rCtx
- }
- var Params = NewSubscribeReportParams()
-
- if err := o.Context.BindValidRequest(r, route, &Params); err != nil { // bind params
- o.Context.Respond(rw, r, route.Produces, route, err)
- return
- }
-
- res := o.Handler.Handle(Params) // actually handle the request
-
- o.Context.Respond(rw, r, route.Produces, route, res)
-
-}
diff --git a/pkg/restapi/operations/report/subscribe_report_responses.go b/pkg/restapi/operations/report/subscribe_report_responses.go
deleted file mode 100644
index 9e9d18d..0000000
--- a/pkg/restapi/operations/report/subscribe_report_responses.go
+++ /dev/null
@@ -1,106 +0,0 @@
-// Code generated by go-swagger; DO NOT EDIT.
-
-package report
-
-// This file was generated by the swagger tool.
-// Editing this file might prove futile when you re-run the swagger generate command
-
-import (
- "net/http"
-
- "github.com/go-openapi/runtime"
-
- models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
-)
-
-// SubscribeReportCreatedCode is the HTTP code returned for type SubscribeReportCreated
-const SubscribeReportCreatedCode int = 201
-
-/*SubscribeReportCreated Subscription successfully created
-
-swagger:response subscribeReportCreated
-*/
-type SubscribeReportCreated struct {
-
- /*
- In: Body
- */
- Payload *models.SubscriptionResponse `json:"body,omitempty"`
-}
-
-// NewSubscribeReportCreated creates SubscribeReportCreated with default headers values
-func NewSubscribeReportCreated() *SubscribeReportCreated {
-
- return &SubscribeReportCreated{}
-}
-
-// WithPayload adds the payload to the subscribe report created response
-func (o *SubscribeReportCreated) WithPayload(payload *models.SubscriptionResponse) *SubscribeReportCreated {
- o.Payload = payload
- return o
-}
-
-// SetPayload sets the payload to the subscribe report created response
-func (o *SubscribeReportCreated) SetPayload(payload *models.SubscriptionResponse) {
- o.Payload = payload
-}
-
-// WriteResponse to the client
-func (o *SubscribeReportCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.WriteHeader(201)
- if o.Payload != nil {
- payload := o.Payload
- if err := producer.Produce(rw, payload); err != nil {
- panic(err) // let the recovery middleware deal with this
- }
- }
-}
-
-// SubscribeReportBadRequestCode is the HTTP code returned for type SubscribeReportBadRequest
-const SubscribeReportBadRequestCode int = 400
-
-/*SubscribeReportBadRequest Invalid input
-
-swagger:response subscribeReportBadRequest
-*/
-type SubscribeReportBadRequest struct {
-}
-
-// NewSubscribeReportBadRequest creates SubscribeReportBadRequest with default headers values
-func NewSubscribeReportBadRequest() *SubscribeReportBadRequest {
-
- return &SubscribeReportBadRequest{}
-}
-
-// WriteResponse to the client
-func (o *SubscribeReportBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
-
- rw.WriteHeader(400)
-}
-
-// SubscribeReportInternalServerErrorCode is the HTTP code returned for type SubscribeReportInternalServerError
-const SubscribeReportInternalServerErrorCode int = 500
-
-/*SubscribeReportInternalServerError Internal error
-
-swagger:response subscribeReportInternalServerError
-*/
-type SubscribeReportInternalServerError struct {
-}
-
-// NewSubscribeReportInternalServerError creates SubscribeReportInternalServerError with default headers values
-func NewSubscribeReportInternalServerError() *SubscribeReportInternalServerError {
-
- return &SubscribeReportInternalServerError{}
-}
-
-// WriteResponse to the client
-func (o *SubscribeReportInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
-
- rw.WriteHeader(500)
-}
diff --git a/pkg/restapi/operations/xapp/get_xapp_config_list.go b/pkg/restapi/operations/xapp/get_xapp_config_list.go
index 9fc02d3..1d0c141 100644
--- a/pkg/restapi/operations/xapp/get_xapp_config_list.go
+++ b/pkg/restapi/operations/xapp/get_xapp_config_list.go
@@ -8,7 +8,7 @@
import (
"net/http"
- middleware "github.com/go-openapi/runtime/middleware"
+ "github.com/go-openapi/runtime/middleware"
)
// GetXappConfigListHandlerFunc turns a function with the right signature into a get xapp config list handler
diff --git a/pkg/restapi/operations/xapp/get_xapp_config_list_responses.go b/pkg/restapi/operations/xapp/get_xapp_config_list_responses.go
index bddbfea..96c663f 100644
--- a/pkg/restapi/operations/xapp/get_xapp_config_list_responses.go
+++ b/pkg/restapi/operations/xapp/get_xapp_config_list_responses.go
@@ -10,7 +10,7 @@
"github.com/go-openapi/runtime"
- models "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
+ "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
)
// GetXappConfigListOKCode is the HTTP code returned for type GetXappConfigListOK
diff --git a/pkg/restapi/operations/xapp_framework_api.go b/pkg/restapi/operations/xapp_framework_api.go
index c2ef01b..83f3bb5 100644
--- a/pkg/restapi/operations/xapp_framework_api.go
+++ b/pkg/restapi/operations/xapp_framework_api.go
@@ -10,19 +10,16 @@
"net/http"
"strings"
- errors "github.com/go-openapi/errors"
- loads "github.com/go-openapi/loads"
- runtime "github.com/go-openapi/runtime"
- middleware "github.com/go-openapi/runtime/middleware"
- security "github.com/go-openapi/runtime/security"
- spec "github.com/go-openapi/spec"
- strfmt "github.com/go-openapi/strfmt"
+ "github.com/go-openapi/errors"
+ "github.com/go-openapi/loads"
+ "github.com/go-openapi/runtime"
+ "github.com/go-openapi/runtime/middleware"
+ "github.com/go-openapi/runtime/security"
+ "github.com/go-openapi/spec"
+ "github.com/go-openapi/strfmt"
"github.com/go-openapi/swag"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/common"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/policy"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/query"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/report"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/xapp"
)
@@ -35,29 +32,30 @@
defaultProduces: "application/json",
customConsumers: make(map[string]runtime.Consumer),
customProducers: make(map[string]runtime.Producer),
+ PreServerShutdown: func() {},
ServerShutdown: func() {},
spec: spec,
ServeError: errors.ServeError,
BasicAuthenticator: security.BasicAuth,
APIKeyAuthenticator: security.APIKeyAuth,
BearerAuthenticator: security.BearerAuth,
- JSONConsumer: runtime.JSONConsumer(),
- JSONProducer: runtime.JSONProducer(),
- XMLProducer: runtime.XMLProducer(),
- CommonUnsubscribeHandler: common.UnsubscribeHandlerFunc(func(params common.UnsubscribeParams) middleware.Responder {
- return middleware.NotImplemented("operation CommonUnsubscribe has not yet been implemented")
+
+ JSONConsumer: runtime.JSONConsumer(),
+
+ JSONProducer: runtime.JSONProducer(),
+ XMLProducer: runtime.XMLProducer(),
+
+ CommonSubscribeHandler: common.SubscribeHandlerFunc(func(params common.SubscribeParams) middleware.Responder {
+ return middleware.NotImplemented("operation common.Subscribe has not yet been implemented")
}),
- QueryGetAllSubscriptionsHandler: query.GetAllSubscriptionsHandlerFunc(func(params query.GetAllSubscriptionsParams) middleware.Responder {
- return middleware.NotImplemented("operation QueryGetAllSubscriptions has not yet been implemented")
+ CommonUnsubscribeHandler: common.UnsubscribeHandlerFunc(func(params common.UnsubscribeParams) middleware.Responder {
+ return middleware.NotImplemented("operation common.Unsubscribe has not yet been implemented")
+ }),
+ CommonGetAllSubscriptionsHandler: common.GetAllSubscriptionsHandlerFunc(func(params common.GetAllSubscriptionsParams) middleware.Responder {
+ return middleware.NotImplemented("operation common.GetAllSubscriptions has not yet been implemented")
}),
XappGetXappConfigListHandler: xapp.GetXappConfigListHandlerFunc(func(params xapp.GetXappConfigListParams) middleware.Responder {
- return middleware.NotImplemented("operation XappGetXappConfigList has not yet been implemented")
- }),
- PolicySubscribePolicyHandler: policy.SubscribePolicyHandlerFunc(func(params policy.SubscribePolicyParams) middleware.Responder {
- return middleware.NotImplemented("operation PolicySubscribePolicy has not yet been implemented")
- }),
- ReportSubscribeReportHandler: report.SubscribeReportHandlerFunc(func(params report.SubscribeReportParams) middleware.Responder {
- return middleware.NotImplemented("operation ReportSubscribeReport has not yet been implemented")
+ return middleware.NotImplemented("operation xapp.GetXappConfigList has not yet been implemented")
}),
}
}
@@ -84,29 +82,33 @@
// It has a default implementation in the security package, however you can replace it for your particular usage.
BearerAuthenticator func(string, security.ScopedTokenAuthentication) runtime.Authenticator
- // JSONConsumer registers a consumer for a "application/json" mime type
+ // JSONConsumer registers a consumer for the following mime types:
+ // - application/json
JSONConsumer runtime.Consumer
- // JSONProducer registers a producer for a "application/json" mime type
+ // JSONProducer registers a producer for the following mime types:
+ // - application/json
JSONProducer runtime.Producer
- // XMLProducer registers a producer for a "application/xml" mime type
+ // XMLProducer registers a producer for the following mime types:
+ // - application/xml
XMLProducer runtime.Producer
+ // CommonSubscribeHandler sets the operation handler for the subscribe operation
+ CommonSubscribeHandler common.SubscribeHandler
// CommonUnsubscribeHandler sets the operation handler for the unsubscribe operation
CommonUnsubscribeHandler common.UnsubscribeHandler
- // QueryGetAllSubscriptionsHandler sets the operation handler for the get all subscriptions operation
- QueryGetAllSubscriptionsHandler query.GetAllSubscriptionsHandler
+ // CommonGetAllSubscriptionsHandler sets the operation handler for the get all subscriptions operation
+ CommonGetAllSubscriptionsHandler common.GetAllSubscriptionsHandler
// XappGetXappConfigListHandler sets the operation handler for the get xapp config list operation
XappGetXappConfigListHandler xapp.GetXappConfigListHandler
- // PolicySubscribePolicyHandler sets the operation handler for the subscribe policy operation
- PolicySubscribePolicyHandler policy.SubscribePolicyHandler
- // ReportSubscribeReportHandler sets the operation handler for the subscribe report operation
- ReportSubscribeReportHandler report.SubscribeReportHandler
-
// ServeError is called when an error is received, there is a default handler
// but you can set your own with this
ServeError func(http.ResponseWriter, *http.Request, error)
+ // PreServerShutdown is called before the HTTP(S) server is shutdown
+ // This allows for custom functions to get executed before the HTTP(S) server stops accepting traffic
+ PreServerShutdown func()
+
// ServerShutdown is called when the HTTP(S) server is shut down and done
// handling all active connections and does not accept connections any more
ServerShutdown func()
@@ -164,31 +166,23 @@
if o.JSONProducer == nil {
unregistered = append(unregistered, "JSONProducer")
}
-
if o.XMLProducer == nil {
unregistered = append(unregistered, "XMLProducer")
}
+ if o.CommonSubscribeHandler == nil {
+ unregistered = append(unregistered, "common.SubscribeHandler")
+ }
if o.CommonUnsubscribeHandler == nil {
unregistered = append(unregistered, "common.UnsubscribeHandler")
}
-
- if o.QueryGetAllSubscriptionsHandler == nil {
- unregistered = append(unregistered, "query.GetAllSubscriptionsHandler")
+ if o.CommonGetAllSubscriptionsHandler == nil {
+ unregistered = append(unregistered, "common.GetAllSubscriptionsHandler")
}
-
if o.XappGetXappConfigListHandler == nil {
unregistered = append(unregistered, "xapp.GetXappConfigListHandler")
}
- if o.PolicySubscribePolicyHandler == nil {
- unregistered = append(unregistered, "policy.SubscribePolicyHandler")
- }
-
- if o.ReportSubscribeReportHandler == nil {
- unregistered = append(unregistered, "report.SubscribeReportHandler")
- }
-
if len(unregistered) > 0 {
return fmt.Errorf("missing registration: %s", strings.Join(unregistered, ", "))
}
@@ -203,28 +197,22 @@
// AuthenticatorsFor gets the authenticators for the specified security schemes
func (o *XappFrameworkAPI) AuthenticatorsFor(schemes map[string]spec.SecurityScheme) map[string]runtime.Authenticator {
-
return nil
-
}
// Authorizer returns the registered authorizer
func (o *XappFrameworkAPI) Authorizer() runtime.Authorizer {
-
return nil
-
}
-// ConsumersFor gets the consumers for the specified media types
+// ConsumersFor gets the consumers for the specified media types.
+// MIME type parameters are ignored here.
func (o *XappFrameworkAPI) ConsumersFor(mediaTypes []string) map[string]runtime.Consumer {
-
- result := make(map[string]runtime.Consumer)
+ result := make(map[string]runtime.Consumer, len(mediaTypes))
for _, mt := range mediaTypes {
switch mt {
-
case "application/json":
result["application/json"] = o.JSONConsumer
-
}
if c, ok := o.customConsumers[mt]; ok {
@@ -232,22 +220,18 @@
}
}
return result
-
}
-// ProducersFor gets the producers for the specified media types
+// ProducersFor gets the producers for the specified media types.
+// MIME type parameters are ignored here.
func (o *XappFrameworkAPI) ProducersFor(mediaTypes []string) map[string]runtime.Producer {
-
- result := make(map[string]runtime.Producer)
+ result := make(map[string]runtime.Producer, len(mediaTypes))
for _, mt := range mediaTypes {
switch mt {
-
case "application/json":
result["application/json"] = o.JSONProducer
-
case "application/xml":
result["application/xml"] = o.XMLProducer
-
}
if p, ok := o.customProducers[mt]; ok {
@@ -255,7 +239,6 @@
}
}
return result
-
}
// HandlerFor gets a http.Handler for the provided operation method and path
@@ -285,36 +268,26 @@
func (o *XappFrameworkAPI) initHandlerCache() {
o.Context() // don't care about the result, just that the initialization happened
-
if o.handlers == nil {
o.handlers = make(map[string]map[string]http.Handler)
}
+ if o.handlers["POST"] == nil {
+ o.handlers["POST"] = make(map[string]http.Handler)
+ }
+ o.handlers["POST"]["/subscriptions"] = common.NewSubscribe(o.context, o.CommonSubscribeHandler)
if o.handlers["DELETE"] == nil {
o.handlers["DELETE"] = make(map[string]http.Handler)
}
o.handlers["DELETE"]["/subscriptions/{subscriptionId}"] = common.NewUnsubscribe(o.context, o.CommonUnsubscribeHandler)
-
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
- o.handlers["GET"]["/subscriptions"] = query.NewGetAllSubscriptions(o.context, o.QueryGetAllSubscriptionsHandler)
-
+ o.handlers["GET"]["/subscriptions"] = common.NewGetAllSubscriptions(o.context, o.CommonGetAllSubscriptionsHandler)
if o.handlers["GET"] == nil {
o.handlers["GET"] = make(map[string]http.Handler)
}
o.handlers["GET"]["/config"] = xapp.NewGetXappConfigList(o.context, o.XappGetXappConfigListHandler)
-
- if o.handlers["POST"] == nil {
- o.handlers["POST"] = make(map[string]http.Handler)
- }
- o.handlers["POST"]["/subscriptions/policy"] = policy.NewSubscribePolicy(o.context, o.PolicySubscribePolicyHandler)
-
- if o.handlers["POST"] == nil {
- o.handlers["POST"] = make(map[string]http.Handler)
- }
- o.handlers["POST"]["/subscriptions/report"] = report.NewSubscribeReport(o.context, o.ReportSubscribeReportHandler)
-
}
// Serve creates a http handler to serve the API over HTTP
@@ -344,3 +317,15 @@
func (o *XappFrameworkAPI) RegisterProducer(mediaType string, producer runtime.Producer) {
o.customProducers[mediaType] = producer
}
+
+// AddMiddlewareFor adds a http middleware to existing handler
+func (o *XappFrameworkAPI) AddMiddlewareFor(method, path string, builder middleware.Builder) {
+ um := strings.ToUpper(method)
+ if path == "/" {
+ path = ""
+ }
+ o.Init()
+ if h, ok := o.handlers[um][path]; ok {
+ o.handlers[method][path] = builder(h)
+ }
+}
diff --git a/pkg/restapi/server.go b/pkg/restapi/server.go
index 23fda83..e4647a2 100644
--- a/pkg/restapi/server.go
+++ b/pkg/restapi/server.go
@@ -133,7 +133,6 @@
}
s.api = api
- s.api.Logger = log.Printf
s.handler = configureAPI(api)
}
@@ -174,8 +173,6 @@
go handleInterrupt(once, s)
servers := []*http.Server{}
- wg.Add(1)
- go s.handleShutdown(wg, &servers)
if s.hasScheme(schemeUnix) {
domainSocket := new(http.Server)
@@ -252,7 +249,7 @@
// https://github.com/golang/go/tree/master/src/crypto/elliptic
CurvePreferences: []tls.CurveID{tls.CurveP256},
// Use modern tls mode https://wiki.mozilla.org/Security/Server_Side_TLS#Modern_compatibility
- NextProtos: []string{"http/1.1", "h2"},
+ NextProtos: []string{"h2", "http/1.1"},
// https://www.owasp.org/index.php/Transport_Layer_Protection_Cheat_Sheet#Rule_-_Only_Support_Strong_Protocols
MinVersion: tls.VersionTLS12,
// These ciphersuites support Forward Secrecy: https://en.wikipedia.org/wiki/Forward_secrecy
@@ -293,7 +290,7 @@
// call custom TLS configurator
configureTLS(httpsServer.TLSConfig)
- if len(httpsServer.TLSConfig.Certificates) == 0 {
+ if len(httpsServer.TLSConfig.Certificates) == 0 && httpsServer.TLSConfig.GetCertificate == nil {
// after standard and custom config are passed, this ends up with no certificate
if s.TLSCertificate == "" {
if s.TLSCertificateKey == "" {
@@ -325,6 +322,9 @@
}(tls.NewListener(s.httpsServerL, httpsServer.TLSConfig))
}
+ wg.Add(1)
+ go s.handleShutdown(wg, &servers)
+
wg.Wait()
return nil
}
@@ -420,6 +420,9 @@
ctx, cancel := context.WithTimeout(context.TODO(), s.GracefulTimeout)
defer cancel()
+ // first execute the pre-shutdown hook
+ s.api.PreServerShutdown()
+
shutdownChan := make(chan bool)
for i := range servers {
server := servers[i]
diff --git a/pkg/xapp/restapi.go b/pkg/xapp/restapi.go
index 24755fa..7019bac 100755
--- a/pkg/xapp/restapi.go
+++ b/pkg/xapp/restapi.go
@@ -120,12 +120,50 @@
return params
}
+func (r *Router) CollectDefaultSymptomData(fileName string, data interface{}) string {
+ baseDir := Config.GetString("controls.symptomdata.baseDir")
+ if baseDir == "" {
+ baseDir = "/tmp/xapp/"
+ }
+
+ if err := Util.CreateDir(baseDir); err != nil {
+ Logger.Error("CreateDir failed: %v", err)
+ return ""
+ }
+
+ if metrics, err := r.GetLocalMetrics(GetPortData("http").Port); err == nil {
+ if err := Util.WriteToFile(baseDir+"metrics.json", metrics); err != nil {
+ Logger.Error("writeToFile failed for metrics.json: %v", err)
+ }
+ }
+
+ if data != nil {
+ if b, err := json.MarshalIndent(data, "", " "); err == nil {
+ Util.WriteToFile(baseDir+fileName, string(b))
+ }
+ }
+
+ rtPath := os.Getenv("RMR_STASH_RT")
+ if rtPath == "" {
+ return baseDir
+ }
+
+ input, err := ioutil.ReadFile(rtPath)
+ if err != nil {
+ Logger.Error("ioutil.ReadFile failed: %v", err)
+ return baseDir
+ }
+
+ Util.WriteToFile(baseDir+"rttable.txt", string(input))
+ return baseDir
+}
+
func (r *Router) SendSymptomDataJson(w http.ResponseWriter, req *http.Request, data interface{}, n string) {
w.Header().Set("Content-Type", "application/json")
w.Header().Set("Content-Disposition", "attachment; filename="+n)
w.WriteHeader(http.StatusOK)
if data != nil {
- response, _ := json.Marshal(data)
+ response, _ := json.MarshalIndent(data, "", " ")
w.Write(response)
}
}
diff --git a/pkg/xapp/subscription.go b/pkg/xapp/subscription.go
index bf140c4..6a6983c 100755
--- a/pkg/xapp/subscription.go
+++ b/pkg/xapp/subscription.go
@@ -29,29 +29,21 @@
"github.com/go-openapi/strfmt"
"github.com/spf13/viper"
"io/ioutil"
- "net"
"net/http"
"os"
"time"
- //"errors"
apiclient "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi"
apicommon "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/common"
- apipolicy "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/policy"
- apireport "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/report"
apimodel "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/common"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/policy"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/query"
- "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/report"
- //"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/restapi/operations/xapp"
)
-type SubscriptionHandler func(models.SubscriptionType, interface{}) (*models.SubscriptionResponse, error)
+type SubscriptionHandler func(interface{}) (*models.SubscriptionResponse, error)
type SubscriptionQueryHandler func() (models.SubscriptionList, error)
type SubscriptionDeleteHandler func(string) error
type SubscriptionResponseCallback func(*apimodel.SubscriptionResponse)
@@ -116,51 +108,34 @@
api := operations.NewXappFrameworkAPI(swaggerSpec)
// Subscription: Query
- api.QueryGetAllSubscriptionsHandler = query.GetAllSubscriptionsHandlerFunc(
- func(p query.GetAllSubscriptionsParams) middleware.Responder {
+ api.CommonGetAllSubscriptionsHandler = common.GetAllSubscriptionsHandlerFunc(
+ func(p common.GetAllSubscriptionsParams) middleware.Responder {
if resp, err := getSubscription(); err == nil {
- return query.NewGetAllSubscriptionsOK().WithPayload(resp)
+ return common.NewGetAllSubscriptionsOK().WithPayload(resp)
}
- return query.NewGetAllSubscriptionsInternalServerError()
+ return common.NewGetAllSubscriptionsInternalServerError()
})
- // SubscriptionType: Report
- api.ReportSubscribeReportHandler = report.SubscribeReportHandlerFunc(
- func(p report.SubscribeReportParams) middleware.Responder {
- if resp, err := createSubscription(models.SubscriptionTypeReport, p.ReportParams); err == nil {
- return report.NewSubscribeReportCreated().WithPayload(resp)
+ // Subscription: Subscribe
+ api.CommonSubscribeHandler = common.SubscribeHandlerFunc(
+ func(params common.SubscribeParams) middleware.Responder {
+ Logger.Error("Subscribe: Params=%+v", params.SubscriptionParams)
+ if resp, err := createSubscription(params.SubscriptionParams); err == nil {
+ return common.NewSubscribeCreated().WithPayload(resp)
}
- return report.NewSubscribeReportInternalServerError()
+ return common.NewSubscribeInternalServerError()
})
- // SubscriptionType: Policy
- api.PolicySubscribePolicyHandler = policy.SubscribePolicyHandlerFunc(
- func(p policy.SubscribePolicyParams) middleware.Responder {
- if resp, err := createSubscription(models.SubscriptionTypePolicy, p.PolicyParams); err == nil {
- return policy.NewSubscribePolicyCreated().WithPayload(resp)
- }
- return policy.NewSubscribePolicyInternalServerError()
- })
-
- // SubscriptionType: Delete
+ // Subscription: Unsubscribe
api.CommonUnsubscribeHandler = common.UnsubscribeHandlerFunc(
func(p common.UnsubscribeParams) middleware.Responder {
+ Logger.Error("Unsubscribe: SubscriptionID=%+v", p.SubscriptionID)
if err := delSubscription(p.SubscriptionID); err == nil {
return common.NewUnsubscribeNoContent()
}
return common.NewUnsubscribeInternalServerError()
})
- // XApp: Get Config
- /*api.XappGetXappConfigListHandler = xapp.GetXappConfigListHandlerFunc(
- func(p xapp.GetXappConfigListParams) middleware.Responder {
- Logger.Info("Hitting xapp config")
- if resp,err := r.getXappConfig(); err == nil {
- return xapp.NewGetXappConfigListOK().WithPayload(resp)
- }
- return xapp.NewGetXappConfigListInternalServerError()
- })*/
-
server := restapi.NewServer(api)
defer server.Shutdown()
server.Host = r.localAddr
@@ -174,16 +149,14 @@
}
// Server interface: send notification to client
-func (r *Subscriber) Notify(resp *models.SubscriptionResponse, clientEndpoint string) (err error) {
+func (r *Subscriber) Notify(resp *models.SubscriptionResponse, ep models.SubscriptionParamsClientEndpoint) (err error) {
respData, err := json.Marshal(resp)
if err != nil {
Logger.Error("json.Marshal failed: %v", err)
return err
}
- ep, _, _ := net.SplitHostPort(clientEndpoint)
- _, port, _ := net.SplitHostPort(fmt.Sprintf(":%d", GetPortData("http").Port))
- clientUrl := fmt.Sprintf("http://%s:%s%s", ep, port, r.clientUrl)
+ clientUrl := fmt.Sprintf("http://%s:%d%s", ep.Host, *ep.HTTPPort, r.clientUrl)
retries := viper.GetInt("subscription.retryCount")
if retries == 0 {
@@ -218,21 +191,10 @@
r.clientCB = c
}
-// Subscription interface for xApp: REPORT
-func (r *Subscriber) SubscribeReport(p *apimodel.ReportParams) (*apimodel.SubscriptionResponse, error) {
- params := apireport.NewSubscribeReportParamsWithTimeout(r.timeout).WithReportParams(p)
- result, err := r.CreateTransport().Report.SubscribeReport(params)
- if err != nil {
- return &apimodel.SubscriptionResponse{}, err
- }
-
- return result.Payload, err
-}
-
-// Subscription interface for xApp: POLICY
-func (r *Subscriber) SubscribePolicy(p *apimodel.PolicyParams) (*apimodel.SubscriptionResponse, error) {
- params := apipolicy.NewSubscribePolicyParamsWithTimeout(r.timeout).WithPolicyParams(p)
- result, err := r.CreateTransport().Policy.SubscribePolicy(params)
+// Subscription interface for xApp
+func (r *Subscriber) Subscribe(p *apimodel.SubscriptionParams) (*apimodel.SubscriptionResponse, error) {
+ params := apicommon.NewSubscribeParamsWithTimeout(r.timeout).WithSubscriptionParams(p)
+ result, err := r.CreateTransport().Common.Subscribe(params)
if err != nil {
return &apimodel.SubscriptionResponse{}, err
}
@@ -241,7 +203,7 @@
}
// Subscription interface for xApp: DELETE
-func (r *Subscriber) UnSubscribe(subId string) error {
+func (r *Subscriber) Unsubscribe(subId string) error {
params := apicommon.NewUnsubscribeParamsWithTimeout(r.timeout).WithSubscriptionID(subId)
_, err := r.CreateTransport().Common.Unsubscribe(params)
diff --git a/pkg/xapp/subscription_test.go b/pkg/xapp/subscription_test.go
index 430b0a2..c7b00cd 100755
--- a/pkg/xapp/subscription_test.go
+++ b/pkg/xapp/subscription_test.go
@@ -8,82 +8,169 @@
import (
"fmt"
+ "testing"
+ "time"
+
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientmodel"
"gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/models"
"github.com/stretchr/testify/assert"
- "testing"
- "time"
)
-var suite *testing.T
+var (
+ suite *testing.T
-var meid = "gnb123456"
-var funId = int64(1)
-var clientEndpoint = "localhost:4560"
-var direction = int64(0)
-var procedureCode = int64(27)
-var typeOfMessage = int64(1)
+ meid = "gnb123456"
+ xappEventInstanceId = int64(1)
+ eventInstanceId = int64(1)
+ funId = int64(1)
+ actionId = int64(1)
+ actionType = "report"
+ subsequestActioType = "continue"
+ timeToWait = "w10ms"
+ direction = int64(0)
+ procedureCode = int64(27)
+ typeOfMessage = int64(1)
+ subscriptionId = ""
+ hPort = int64(8080)
+ rPort = int64(4560)
+ clientEndpoint = clientmodel.SubscriptionParamsClientEndpoint{Host: "localhost", HTTPPort: &hPort, RMRPort: &rPort}
+)
-var reportParams = clientmodel.ReportParams{
- Meid: meid,
- RANFunctionID: &funId,
- ClientEndpoint: &clientEndpoint,
- EventTriggers: clientmodel.EventTriggerList{
- &clientmodel.EventTrigger{
- InterfaceDirection: direction,
- ProcedureCode: procedureCode,
- TypeOfMessage: typeOfMessage,
- },
- },
+// Test cases
+func TestSetup(t *testing.T) {
+ suite = t
+
+ // Start the server to simulate SubManager
+ go Subscription.Listen(subscriptionHandler, queryHandler, deleteHandler)
+ time.Sleep(time.Duration(2) * time.Second)
}
-var policyParams = clientmodel.PolicyParams{
- Meid: &meid,
- RANFunctionID: &funId,
- ClientEndpoint: &clientEndpoint,
- EventTriggers: clientmodel.EventTriggerList{
- &clientmodel.EventTrigger{
- InterfaceDirection: direction,
- ProcedureCode: procedureCode,
- TypeOfMessage: typeOfMessage,
- },
- },
- PolicyActionDefinitions: &clientmodel.PolicyActionDefinition{},
+func TestSubscriptionQueryHandling(t *testing.T) {
+ resp, err := Subscription.QuerySubscriptions()
+
+ assert.Equal(t, err, nil)
+ assert.Equal(t, resp[0].SubscriptionID, int64(11))
+ assert.Equal(t, resp[0].Meid, "Test-Gnb")
+ assert.Equal(t, resp[0].ClientEndpoint, []string{"127.0.0.1:4056"})
}
+func TestSubscriptionHandling(t *testing.T) {
+ subscriptionParams := clientmodel.SubscriptionParams{
+ SubscriptionID: "",
+ Meid: &meid,
+ RANFunctionID: &funId,
+ ClientEndpoint: &clientEndpoint,
+ SubscriptionDetails: clientmodel.SubscriptionDetailsList{
+ &clientmodel.SubscriptionDetail{
+ XappEventInstanceID: &eventInstanceId,
+ EventTriggers: clientmodel.EventTriggerDefinition{00, 0x11, 0x12, 0x13, 0x00, 0x21, 0x22, 0x24, 0x1B, 0x80},
+ ActionToBeSetupList: clientmodel.ActionsToBeSetup{
+ &clientmodel.ActionToBeSetup{
+ ActionID: &actionId,
+ ActionType: &actionType,
+ ActionDefinition: clientmodel.ActionDefinition{5, 6, 7, 8},
+ SubsequentAction: &clientmodel.SubsequentAction{
+ SubsequentActionType: &subsequestActioType,
+ TimeToWait: &timeToWait,
+ },
+ },
+ },
+ },
+ },
+ }
+
+ Subscription.SetResponseCB(func(resp *clientmodel.SubscriptionResponse) {
+ assert.Equal(t, len(resp.SubscriptionInstances), 1)
+ assert.Equal(t, *resp.SubscriptionInstances[0].XappEventInstanceID, int64(11))
+ assert.Equal(t, *resp.SubscriptionInstances[0].E2EventInstanceID, int64(22))
+ })
+
+ _, err := Subscription.Subscribe(&subscriptionParams)
+ assert.Equal(t, err, nil)
+}
+
+func TestSubscriptionWithClientProvidedIdHandling(t *testing.T) {
+ subscriptionParams := clientmodel.SubscriptionParams{
+ SubscriptionID: "myxapp",
+ Meid: &meid,
+ RANFunctionID: &funId,
+ ClientEndpoint: &clientEndpoint,
+ SubscriptionDetails: clientmodel.SubscriptionDetailsList{
+ &clientmodel.SubscriptionDetail{
+ XappEventInstanceID: &eventInstanceId,
+ EventTriggers: clientmodel.EventTriggerDefinition{00, 0x11, 0x12, 0x13, 0x00, 0x21, 0x22, 0x24, 0x1B, 0x80},
+ ActionToBeSetupList: clientmodel.ActionsToBeSetup{
+ &clientmodel.ActionToBeSetup{
+ ActionID: &actionId,
+ ActionType: &actionType,
+ ActionDefinition: clientmodel.ActionDefinition{5, 6, 7, 8},
+ SubsequentAction: &clientmodel.SubsequentAction{
+ SubsequentActionType: &subsequestActioType,
+ TimeToWait: &timeToWait,
+ },
+ },
+ },
+ },
+ },
+ }
+
+ Subscription.SetResponseCB(func(resp *clientmodel.SubscriptionResponse) {
+ assert.Equal(t, len(resp.SubscriptionInstances), 1)
+ assert.Equal(t, *resp.SubscriptionInstances[0].XappEventInstanceID, int64(11))
+ assert.Equal(t, *resp.SubscriptionInstances[0].E2EventInstanceID, int64(22))
+ })
+
+ _, err := Subscription.Subscribe(&subscriptionParams)
+ assert.Equal(t, err, nil)
+}
+
+func TestSubscriptionDeleteHandling(t *testing.T) {
+ err := Subscription.Unsubscribe(subscriptionId)
+ fmt.Println(err)
+ assert.Equal(t, err, nil)
+}
+
+// Helper functions
func processSubscriptions(subscriptionId string) {
// Generate requestorId, instanceId
- reqId := int64(11)
- instanceId := int64(22)
+ xappInstanceId := int64(11)
+ e2InstanceId := int64(22)
resp := &models.SubscriptionResponse{
SubscriptionID: &subscriptionId,
SubscriptionInstances: []*models.SubscriptionInstance{
- {RequestorID: &reqId, InstanceID: &instanceId},
+ {
+ XappEventInstanceID: &xappInstanceId,
+ E2EventInstanceID: &e2InstanceId,
+ },
},
}
// Notify the client: don't worry about errors ... Notify() will handle retries, etc.
- Subscription.Notify(resp, clientEndpoint)
+ Subscription.Notify(resp, models.SubscriptionParamsClientEndpoint{Host: "localhost", HTTPPort: &hPort, RMRPort: &rPort})
}
-func subscriptionHandler(stype models.SubscriptionType, params interface{}) (*models.SubscriptionResponse, error) {
- switch stype {
- case models.SubscriptionTypeReport:
- p := params.(*models.ReportParams)
- assert.Equal(suite, meid, p.Meid)
- assert.Equal(suite, funId, *p.RANFunctionID)
- assert.Equal(suite, clientEndpoint, *p.ClientEndpoint)
- assert.Equal(suite, direction, p.EventTriggers[0].InterfaceDirection)
- assert.Equal(suite, procedureCode, p.EventTriggers[0].ProcedureCode)
- assert.Equal(suite, typeOfMessage, p.EventTriggers[0].TypeOfMessage)
- case models.SubscriptionTypePolicy:
- p := params.(*models.PolicyParams)
- assert.Equal(suite, clientEndpoint, *p.ClientEndpoint)
- }
+func subscriptionHandler(params interface{}) (*models.SubscriptionResponse, error) {
+ p := params.(*models.SubscriptionParams)
+
+ assert.Equal(suite, meid, *p.Meid)
+ assert.Equal(suite, funId, *p.RANFunctionID)
+ assert.Equal(suite, clientEndpoint.Host, p.ClientEndpoint.Host)
+ assert.Equal(suite, clientEndpoint.HTTPPort, p.ClientEndpoint.HTTPPort)
+ assert.Equal(suite, clientEndpoint.RMRPort, p.ClientEndpoint.RMRPort)
+
+ assert.Equal(suite, xappEventInstanceId, *p.SubscriptionDetails[0].XappEventInstanceID)
+ et := []int64{00, 0x11, 0x12, 0x13, 0x00, 0x21, 0x22, 0x24, 0x1B, 0x80}
+ assert.ElementsMatch(suite, et, p.SubscriptionDetails[0].EventTriggers)
+ assert.Equal(suite, actionId, *p.SubscriptionDetails[0].ActionToBeSetupList[0].ActionID)
+ assert.Equal(suite, actionType, *p.SubscriptionDetails[0].ActionToBeSetupList[0].ActionType)
+
+ assert.Equal(suite, subsequestActioType, *p.SubscriptionDetails[0].ActionToBeSetupList[0].SubsequentAction.SubsequentActionType)
+ assert.Equal(suite, timeToWait, *p.SubscriptionDetails[0].ActionToBeSetupList[0].SubsequentAction.TimeToWait)
+ assert.ElementsMatch(suite, []int64{5, 6, 7, 8}, p.SubscriptionDetails[0].ActionToBeSetupList[0].ActionDefinition)
// Generate a unique subscriptionId
- subscriptionId := fmt.Sprintf("%s-%s", meid, clientEndpoint)
+ subscriptionId = fmt.Sprintf("%s-%s", meid, clientEndpoint.Host)
// Process subscriptions on the background
go processSubscriptions(subscriptionId)
@@ -99,60 +186,13 @@
&models.SubscriptionData{
SubscriptionID: 11,
Meid: "Test-Gnb",
- Endpoint: []string{"127.0.0.1:4056"},
+ ClientEndpoint: []string{"127.0.0.1:4056"},
},
}
-
return resp, nil
}
func deleteHandler(ep string) error {
- assert.Equal(suite, clientEndpoint, ep)
-
+ assert.Equal(suite, subscriptionId, ep)
return nil
}
-
-func TestSetup(t *testing.T) {
- suite = t
-
- // Start the server to simulate SubManager
- go Subscription.Listen(subscriptionHandler, queryHandler, deleteHandler)
- time.Sleep(time.Duration(2) * time.Second)
-}
-
-func TestSubscriptionQueryHandling(t *testing.T) {
- resp, err := Subscription.QuerySubscriptions()
-
- assert.Equal(t, err, nil)
- assert.Equal(t, resp[0].SubscriptionID, int64(11))
- assert.Equal(t, resp[0].Meid, "Test-Gnb")
- assert.Equal(t, resp[0].Endpoint, []string{"127.0.0.1:4056"})
-}
-
-func TestSubscriptionReportHandling(t *testing.T) {
- Subscription.SetResponseCB(func(resp *clientmodel.SubscriptionResponse) {
- assert.Equal(t, len(resp.SubscriptionInstances), 1)
- assert.Equal(t, *resp.SubscriptionInstances[0].RequestorID, int64(11))
- assert.Equal(t, *resp.SubscriptionInstances[0].InstanceID, int64(22))
- })
-
- _, err := Subscription.SubscribeReport(&reportParams)
- assert.Equal(t, err, nil)
-}
-
-func TestSubscriptionPolicytHandling(t *testing.T) {
- Subscription.SetResponseCB(func(resp *clientmodel.SubscriptionResponse) {
- assert.Equal(t, len(resp.SubscriptionInstances), 1)
- assert.Equal(t, *resp.SubscriptionInstances[0].RequestorID, int64(11))
- assert.Equal(t, *resp.SubscriptionInstances[0].InstanceID, int64(22))
- })
-
- _, err := Subscription.SubscribePolicy(&policyParams)
- assert.Equal(t, err, nil)
-}
-
-func TestSubscriptionDeleteHandling(t *testing.T) {
- err := Subscription.UnSubscribe(clientEndpoint)
-
- assert.Equal(t, err, nil)
-}
diff --git a/pkg/xapp/xapp.go b/pkg/xapp/xapp.go
index 68d9045..06e3bfc 100755
--- a/pkg/xapp/xapp.go
+++ b/pkg/xapp/xapp.go
@@ -98,13 +98,13 @@
for {
time.Sleep(5 * time.Second)
if !IsHealthProbeReady() {
- Logger.Info("xApp is not ready yet, waiting ...")
+ Logger.Info("Application='%s' is not ready yet, waiting ...", viper.GetString("name"))
continue
}
- Logger.Info("xApp is now up and ready, continue with registration ...")
+ Logger.Debug("Application='%s' is now up and ready, continue with registration ...", viper.GetString("name"))
if err := doRegister(); err == nil {
- Logger.Info("xApp registration done, proceeding with startup ...")
+ Logger.Info("Registration done, proceeding with startup ...")
break
}
}
@@ -250,12 +250,15 @@
} else {
Logger.SetLevel(viper.GetInt("logger.level"))
}
- Logger.SetFormat(0)
+
+ if !viper.IsSet("controls.logger.noFormat") || !viper.GetBool("controls.logger.noFormat") {
+ Logger.SetFormat(0)
+ }
Resource = NewRouter()
Config = Configurator{}
Metric = NewMetrics(viper.GetString("metrics.url"), viper.GetString("metrics.namespace"), Resource.router)
- Subscription = NewSubscriber(viper.GetString("subscription.host"), viper.GetInt("subscription.timeout"))
+ Subscription = NewSubscriber(viper.GetString("controls.subscription.host"), viper.GetInt("controls.subscription.timeout"))
Sdl = NewSDLClient(viper.GetString("controls.db.namespace"))
Rnib = NewRNIBClient()
Util = NewUtils()