-swagger: '2.0'
+swagger: "2.0"
info:
description: This is the initial REST API for RIC subscription
version: 0.0.1
post:
tags:
- "report"
- summary: Subscribe a list of X2AP event triggers to receive "REPORT" messages sent by RAN
+ 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
consumes:
- application/json
'201':
description: Subscription successfully created
schema:
- $ref: '#/definitions/SubscriptionResult'
- '400':
- description: Invalid input
- '500':
- description: Internal error
- /subscriptions/control:
- post:
- tags:
- - "control"
- summary: Subscribe and send "CONTROL" message to RAN to initiate or resume call processing in RAN
- operationId: subscribeControl
- consumes:
- - application/json
- produces:
- - application/json
- parameters:
- - name: ControlParams
- in: body
- description: Subscription control parameters
- schema:
- $ref: '#/definitions/ControlParams'
- responses:
- '201':
- description: Subscription successfully created
- schema:
- $ref: '#/definitions/SubscriptionResult'
+ $ref: '#/definitions/SubscriptionResponse'
'400':
description: Invalid input
'500':
'201':
description: Subscription successfully created
schema:
- $ref: '#/definitions/SubscriptionResult'
+ $ref: '#/definitions/SubscriptionResponse'
'400':
description: Invalid input
'500':
parameters:
- name: subscriptionId
in: path
- description: The subscriptionId to be unsubscribed
+ description: The subscriptionId received in the Subscription Response
required: true
- type: integer
+ type: string
responses:
'204':
description: Operation done successfully
'400':
- description: Invalid requestorId supplied
+ description: Invalid subscriptionId supplied
'500':
description: Internal error
definitions:
SubscriptionType:
type: string
enum:
- - control
- insert
- policy
- report
ReportParams:
type: object
required:
- - RequestorId
+ - RANFunctionID
+ - ClientEndpoint
- EventTriggers
properties:
- RequestorId:
+ Meid:
+ type: string
+ RANFunctionID:
type: integer
+ ClientEndpoint:
+ type: string
EventTriggers:
$ref: '#/definitions/EventTriggerList'
+ ReportActionDefinitions:
+ $ref: '#/definitions/ReportActionDefinition'
EventTrigger:
type: object
- required:
- - InterfaceDirection
- - ProcedureCode
- - TypeOfMessage
properties:
InterfaceDirection:
type: integer
type: integer
TypeOfMessage:
type: integer
+ TriggerNature:
+ type: string
+ enum:
+ - now
+ - on change
PlmnId:
type: string
ENBId:
- type: integer
+ type: string
EventTriggerList:
type: array
items:
$ref: '#/definitions/EventTrigger'
- SubscriptionResult:
- type: array
- description: A list of unique IDs
- items:
- type: integer
- ControlParams:
+ ActionParameters:
+ type: object
+ required:
+ - ActionParameterID
+ - ActionParameterValue
+ properties:
+ ActionParameterID:
+ type: integer
+ ActionParameterValue:
+ type: boolean
+ Format1ActionDefinition:
type: object
+ required:
+ - StyleID
+ - ActionParameters
properties:
- RequestorId:
+ StyleID:
type: integer
- TBD:
- type: string
+ ActionParameters:
+ type: array
+ items:
+ $ref: '#/definitions/ActionParameters'
+ ReportActionDefinition:
+ type: object
+ properties:
+ ActionDefinitionFormat1:
+ $ref: '#/definitions/Format1ActionDefinition'
PolicyParams:
type: object
+ required:
+ - Meid
+ - RANFunctionID
+ - ClientEndpoint
+ - EventTriggers
+ - PolicyActionDefinitions
properties:
- RequestorId:
+ 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
- TBD:
+ SubscriptionResponseItem:
+ type: object
+ required:
+ - SubscriptionId
+ - RequestorId
+ - InstanceId
+ properties:
+ SubscriptionId:
type: string
+ RequestorId:
+ type: integer
+ InstanceId:
+ type: integer
+ SubscriptionResponse:
+ type: array
+ items:
+ $ref: '#/definitions/SubscriptionResponseItem'
SubscriptionData:
type: object
properties:
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime"
cr "github.com/go-openapi/runtime/client"
- "github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
type UnsubscribeParams struct {
/*SubscriptionID
- The subscriptionId to be unsubscribed
+ The subscriptionId received in the Subscription Response
*/
- SubscriptionID int64
+ SubscriptionID string
timeout time.Duration
Context context.Context
}
// WithSubscriptionID adds the subscriptionID to the unsubscribe params
-func (o *UnsubscribeParams) WithSubscriptionID(subscriptionID int64) *UnsubscribeParams {
+func (o *UnsubscribeParams) WithSubscriptionID(subscriptionID string) *UnsubscribeParams {
o.SetSubscriptionID(subscriptionID)
return o
}
// SetSubscriptionID adds the subscriptionId to the unsubscribe params
-func (o *UnsubscribeParams) SetSubscriptionID(subscriptionID int64) {
+func (o *UnsubscribeParams) SetSubscriptionID(subscriptionID string) {
o.SubscriptionID = subscriptionID
}
var res []error
// path param subscriptionId
- if err := r.SetPathParam("subscriptionId", swag.FormatInt64(o.SubscriptionID)); err != nil {
+ if err := r.SetPathParam("subscriptionId", o.SubscriptionID); err != nil {
return err
}
/*UnsubscribeBadRequest handles this case with default header values.
-Invalid requestorId supplied
+Invalid subscriptionId supplied
*/
type UnsubscribeBadRequest struct {
}
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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 control API client.
-func New(transport runtime.ClientTransport, formats strfmt.Registry) *Client {
- return &Client{transport: transport, formats: formats}
-}
-
-/*
-Client for control API
-*/
-type Client struct {
- transport runtime.ClientTransport
- formats strfmt.Registry
-}
-
-/*
-SubscribeControl subscribes and send c o n t r o l message to r a n to initiate or resume call processing in r a n
-*/
-func (a *Client) SubscribeControl(params *SubscribeControlParams) (*SubscribeControlCreated, error) {
- // TODO: Validate the params before sending
- if params == nil {
- params = NewSubscribeControlParams()
- }
-
- result, err := a.transport.Submit(&runtime.ClientOperation{
- ID: "subscribeControl",
- Method: "POST",
- PathPattern: "/subscriptions/control",
- ProducesMediaTypes: []string{"application/json"},
- ConsumesMediaTypes: []string{"application/json"},
- Schemes: []string{"http"},
- Params: params,
- Reader: &SubscribeControlReader{formats: a.formats},
- Context: params.Context,
- Client: params.HTTPClient,
- })
- if err != nil {
- return nil, err
- }
- return result.(*SubscribeControlCreated), nil
-
-}
-
-// SetTransport changes the transport on the client
-func (a *Client) SetTransport(transport runtime.ClientTransport) {
- a.transport = transport
-}
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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"
-)
-
-// NewSubscribeControlParams creates a new SubscribeControlParams object
-// with the default values initialized.
-func NewSubscribeControlParams() *SubscribeControlParams {
- var ()
- return &SubscribeControlParams{
-
- timeout: cr.DefaultTimeout,
- }
-}
-
-// NewSubscribeControlParamsWithTimeout creates a new SubscribeControlParams object
-// with the default values initialized, and the ability to set a timeout on a request
-func NewSubscribeControlParamsWithTimeout(timeout time.Duration) *SubscribeControlParams {
- var ()
- return &SubscribeControlParams{
-
- timeout: timeout,
- }
-}
-
-// NewSubscribeControlParamsWithContext creates a new SubscribeControlParams object
-// with the default values initialized, and the ability to set a context for a request
-func NewSubscribeControlParamsWithContext(ctx context.Context) *SubscribeControlParams {
- var ()
- return &SubscribeControlParams{
-
- Context: ctx,
- }
-}
-
-// NewSubscribeControlParamsWithHTTPClient creates a new SubscribeControlParams object
-// with the default values initialized, and the ability to set a custom HTTPClient for a request
-func NewSubscribeControlParamsWithHTTPClient(client *http.Client) *SubscribeControlParams {
- var ()
- return &SubscribeControlParams{
- HTTPClient: client,
- }
-}
-
-/*SubscribeControlParams contains all the parameters to send to the API endpoint
-for the subscribe control operation typically these are written to a http.Request
-*/
-type SubscribeControlParams struct {
-
- /*ControlParams
- Subscription control parameters
-
- */
- ControlParams *clientmodel.ControlParams
-
- timeout time.Duration
- Context context.Context
- HTTPClient *http.Client
-}
-
-// WithTimeout adds the timeout to the subscribe control params
-func (o *SubscribeControlParams) WithTimeout(timeout time.Duration) *SubscribeControlParams {
- o.SetTimeout(timeout)
- return o
-}
-
-// SetTimeout adds the timeout to the subscribe control params
-func (o *SubscribeControlParams) SetTimeout(timeout time.Duration) {
- o.timeout = timeout
-}
-
-// WithContext adds the context to the subscribe control params
-func (o *SubscribeControlParams) WithContext(ctx context.Context) *SubscribeControlParams {
- o.SetContext(ctx)
- return o
-}
-
-// SetContext adds the context to the subscribe control params
-func (o *SubscribeControlParams) SetContext(ctx context.Context) {
- o.Context = ctx
-}
-
-// WithHTTPClient adds the HTTPClient to the subscribe control params
-func (o *SubscribeControlParams) WithHTTPClient(client *http.Client) *SubscribeControlParams {
- o.SetHTTPClient(client)
- return o
-}
-
-// SetHTTPClient adds the HTTPClient to the subscribe control params
-func (o *SubscribeControlParams) SetHTTPClient(client *http.Client) {
- o.HTTPClient = client
-}
-
-// WithControlParams adds the controlParams to the subscribe control params
-func (o *SubscribeControlParams) WithControlParams(controlParams *clientmodel.ControlParams) *SubscribeControlParams {
- o.SetControlParams(controlParams)
- return o
-}
-
-// SetControlParams adds the controlParams to the subscribe control params
-func (o *SubscribeControlParams) SetControlParams(controlParams *clientmodel.ControlParams) {
- o.ControlParams = controlParams
-}
-
-// WriteToRequest writes these params to a swagger request
-func (o *SubscribeControlParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error {
-
- if err := r.SetTimeout(o.timeout); err != nil {
- return err
- }
- var res []error
-
- if o.ControlParams != nil {
- if err := r.SetBodyParam(o.ControlParams); err != nil {
- return err
- }
- }
-
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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"
-)
-
-// SubscribeControlReader is a Reader for the SubscribeControl structure.
-type SubscribeControlReader struct {
- formats strfmt.Registry
-}
-
-// ReadResponse reads a server response into the received o.
-func (o *SubscribeControlReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) {
- switch response.Code() {
-
- case 201:
- result := NewSubscribeControlCreated()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return result, nil
-
- case 400:
- result := NewSubscribeControlBadRequest()
- if err := result.readResponse(response, consumer, o.formats); err != nil {
- return nil, err
- }
- return nil, result
-
- case 500:
- result := NewSubscribeControlInternalServerError()
- 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())
- }
-}
-
-// NewSubscribeControlCreated creates a SubscribeControlCreated with default headers values
-func NewSubscribeControlCreated() *SubscribeControlCreated {
- return &SubscribeControlCreated{}
-}
-
-/*SubscribeControlCreated handles this case with default header values.
-
-Subscription successfully created
-*/
-type SubscribeControlCreated struct {
- Payload clientmodel.SubscriptionResult
-}
-
-func (o *SubscribeControlCreated) Error() string {
- return fmt.Sprintf("[POST /subscriptions/control][%d] subscribeControlCreated %+v", 201, o.Payload)
-}
-
-func (o *SubscribeControlCreated) 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
-}
-
-// NewSubscribeControlBadRequest creates a SubscribeControlBadRequest with default headers values
-func NewSubscribeControlBadRequest() *SubscribeControlBadRequest {
- return &SubscribeControlBadRequest{}
-}
-
-/*SubscribeControlBadRequest handles this case with default header values.
-
-Invalid input
-*/
-type SubscribeControlBadRequest struct {
-}
-
-func (o *SubscribeControlBadRequest) Error() string {
- return fmt.Sprintf("[POST /subscriptions/control][%d] subscribeControlBadRequest ", 400)
-}
-
-func (o *SubscribeControlBadRequest) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- return nil
-}
-
-// NewSubscribeControlInternalServerError creates a SubscribeControlInternalServerError with default headers values
-func NewSubscribeControlInternalServerError() *SubscribeControlInternalServerError {
- return &SubscribeControlInternalServerError{}
-}
-
-/*SubscribeControlInternalServerError handles this case with default header values.
-
-Internal error
-*/
-type SubscribeControlInternalServerError struct {
-}
-
-func (o *SubscribeControlInternalServerError) Error() string {
- return fmt.Sprintf("[POST /subscriptions/control][%d] subscribeControlInternalServerError ", 500)
-}
-
-func (o *SubscribeControlInternalServerError) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error {
-
- return nil
-}
Subscription successfully created
*/
type SubscribePolicyCreated struct {
- Payload clientmodel.SubscriptionResult
+ Payload clientmodel.SubscriptionResponse
}
func (o *SubscribePolicyCreated) Error() string {
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/control"
"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"
cli.Common = common.New(transport, formats)
- cli.Control = control.New(transport, formats)
-
cli.Policy = policy.New(transport, formats)
cli.Query = query.New(transport, formats)
type RICSubscription struct {
Common *common.Client
- Control *control.Client
-
Policy *policy.Client
Query *query.Client
c.Common.SetTransport(transport)
- c.Control.SetTransport(transport)
-
c.Policy.SetTransport(transport)
c.Query.SetTransport(transport)
}
/*
-SubscribeReport subscribes a list of x2 a p event triggers to receive r e p o r t messages sent by r a n
+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
Subscription successfully created
*/
type SubscribeReportCreated struct {
- Payload clientmodel.SubscriptionResult
+ Payload clientmodel.SubscriptionResponse
}
func (o *SubscribeReportCreated) Error() string {
--- /dev/null
+// 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
+}
+++ /dev/null
-// 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/swag"
-)
-
-// ControlParams control params
-// swagger:model ControlParams
-type ControlParams struct {
-
- // requestor Id
- RequestorID int64 `json:"RequestorId,omitempty"`
-
- // t b d
- TBD string `json:"TBD,omitempty"`
-}
-
-// Validate validates this control params
-func (m *ControlParams) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ControlParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ControlParams) UnmarshalBinary(b []byte) error {
- var res ControlParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
// 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"
type EventTrigger struct {
// e n b Id
- ENBID int64 `json:"ENBId,omitempty"`
+ ENBID string `json:"ENBId,omitempty"`
// interface direction
- // Required: true
- InterfaceDirection *int64 `json:"InterfaceDirection"`
+ InterfaceDirection int64 `json:"InterfaceDirection,omitempty"`
// plmn Id
PlmnID string `json:"PlmnId,omitempty"`
// procedure code
- // Required: true
- ProcedureCode *int64 `json:"ProcedureCode"`
+ ProcedureCode int64 `json:"ProcedureCode,omitempty"`
+
+ // trigger nature
+ // Enum: [now on change]
+ TriggerNature string `json:"TriggerNature,omitempty"`
// type of message
- // Required: true
- TypeOfMessage *int64 `json:"TypeOfMessage"`
+ TypeOfMessage int64 `json:"TypeOfMessage,omitempty"`
}
// Validate validates this event trigger
func (m *EventTrigger) Validate(formats strfmt.Registry) error {
var res []error
- if err := m.validateInterfaceDirection(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateProcedureCode(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTypeOfMessage(formats); err != nil {
+ if err := m.validateTriggerNature(formats); err != nil {
res = append(res, err)
}
return nil
}
-func (m *EventTrigger) validateInterfaceDirection(formats strfmt.Registry) error {
+var eventTriggerTypeTriggerNaturePropEnum []interface{}
- if err := validate.Required("InterfaceDirection", "body", m.InterfaceDirection); err != nil {
- return err
+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)
}
-
- return nil
}
-func (m *EventTrigger) validateProcedureCode(formats strfmt.Registry) error {
+const (
- if err := validate.Required("ProcedureCode", "body", m.ProcedureCode); err != nil {
+ // 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) validateTypeOfMessage(formats strfmt.Registry) error {
+func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.TriggerNature) { // not required
+ return nil
+ }
- if err := validate.Required("TypeOfMessage", "body", m.TypeOfMessage); err != nil {
+ // value enum
+ if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil {
return err
}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
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 {
- // requestor Id
- RequestorID int64 `json:"RequestorId,omitempty"`
+ // client endpoint
+ // Required: true
+ ClientEndpoint *string `json:"ClientEndpoint"`
- // t b d
- TBD string `json:"TBD,omitempty"`
+ // 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
}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
// swagger:model ReportParams
type ReportParams struct {
+ // client endpoint
+ // Required: true
+ ClientEndpoint *string `json:"ClientEndpoint"`
+
// event triggers
// Required: true
EventTriggers EventTriggerList `json:"EventTriggers"`
- // requestor Id
+ // meid
+ Meid string `json:"Meid,omitempty"`
+
+ // r a n function ID
// Required: true
- RequestorID *int64 `json:"RequestorId"`
+ 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.validateRequestorID(formats); err != nil {
+ if err := m.validateRANFunctionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateReportActionDefinitions(formats); err != nil {
res = append(res, err)
}
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 nil
}
-func (m *ReportParams) validateRequestorID(formats strfmt.Registry) error {
+func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error {
- if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
+ 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 {
--- /dev/null
+// 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"
+)
+
+// SubscriptionResponse subscription response
+// swagger:model SubscriptionResponse
+type SubscriptionResponse []*SubscriptionResponseItem
+
+// Validate validates this subscription response
+func (m SubscriptionResponse) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ for i := 0; i < len(m); i++ {
+ if swag.IsZero(m[i]) { // not required
+ continue
+ }
+
+ if m[i] != nil {
+ if err := m[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName(strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
--- /dev/null
+// 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
+}
+++ /dev/null
-// 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"
-)
-
-// SubscriptionResult A list of unique IDs
-// swagger:model SubscriptionResult
-type SubscriptionResult []int64
-
-// Validate validates this subscription result
-func (m SubscriptionResult) Validate(formats strfmt.Registry) error {
- return nil
-}
const (
- // SubscriptionTypeControl captures enum value "control"
- SubscriptionTypeControl SubscriptionType = "control"
-
// SubscriptionTypeInsert captures enum value "insert"
SubscriptionTypeInsert SubscriptionType = "insert"
func init() {
var res []SubscriptionType
- if err := json.Unmarshal([]byte(`["control","insert","policy","report"]`), &res); err != nil {
+ if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
--- /dev/null
+// 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
+}
+++ /dev/null
-// 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/swag"
-)
-
-// ControlParams control params
-// swagger:model ControlParams
-type ControlParams struct {
-
- // requestor Id
- RequestorID int64 `json:"RequestorId,omitempty"`
-
- // t b d
- TBD string `json:"TBD,omitempty"`
-}
-
-// Validate validates this control params
-func (m *ControlParams) Validate(formats strfmt.Registry) error {
- return nil
-}
-
-// MarshalBinary interface implementation
-func (m *ControlParams) MarshalBinary() ([]byte, error) {
- if m == nil {
- return nil, nil
- }
- return swag.WriteJSON(m)
-}
-
-// UnmarshalBinary interface implementation
-func (m *ControlParams) UnmarshalBinary(b []byte) error {
- var res ControlParams
- if err := swag.ReadJSON(b, &res); err != nil {
- return err
- }
- *m = res
- return nil
-}
// 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"
type EventTrigger struct {
// e n b Id
- ENBID int64 `json:"ENBId,omitempty"`
+ ENBID string `json:"ENBId,omitempty"`
// interface direction
- // Required: true
- InterfaceDirection *int64 `json:"InterfaceDirection"`
+ InterfaceDirection int64 `json:"InterfaceDirection,omitempty"`
// plmn Id
PlmnID string `json:"PlmnId,omitempty"`
// procedure code
- // Required: true
- ProcedureCode *int64 `json:"ProcedureCode"`
+ ProcedureCode int64 `json:"ProcedureCode,omitempty"`
+
+ // trigger nature
+ // Enum: [now on change]
+ TriggerNature string `json:"TriggerNature,omitempty"`
// type of message
- // Required: true
- TypeOfMessage *int64 `json:"TypeOfMessage"`
+ TypeOfMessage int64 `json:"TypeOfMessage,omitempty"`
}
// Validate validates this event trigger
func (m *EventTrigger) Validate(formats strfmt.Registry) error {
var res []error
- if err := m.validateInterfaceDirection(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateProcedureCode(formats); err != nil {
- res = append(res, err)
- }
-
- if err := m.validateTypeOfMessage(formats); err != nil {
+ if err := m.validateTriggerNature(formats); err != nil {
res = append(res, err)
}
return nil
}
-func (m *EventTrigger) validateInterfaceDirection(formats strfmt.Registry) error {
+var eventTriggerTypeTriggerNaturePropEnum []interface{}
- if err := validate.Required("InterfaceDirection", "body", m.InterfaceDirection); err != nil {
- return err
+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)
}
-
- return nil
}
-func (m *EventTrigger) validateProcedureCode(formats strfmt.Registry) error {
+const (
- if err := validate.Required("ProcedureCode", "body", m.ProcedureCode); err != nil {
+ // 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) validateTypeOfMessage(formats strfmt.Registry) error {
+func (m *EventTrigger) validateTriggerNature(formats strfmt.Registry) error {
+
+ if swag.IsZero(m.TriggerNature) { // not required
+ return nil
+ }
- if err := validate.Required("TypeOfMessage", "body", m.TypeOfMessage); err != nil {
+ // value enum
+ if err := m.validateTriggerNatureEnum("TriggerNature", "body", m.TriggerNature); err != nil {
return err
}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
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 {
- // requestor Id
- RequestorID int64 `json:"RequestorId,omitempty"`
+ // client endpoint
+ // Required: true
+ ClientEndpoint *string `json:"ClientEndpoint"`
- // t b d
- TBD string `json:"TBD,omitempty"`
+ // 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
}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
--- /dev/null
+// 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
+}
// swagger:model ReportParams
type ReportParams struct {
+ // client endpoint
+ // Required: true
+ ClientEndpoint *string `json:"ClientEndpoint"`
+
// event triggers
// Required: true
EventTriggers EventTriggerList `json:"EventTriggers"`
- // requestor Id
+ // meid
+ Meid string `json:"Meid,omitempty"`
+
+ // r a n function ID
// Required: true
- RequestorID *int64 `json:"RequestorId"`
+ 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.validateRequestorID(formats); err != nil {
+ if err := m.validateRANFunctionID(formats); err != nil {
+ res = append(res, err)
+ }
+
+ if err := m.validateReportActionDefinitions(formats); err != nil {
res = append(res, err)
}
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 nil
}
-func (m *ReportParams) validateRequestorID(formats strfmt.Registry) error {
+func (m *ReportParams) validateRANFunctionID(formats strfmt.Registry) error {
- if err := validate.Required("RequestorId", "body", m.RequestorID); err != nil {
+ 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 {
--- /dev/null
+// 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"
+)
+
+// SubscriptionResponse subscription response
+// swagger:model SubscriptionResponse
+type SubscriptionResponse []*SubscriptionResponseItem
+
+// Validate validates this subscription response
+func (m SubscriptionResponse) Validate(formats strfmt.Registry) error {
+ var res []error
+
+ for i := 0; i < len(m); i++ {
+ if swag.IsZero(m[i]) { // not required
+ continue
+ }
+
+ if m[i] != nil {
+ if err := m[i].Validate(formats); err != nil {
+ if ve, ok := err.(*errors.Validation); ok {
+ return ve.ValidateName(strconv.Itoa(i))
+ }
+ return err
+ }
+ }
+
+ }
+
+ if len(res) > 0 {
+ return errors.CompositeValidationError(res...)
+ }
+ return nil
+}
--- /dev/null
+// 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
+}
+++ /dev/null
-// 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"
-)
-
-// SubscriptionResult A list of unique IDs
-// swagger:model SubscriptionResult
-type SubscriptionResult []int64
-
-// Validate validates this subscription result
-func (m SubscriptionResult) Validate(formats strfmt.Registry) error {
- return nil
-}
const (
- // SubscriptionTypeControl captures enum value "control"
- SubscriptionTypeControl SubscriptionType = "control"
-
// SubscriptionTypeInsert captures enum value "insert"
SubscriptionTypeInsert SubscriptionType = "insert"
func init() {
var res []SubscriptionType
- if err := json.Unmarshal([]byte(`["control","insert","policy","report"]`), &res); err != nil {
+ if err := json.Unmarshal([]byte(`["insert","policy","report"]`), &res); err != nil {
panic(err)
}
for _, v := range res {
"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/control"
"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"
)
return middleware.NotImplemented("operation common.Unsubscribe has not yet been implemented")
})
}
- if api.ControlSubscribeControlHandler == nil {
- api.ControlSubscribeControlHandler = control.SubscribeControlHandlerFunc(func(params control.SubscribeControlParams) middleware.Responder {
- return middleware.NotImplemented("operation control.SubscribeControl 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.PolicySubscribePolicyHandler == nil {
}
}
},
- "/subscriptions/control": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "control"
- ],
- "summary": "Subscribe and send \"CONTROL\" message to RAN to initiate or resume call processing in RAN",
- "operationId": "subscribeControl",
- "parameters": [
- {
- "description": "Subscription control parameters",
- "name": "ControlParams",
- "in": "body",
- "schema": {
- "$ref": "#/definitions/ControlParams"
- }
- }
- ],
- "responses": {
- "201": {
- "description": "Subscription successfully created",
- "schema": {
- "$ref": "#/definitions/SubscriptionResult"
- }
- },
- "400": {
- "description": "Invalid input"
- },
- "500": {
- "description": "Internal error"
- }
- }
- }
- },
"/subscriptions/policy": {
"post": {
"consumes": [
"201": {
"description": "Subscription successfully created",
"schema": {
- "$ref": "#/definitions/SubscriptionResult"
+ "$ref": "#/definitions/SubscriptionResponse"
}
},
"400": {
"tags": [
"report"
],
- "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN",
+ "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": [
{
"201": {
"description": "Subscription successfully created",
"schema": {
- "$ref": "#/definitions/SubscriptionResult"
+ "$ref": "#/definitions/SubscriptionResponse"
}
},
"400": {
"operationId": "Unsubscribe",
"parameters": [
{
- "type": "integer",
- "description": "The subscriptionId to be unsubscribed",
+ "type": "string",
+ "description": "The subscriptionId received in the Subscription Response",
"name": "subscriptionId",
"in": "path",
"required": true
"description": "Operation done successfully"
},
"400": {
- "description": "Invalid requestorId supplied"
+ "description": "Invalid subscriptionId supplied"
},
"500": {
"description": "Internal error"
}
},
"definitions": {
- "ControlParams": {
+ "ActionParameters": {
"type": "object",
+ "required": [
+ "ActionParameterID",
+ "ActionParameterValue"
+ ],
"properties": {
- "RequestorId": {
+ "ActionParameterID": {
"type": "integer"
},
- "TBD": {
- "type": "string"
+ "ActionParameterValue": {
+ "type": "boolean"
}
}
},
"EventTrigger": {
"type": "object",
- "required": [
- "InterfaceDirection",
- "ProcedureCode",
- "TypeOfMessage"
- ],
"properties": {
"ENBId": {
- "type": "integer"
+ "type": "string"
},
"InterfaceDirection": {
"type": "integer"
"ProcedureCode": {
"type": "integer"
},
+ "TriggerNature": {
+ "type": "string",
+ "enum": [
+ "now",
+ "on change"
+ ]
+ },
"TypeOfMessage": {
"type": "integer"
}
"$ref": "#/definitions/EventTrigger"
}
},
- "PolicyParams": {
+ "Format1ActionDefinition": {
"type": "object",
+ "required": [
+ "StyleID",
+ "ActionParameters"
+ ],
"properties": {
- "RequestorId": {
+ "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"
},
- "TBD": {
+ "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": [
- "RequestorId",
+ "RANFunctionID",
+ "ClientEndpoint",
"EventTriggers"
],
"properties": {
+ "ClientEndpoint": {
+ "type": "string"
+ },
"EventTriggers": {
"$ref": "#/definitions/EventTriggerList"
},
- "RequestorId": {
+ "Meid": {
+ "type": "string"
+ },
+ "RANFunctionID": {
"type": "integer"
+ },
+ "ReportActionDefinitions": {
+ "$ref": "#/definitions/ReportActionDefinition"
}
}
},
"$ref": "#/definitions/SubscriptionData"
}
},
- "SubscriptionResult": {
- "description": "A list of unique IDs",
+ "SubscriptionResponse": {
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/SubscriptionResponseItem"
+ }
+ },
+ "SubscriptionResponseItem": {
+ "type": "object",
+ "required": [
+ "SubscriptionId",
+ "RequestorId",
+ "InstanceId"
+ ],
+ "properties": {
+ "InstanceId": {
+ "type": "integer"
+ },
+ "RequestorId": {
+ "type": "integer"
+ },
+ "SubscriptionId": {
+ "type": "string"
+ }
}
},
"SubscriptionType": {
"type": "string",
"enum": [
- "control",
"insert",
"policy",
"report"
}
}
},
- "/subscriptions/control": {
- "post": {
- "consumes": [
- "application/json"
- ],
- "produces": [
- "application/json"
- ],
- "tags": [
- "control"
- ],
- "summary": "Subscribe and send \"CONTROL\" message to RAN to initiate or resume call processing in RAN",
- "operationId": "subscribeControl",
- "parameters": [
- {
- "description": "Subscription control parameters",
- "name": "ControlParams",
- "in": "body",
- "schema": {
- "$ref": "#/definitions/ControlParams"
- }
- }
- ],
- "responses": {
- "201": {
- "description": "Subscription successfully created",
- "schema": {
- "$ref": "#/definitions/SubscriptionResult"
- }
- },
- "400": {
- "description": "Invalid input"
- },
- "500": {
- "description": "Internal error"
- }
- }
- }
- },
"/subscriptions/policy": {
"post": {
"consumes": [
"201": {
"description": "Subscription successfully created",
"schema": {
- "$ref": "#/definitions/SubscriptionResult"
+ "$ref": "#/definitions/SubscriptionResponse"
}
},
"400": {
"tags": [
"report"
],
- "summary": "Subscribe a list of X2AP event triggers to receive \"REPORT\" messages sent by RAN",
+ "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": [
{
"201": {
"description": "Subscription successfully created",
"schema": {
- "$ref": "#/definitions/SubscriptionResult"
+ "$ref": "#/definitions/SubscriptionResponse"
}
},
"400": {
"operationId": "Unsubscribe",
"parameters": [
{
- "type": "integer",
- "description": "The subscriptionId to be unsubscribed",
+ "type": "string",
+ "description": "The subscriptionId received in the Subscription Response",
"name": "subscriptionId",
"in": "path",
"required": true
"description": "Operation done successfully"
},
"400": {
- "description": "Invalid requestorId supplied"
+ "description": "Invalid subscriptionId supplied"
},
"500": {
"description": "Internal error"
}
},
"definitions": {
- "ControlParams": {
+ "ActionParameters": {
"type": "object",
+ "required": [
+ "ActionParameterID",
+ "ActionParameterValue"
+ ],
"properties": {
- "RequestorId": {
+ "ActionParameterID": {
"type": "integer"
},
- "TBD": {
- "type": "string"
+ "ActionParameterValue": {
+ "type": "boolean"
}
}
},
"EventTrigger": {
"type": "object",
- "required": [
- "InterfaceDirection",
- "ProcedureCode",
- "TypeOfMessage"
- ],
"properties": {
"ENBId": {
- "type": "integer"
+ "type": "string"
},
"InterfaceDirection": {
"type": "integer"
"ProcedureCode": {
"type": "integer"
},
+ "TriggerNature": {
+ "type": "string",
+ "enum": [
+ "now",
+ "on change"
+ ]
+ },
"TypeOfMessage": {
"type": "integer"
}
"$ref": "#/definitions/EventTrigger"
}
},
- "PolicyParams": {
+ "Format1ActionDefinition": {
"type": "object",
+ "required": [
+ "StyleID",
+ "ActionParameters"
+ ],
"properties": {
- "RequestorId": {
+ "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"
},
- "TBD": {
+ "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": [
- "RequestorId",
+ "RANFunctionID",
+ "ClientEndpoint",
"EventTriggers"
],
"properties": {
+ "ClientEndpoint": {
+ "type": "string"
+ },
"EventTriggers": {
"$ref": "#/definitions/EventTriggerList"
},
- "RequestorId": {
+ "Meid": {
+ "type": "string"
+ },
+ "RANFunctionID": {
"type": "integer"
+ },
+ "ReportActionDefinitions": {
+ "$ref": "#/definitions/ReportActionDefinition"
}
}
},
"$ref": "#/definitions/SubscriptionData"
}
},
- "SubscriptionResult": {
- "description": "A list of unique IDs",
+ "SubscriptionResponse": {
"type": "array",
"items": {
- "type": "integer"
+ "$ref": "#/definitions/SubscriptionResponseItem"
+ }
+ },
+ "SubscriptionResponseItem": {
+ "type": "object",
+ "required": [
+ "SubscriptionId",
+ "RequestorId",
+ "InstanceId"
+ ],
+ "properties": {
+ "InstanceId": {
+ "type": "integer"
+ },
+ "RequestorId": {
+ "type": "integer"
+ },
+ "SubscriptionId": {
+ "type": "string"
+ }
}
},
"SubscriptionType": {
"type": "string",
"enum": [
- "control",
"insert",
"policy",
"report"
"github.com/go-openapi/errors"
"github.com/go-openapi/runtime/middleware"
- "github.com/go-openapi/swag"
strfmt "github.com/go-openapi/strfmt"
)
// HTTP Request Object
HTTPRequest *http.Request `json:"-"`
- /*The subscriptionId to be unsubscribed
+ /*The subscriptionId received in the Subscription Response
Required: true
In: path
*/
- SubscriptionID int64
+ SubscriptionID string
}
// BindRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
// Required: true
// Parameter is provided by construction from the route
- value, err := swag.ConvertInt64(raw)
- if err != nil {
- return errors.InvalidType("subscriptionId", "path", "int64", raw)
- }
- o.SubscriptionID = value
+ o.SubscriptionID = raw
return nil
}
// UnsubscribeBadRequestCode is the HTTP code returned for type UnsubscribeBadRequest
const UnsubscribeBadRequestCode int = 400
-/*UnsubscribeBadRequest Invalid requestorId supplied
+/*UnsubscribeBadRequest Invalid subscriptionId supplied
swagger:response unsubscribeBadRequest
*/
"net/url"
golangswaggerpaths "path"
"strings"
-
- "github.com/go-openapi/swag"
)
// UnsubscribeURL generates an URL for the unsubscribe operation
type UnsubscribeURL struct {
- SubscriptionID int64
+ SubscriptionID string
_basePath string
// avoid unkeyed usage
var _path = "/subscriptions/{subscriptionId}"
- subscriptionID := swag.FormatInt64(o.SubscriptionID)
+ subscriptionID := o.SubscriptionID
if subscriptionID != "" {
_path = strings.Replace(_path, "{subscriptionId}", subscriptionID, -1)
} else {
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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"
-)
-
-// SubscribeControlHandlerFunc turns a function with the right signature into a subscribe control handler
-type SubscribeControlHandlerFunc func(SubscribeControlParams) middleware.Responder
-
-// Handle executing the request and returning a response
-func (fn SubscribeControlHandlerFunc) Handle(params SubscribeControlParams) middleware.Responder {
- return fn(params)
-}
-
-// SubscribeControlHandler interface for that can handle valid subscribe control params
-type SubscribeControlHandler interface {
- Handle(SubscribeControlParams) middleware.Responder
-}
-
-// NewSubscribeControl creates a new http.Handler for the subscribe control operation
-func NewSubscribeControl(ctx *middleware.Context, handler SubscribeControlHandler) *SubscribeControl {
- return &SubscribeControl{Context: ctx, Handler: handler}
-}
-
-/*SubscribeControl swagger:route POST /subscriptions/control control subscribeControl
-
-Subscribe and send "CONTROL" message to RAN to initiate or resume call processing in RAN
-
-*/
-type SubscribeControl struct {
- Context *middleware.Context
- Handler SubscribeControlHandler
-}
-
-func (o *SubscribeControl) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
- route, rCtx, _ := o.Context.RouteInfo(r)
- if rCtx != nil {
- r = rCtx
- }
- var Params = NewSubscribeControlParams()
-
- 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)
-
-}
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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"
-)
-
-// NewSubscribeControlParams creates a new SubscribeControlParams object
-// no default values defined in spec.
-func NewSubscribeControlParams() SubscribeControlParams {
-
- return SubscribeControlParams{}
-}
-
-// SubscribeControlParams contains all the bound params for the subscribe control operation
-// typically these are obtained from a http.Request
-//
-// swagger:parameters subscribeControl
-type SubscribeControlParams struct {
-
- // HTTP Request Object
- HTTPRequest *http.Request `json:"-"`
-
- /*Subscription control parameters
- In: body
- */
- ControlParams *models.ControlParams
-}
-
-// 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 NewSubscribeControlParams() beforehand.
-func (o *SubscribeControlParams) 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.ControlParams
- if err := route.Consumer.Consume(r.Body, &body); err != nil {
- res = append(res, errors.NewParseError("controlParams", "body", "", err))
- } else {
- // validate body object
- if err := body.Validate(route.Formats); err != nil {
- res = append(res, err)
- }
-
- if len(res) == 0 {
- o.ControlParams = &body
- }
- }
- }
- if len(res) > 0 {
- return errors.CompositeValidationError(res...)
- }
- return nil
-}
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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"
-)
-
-// SubscribeControlCreatedCode is the HTTP code returned for type SubscribeControlCreated
-const SubscribeControlCreatedCode int = 201
-
-/*SubscribeControlCreated Subscription successfully created
-
-swagger:response subscribeControlCreated
-*/
-type SubscribeControlCreated struct {
-
- /*
- In: Body
- */
- Payload models.SubscriptionResult `json:"body,omitempty"`
-}
-
-// NewSubscribeControlCreated creates SubscribeControlCreated with default headers values
-func NewSubscribeControlCreated() *SubscribeControlCreated {
-
- return &SubscribeControlCreated{}
-}
-
-// WithPayload adds the payload to the subscribe control created response
-func (o *SubscribeControlCreated) WithPayload(payload models.SubscriptionResult) *SubscribeControlCreated {
- o.Payload = payload
- return o
-}
-
-// SetPayload sets the payload to the subscribe control created response
-func (o *SubscribeControlCreated) SetPayload(payload models.SubscriptionResult) {
- o.Payload = payload
-}
-
-// WriteResponse to the client
-func (o *SubscribeControlCreated) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.WriteHeader(201)
- payload := o.Payload
- if payload == nil {
- // return empty array
- payload = models.SubscriptionResult{}
- }
-
- if err := producer.Produce(rw, payload); err != nil {
- panic(err) // let the recovery middleware deal with this
- }
-}
-
-// SubscribeControlBadRequestCode is the HTTP code returned for type SubscribeControlBadRequest
-const SubscribeControlBadRequestCode int = 400
-
-/*SubscribeControlBadRequest Invalid input
-
-swagger:response subscribeControlBadRequest
-*/
-type SubscribeControlBadRequest struct {
-}
-
-// NewSubscribeControlBadRequest creates SubscribeControlBadRequest with default headers values
-func NewSubscribeControlBadRequest() *SubscribeControlBadRequest {
-
- return &SubscribeControlBadRequest{}
-}
-
-// WriteResponse to the client
-func (o *SubscribeControlBadRequest) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
-
- rw.WriteHeader(400)
-}
-
-// SubscribeControlInternalServerErrorCode is the HTTP code returned for type SubscribeControlInternalServerError
-const SubscribeControlInternalServerErrorCode int = 500
-
-/*SubscribeControlInternalServerError Internal error
-
-swagger:response subscribeControlInternalServerError
-*/
-type SubscribeControlInternalServerError struct {
-}
-
-// NewSubscribeControlInternalServerError creates SubscribeControlInternalServerError with default headers values
-func NewSubscribeControlInternalServerError() *SubscribeControlInternalServerError {
-
- return &SubscribeControlInternalServerError{}
-}
-
-// WriteResponse to the client
-func (o *SubscribeControlInternalServerError) WriteResponse(rw http.ResponseWriter, producer runtime.Producer) {
-
- rw.Header().Del(runtime.HeaderContentType) //Remove Content-Type on empty responses
-
- rw.WriteHeader(500)
-}
+++ /dev/null
-// Code generated by go-swagger; DO NOT EDIT.
-
-package control
-
-// 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"
-)
-
-// SubscribeControlURL generates an URL for the subscribe control operation
-type SubscribeControlURL 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 *SubscribeControlURL) WithBasePath(bp string) *SubscribeControlURL {
- 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 *SubscribeControlURL) SetBasePath(bp string) {
- o._basePath = bp
-}
-
-// Build a url path and query string
-func (o *SubscribeControlURL) Build() (*url.URL, error) {
- var _result url.URL
-
- var _path = "/subscriptions/control"
-
- _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 *SubscribeControlURL) 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 *SubscribeControlURL) String() string {
- return o.Must(o.Build()).String()
-}
-
-// BuildFull builds a full url with scheme, host, path and query string
-func (o *SubscribeControlURL) BuildFull(scheme, host string) (*url.URL, error) {
- if scheme == "" {
- return nil, errors.New("scheme is required for a full url on SubscribeControlURL")
- }
- if host == "" {
- return nil, errors.New("host is required for a full url on SubscribeControlURL")
- }
-
- 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 *SubscribeControlURL) StringFull(scheme, host string) string {
- return o.Must(o.BuildFull(scheme, host)).String()
-}
/*
In: Body
*/
- Payload models.SubscriptionResult `json:"body,omitempty"`
+ Payload models.SubscriptionResponse `json:"body,omitempty"`
}
// NewSubscribePolicyCreated creates SubscribePolicyCreated with default headers values
}
// WithPayload adds the payload to the subscribe policy created response
-func (o *SubscribePolicyCreated) WithPayload(payload models.SubscriptionResult) *SubscribePolicyCreated {
+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.SubscriptionResult) {
+func (o *SubscribePolicyCreated) SetPayload(payload models.SubscriptionResponse) {
o.Payload = payload
}
payload := o.Payload
if payload == nil {
// return empty array
- payload = models.SubscriptionResult{}
+ payload = models.SubscriptionResponse{}
}
if err := producer.Produce(rw, payload); err != nil {
/*SubscribeReport swagger:route POST /subscriptions/report report subscribeReport
-Subscribe a list of X2AP event triggers to receive "REPORT" messages sent by RAN
+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 {
/*
In: Body
*/
- Payload models.SubscriptionResult `json:"body,omitempty"`
+ Payload models.SubscriptionResponse `json:"body,omitempty"`
}
// NewSubscribeReportCreated creates SubscribeReportCreated with default headers values
}
// WithPayload adds the payload to the subscribe report created response
-func (o *SubscribeReportCreated) WithPayload(payload models.SubscriptionResult) *SubscribeReportCreated {
+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.SubscriptionResult) {
+func (o *SubscribeReportCreated) SetPayload(payload models.SubscriptionResponse) {
o.Payload = payload
}
payload := o.Payload
if payload == nil {
// return empty array
- payload = models.SubscriptionResult{}
+ payload = models.SubscriptionResponse{}
}
if err := producer.Produce(rw, payload); err != nil {
"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/control"
"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"
QueryGetAllSubscriptionsHandler: query.GetAllSubscriptionsHandlerFunc(func(params query.GetAllSubscriptionsParams) middleware.Responder {
return middleware.NotImplemented("operation QueryGetAllSubscriptions has not yet been implemented")
}),
- ControlSubscribeControlHandler: control.SubscribeControlHandlerFunc(func(params control.SubscribeControlParams) middleware.Responder {
- return middleware.NotImplemented("operation ControlSubscribeControl has not yet been implemented")
- }),
PolicySubscribePolicyHandler: policy.SubscribePolicyHandlerFunc(func(params policy.SubscribePolicyParams) middleware.Responder {
return middleware.NotImplemented("operation PolicySubscribePolicy has not yet been implemented")
}),
CommonUnsubscribeHandler common.UnsubscribeHandler
// QueryGetAllSubscriptionsHandler sets the operation handler for the get all subscriptions operation
QueryGetAllSubscriptionsHandler query.GetAllSubscriptionsHandler
- // ControlSubscribeControlHandler sets the operation handler for the subscribe control operation
- ControlSubscribeControlHandler control.SubscribeControlHandler
// PolicySubscribePolicyHandler sets the operation handler for the subscribe policy operation
PolicySubscribePolicyHandler policy.SubscribePolicyHandler
// ReportSubscribeReportHandler sets the operation handler for the subscribe report operation
unregistered = append(unregistered, "query.GetAllSubscriptionsHandler")
}
- if o.ControlSubscribeControlHandler == nil {
- unregistered = append(unregistered, "control.SubscribeControlHandler")
- }
-
if o.PolicySubscribePolicyHandler == nil {
unregistered = append(unregistered, "policy.SubscribePolicyHandler")
}
}
o.handlers["GET"]["/subscriptions"] = query.NewGetAllSubscriptions(o.context, o.QueryGetAllSubscriptionsHandler)
- if o.handlers["POST"] == nil {
- o.handlers["POST"] = make(map[string]http.Handler)
- }
- o.handlers["POST"]["/subscriptions/control"] = control.NewSubscribeControl(o.context, o.ControlSubscribeControlHandler)
-
if o.handlers["POST"] == nil {
o.handlers["POST"] = make(map[string]http.Handler)
}
func handleInterrupt(once *sync.Once, s *Server) {
once.Do(func() {
- for range s.interrupt {
+ for _ = range s.interrupt {
if s.interrupted {
s.Logf("Server already shutting down")
continue
"time"
apiclient "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi"
- apicontrol "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/clientapi/control"
+ 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/control"
+ "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"
)
-type SubscriptionHandler func(models.SubscriptionType, interface{}) (models.SubscriptionResult, error)
+type SubscriptionHandler func(models.SubscriptionType, interface{}) (models.SubscriptionResponse, error)
type SubscriptionQueryHandler func() (models.SubscriptionList, error)
+type SubscriptionDeleteHandler func(string) error
type Subscriber struct {
localAddr string
}
// Server interface: listen and receive subscription requests
-func (r *Subscriber) Listen(subHandler SubscriptionHandler, queryHandler SubscriptionQueryHandler) error {
+func (r *Subscriber) Listen(add SubscriptionHandler, get SubscriptionQueryHandler, del SubscriptionDeleteHandler) error {
swaggerSpec, err := loads.Embedded(restapi.SwaggerJSON, restapi.FlatSwaggerJSON)
if err != nil {
return err
// Subscription: query
api.QueryGetAllSubscriptionsHandler = query.GetAllSubscriptionsHandlerFunc(
func(p query.GetAllSubscriptionsParams) middleware.Responder {
- if resp, err := queryHandler(); err == nil {
+ if resp, err := get(); err == nil {
return query.NewGetAllSubscriptionsOK().WithPayload(resp)
}
return query.NewGetAllSubscriptionsInternalServerError()
// SubscriptionType: Report
api.ReportSubscribeReportHandler = report.SubscribeReportHandlerFunc(
func(p report.SubscribeReportParams) middleware.Responder {
- if resp, err := subHandler(models.SubscriptionTypeReport, p.ReportParams); err == nil {
+ if resp, err := add(models.SubscriptionTypeReport, p.ReportParams); err == nil {
return report.NewSubscribeReportCreated().WithPayload(resp)
}
return report.NewSubscribeReportInternalServerError()
})
- // SubscriptionType: Control
- api.ControlSubscribeControlHandler = control.SubscribeControlHandlerFunc(
- func(p control.SubscribeControlParams) middleware.Responder {
- if resp, err := subHandler(models.SubscriptionTypeControl, p.ControlParams); err == nil {
- return control.NewSubscribeControlCreated().WithPayload(resp)
- }
- return control.NewSubscribeControlInternalServerError()
- })
-
// SubscriptionType: policy
api.PolicySubscribePolicyHandler = policy.SubscribePolicyHandlerFunc(
func(p policy.SubscribePolicyParams) middleware.Responder {
- if resp, err := subHandler(models.SubscriptionTypePolicy, p.PolicyParams); err == nil {
+ if resp, err := add(models.SubscriptionTypePolicy, p.PolicyParams); err == nil {
return policy.NewSubscribePolicyCreated().WithPayload(resp)
}
return policy.NewSubscribePolicyInternalServerError()
})
+ // SubscriptionType: delete
+ api.CommonUnsubscribeHandler = common.UnsubscribeHandlerFunc(
+ func(p common.UnsubscribeParams) middleware.Responder {
+ if err := del(p.SubscriptionID); err == nil {
+ return common.NewUnsubscribeNoContent()
+ }
+ return common.NewUnsubscribeInternalServerError()
+ })
+
server := restapi.NewServer(api)
defer server.Shutdown()
server.Host = r.localAddr
}
// Subscription interface for xApp: REPORT
-func (r *Subscriber) SubscribeReport(p *apimodel.ReportParams) (apimodel.SubscriptionResult, error) {
+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.SubscriptionResult{}, err
- }
-
- return result.Payload, err
-}
-
-// Subscription interface for xApp: CONTROL
-func (r *Subscriber) SubscribeControl(p *apimodel.ControlParams) (apimodel.SubscriptionResult, error) {
- params := apicontrol.NewSubscribeControlParamsWithTimeout(r.timeout).WithControlParams(p)
- result, err := r.CreateTransport().Control.SubscribeControl(params)
- if err != nil {
- return apimodel.SubscriptionResult{}, err
+ return apimodel.SubscriptionResponse{}, err
}
return result.Payload, err
}
// Subscription interface for xApp: POLICY
-func (r *Subscriber) SubscribePolicy(p *apimodel.PolicyParams) (apimodel.SubscriptionResult, error) {
+func (r *Subscriber) SubscribePolicy(p *apimodel.PolicyParams) (apimodel.SubscriptionResponse, error) {
params := apipolicy.NewSubscribePolicyParamsWithTimeout(r.timeout).WithPolicyParams(p)
result, err := r.CreateTransport().Policy.SubscribePolicy(params)
if err != nil {
- return apimodel.SubscriptionResult{}, err
+ return apimodel.SubscriptionResponse{}, err
}
return result.Payload, err
}
+// Subscription interface for xApp: DELETE
+func (r *Subscriber) UnSubscribe(subId string) error {
+ params := apicommon.NewUnsubscribeParamsWithTimeout(r.timeout).WithSubscriptionID(subId)
+ _, err := r.CreateTransport().Common.Unsubscribe(params)
+
+ return err
+}
+
// Subscription interface for xApp: QUERY
func (r *Subscriber) QuerySubscriptions() (models.SubscriptionList, error) {
resp, err := http.Get(fmt.Sprintf("http://%s/%s/subscriptions", r.remoteHost, r.remoteUrl))
var suite *testing.T
-var requestorId = int64(0x4EEC)
+var meid = "gnb123456"
+var funId = int64(1)
+var clientEndpoint = "localhost:4561"
var direction = int64(0)
var procedureCode = int64(27)
var typeOfMessage = int64(1)
var reportParams = apimodel.ReportParams{
- RequestorID: &requestorId,
+ Meid: meid,
+ RANFunctionID: &funId,
+ ClientEndpoint: &clientEndpoint,
EventTriggers: apimodel.EventTriggerList{
&apimodel.EventTrigger{
- InterfaceDirection: &direction,
- ProcedureCode: &procedureCode,
- TypeOfMessage: &typeOfMessage,
+ InterfaceDirection: direction,
+ ProcedureCode: procedureCode,
+ TypeOfMessage: typeOfMessage,
},
},
}
-var controlParams = apimodel.ControlParams{
- RequestorID: requestorId,
-}
-
var policyParams = apimodel.PolicyParams{
- RequestorID: requestorId,
+ Meid: &meid,
+ RANFunctionID: &funId,
+ ClientEndpoint: &clientEndpoint,
+ EventTriggers: apimodel.EventTriggerList{
+ &apimodel.EventTrigger{
+ InterfaceDirection: direction,
+ ProcedureCode: procedureCode,
+ TypeOfMessage: typeOfMessage,
+ },
+ },
+ PolicyActionDefinitions: &apimodel.PolicyActionDefinition{},
}
-func subscriptionHandler(stype models.SubscriptionType, params interface{}) (models.SubscriptionResult, error) {
+func subscriptionHandler(stype models.SubscriptionType, params interface{}) (models.SubscriptionResponse, error) {
switch stype {
case models.SubscriptionTypeReport:
p := params.(*models.ReportParams)
- assert.Equal(suite, requestorId, *p.RequestorID)
- 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.SubscriptionTypeControl:
- p := params.(*models.ControlParams)
- assert.Equal(suite, requestorId, p.RequestorID)
+ 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, requestorId, p.RequestorID)
+ assert.Equal(suite, clientEndpoint, *p.ClientEndpoint)
}
- return models.SubscriptionResult{11, 22, 33}, nil
+ subId := "xapp-11"
+ reqId := int64(11)
+ instanceId := int64(22)
+ return models.SubscriptionResponse{
+ &models.SubscriptionResponseItem{SubscriptionID: &subId, RequestorID: &reqId, InstanceID: &instanceId},
+ &models.SubscriptionResponseItem{SubscriptionID: &subId, RequestorID: &reqId, InstanceID: &instanceId},
+ }, nil
}
func queryHandler() (models.SubscriptionList, error) {
return resp, nil
}
+func deleteHandler(ep string) error {
+ assert.Equal(suite, clientEndpoint, ep)
+
+ return nil
+}
+
func TestSetup(t *testing.T) {
suite = t
// Start the server to simulate SubManager
- go Subscription.Listen(subscriptionHandler, queryHandler)
+ go Subscription.Listen(subscriptionHandler, queryHandler, deleteHandler)
time.Sleep(time.Duration(2) * time.Second)
}
result, err := Subscription.SubscribeReport(&reportParams)
assert.Equal(t, err, nil)
- assert.Equal(t, len(result), 3)
- assert.Equal(t, result[0], int64(11))
- assert.Equal(t, result[1], int64(22))
- assert.Equal(t, result[2], int64(33))
+ assert.Equal(t, len(result), 2)
+ assert.Equal(t, *result[0].RequestorID, int64(11))
+ assert.Equal(t, *result[0].InstanceID, int64(22))
+ assert.Equal(t, *result[1].RequestorID, int64(11))
+ assert.Equal(t, *result[1].InstanceID, int64(22))
}
-func TestSubscriptionControltHandling(t *testing.T) {
- result, err := Subscription.SubscribeControl(&controlParams)
+func TestSubscriptionPolicytHandling(t *testing.T) {
+ result, err := Subscription.SubscribePolicy(&policyParams)
assert.Equal(t, err, nil)
- assert.Equal(t, len(result), 3)
- assert.Equal(t, result[0], int64(11))
+ assert.Equal(t, len(result), 2)
+ assert.Equal(t, *result[0].RequestorID, int64(11))
+ assert.Equal(t, *result[0].InstanceID, int64(22))
}
-func TestSubscriptionPolicytHandling(t *testing.T) {
- result, err := Subscription.SubscribePolicy(&policyParams)
+func TestSubscriptionDeleteHandling(t *testing.T) {
+ err := Subscription.UnSubscribe(clientEndpoint)
assert.Equal(t, err, nil)
- assert.Equal(t, len(result), 3)
- assert.Equal(t, result[0], int64(11))
-}
+}
\ No newline at end of file