Add new packages to the container
[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 */
19 /*
20   Mnemonic:     rtmgr/types.go
21   Abstract:     Contains RTMGR (Routing Manager) specific types
22   Date:         12 March 2019
23 */
24
25 package rtmgr
26
27 type XApps struct {
28         XAppList []XApp
29 }
30
31 type RouteTable []RouteTableEntry
32 type EndpointList []Endpoint
33
34 type Endpoints map[string]*Endpoint
35
36 type SubscriptionList []Subscription
37
38 //TODO: uuid is not a real UUID but a string of "ip:port"
39 // this should be changed to real UUID later on which should come from xApp Manager // petszila
40 type Endpoint struct {
41         Uuid       string
42         Name       string
43         XAppType   string
44         Ip         string
45         Port       uint16
46         TxMessages []string
47         RxMessages []string
48         Socket     interface{}
49         IsReady    bool
50         Keepalive  bool
51 }
52
53 type RouteTableEntry struct {
54         MessageType string
55         TxList      EndpointList
56         RxGroups    []EndpointList
57         SubID       int32
58 }
59
60 type XApp struct {
61         Name      string         `json:"name"`
62         Status    string         `json:"status"`
63         Version   string         `json:"version"`
64         Instances []XAppInstance `json:"instances"`
65 }
66
67 type XAppInstance struct {
68         Name       string   `json:"name"`
69         Status     string   `json:"status"`
70         Ip         string   `json:"ip"`
71         Port       uint16   `json:"port"`
72         TxMessages []string `json:"txMessages"`
73         RxMessages []string `json:"rxMessages"`
74 }
75
76 type PlatformComponents []struct {
77         Name string `json:"name"`
78         Fqdn string `json:"fqdn"`
79         Port uint16 `json:"port"`
80 }
81
82 type ConfigRtmgr struct {
83         Pcs PlatformComponents `json:"PlatformComponents"`
84 }
85
86 type RicComponents struct {
87         XApps []XApp
88         Pcs   PlatformComponents
89 }
90
91 type Subscription struct {
92         SubID int32
93         Fqdn  string
94         Port  uint16
95 }