Adding scope of RICPlatform that are under Apache License
[ric-plt/rtmgr.git] / pkg / rtmgr / types.go
1 /*
2 ==================================================================================
3   Copyright (c) 2019 AT&T Intellectual Property.
4   Copyright (c) 2019 Nokia
5
6    Licensed under the Apache License, Version 2.0 (the "License");
7    you may not use this file except in compliance with the License.
8    You may obtain a copy of the License at
9
10        http://www.apache.org/licenses/LICENSE-2.0
11
12    Unless required by applicable law or agreed to in writing, software
13    distributed under the License is distributed on an "AS IS" BASIS,
14    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15    See the License for the specific language governing permissions and
16    limitations under the License.
17
18    This source code is part of the near-RT RIC (RAN Intelligent Controller)
19    platform project (RICP).
20
21 ==================================================================================
22 */
23 /*
24   Mnemonic:     rtmgr/types.go
25   Abstract:     Contains RTMGR (Routing Manager) specific types
26   Date:         12 March 2019
27 */
28
29 package rtmgr
30
31 type XApps struct {
32         XAppList []XApp
33 }
34
35 type RouteTable []RouteTableEntry
36 type EndpointList []Endpoint
37
38 type Endpoints map[string]*Endpoint
39
40 type SubscriptionList []Subscription
41
42 //TODO: uuid is not a real UUID but a string of "ip:port"
43 // this should be changed to real UUID later on which should come from xApp Manager // petszila
44 type Endpoint struct {
45         Uuid       string
46         Name       string
47         XAppType   string
48         Ip         string
49         Port       uint16
50         TxMessages []string
51         RxMessages []string
52         Socket     interface{}
53         IsReady    bool
54         Keepalive  bool
55 }
56
57 type RouteTableEntry struct {
58         MessageType string
59         TxList      EndpointList
60         RxGroups    []EndpointList
61         SubID       int32
62 }
63
64 type XApp struct {
65         Name      string         `json:"name"`
66         Status    string         `json:"status"`
67         Version   string         `json:"version"`
68         Instances []XAppInstance `json:"instances"`
69 }
70
71 type XAppInstance struct {
72         Name       string   `json:"name"`
73         Status     string   `json:"status"`
74         Ip         string   `json:"ip"`
75         Port       uint16   `json:"port"`
76         TxMessages []string `json:"txMessages"`
77         RxMessages []string `json:"rxMessages"`
78 }
79
80 type PlatformComponents []struct {
81         Name string `json:"name"`
82         Fqdn string `json:"fqdn"`
83         Port uint16 `json:"port"`
84 }
85
86 type ConfigRtmgr struct {
87         Pcs PlatformComponents `json:"PlatformComponents"`
88 }
89
90 type RicComponents struct {
91         XApps []XApp
92         Pcs   PlatformComponents
93 }
94
95 type Subscription struct {
96         SubID int32
97         Fqdn  string
98         Port  uint16
99 }