some fix related to the integration
[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:     Containes 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
39 //TODO: uuid is not a real UUID but a string of "ip:port"
40 // this should be changed to real UUID later on which should come from xApp Manager // petszila
41 type Endpoint struct {
42         Uuid       string
43         Name       string
44         XAppType   string
45         Ip         string
46         Port       uint16
47         TxMessages []string
48         RxMessages []string
49         Socket     interface{}
50         IsReady    bool
51         Keepalive  bool
52 }
53
54 type RouteTableEntry struct {
55         MessageType string
56         TxList      EndpointList
57         RxGroups    []EndpointList
58         SubID       int32
59 }
60
61 type XApp struct {
62         Name      string         `json:"name"`
63         Status    string         `json:"status"`
64         Version   string         `json:"version"`
65         Instances []XAppInstance `json:"instances"`
66 }
67
68 type XAppInstance struct {
69         Name       string   `json:"name"`
70         Status     string   `json:"status"`
71         Ip         string   `json:"ip"`
72         Port       uint16   `json:"port"`
73         TxMessages []string `json:"txMessages"`
74         RxMessages []string `json:"rxMessages"`
75 }
76
77 type PlatformComponents []struct {
78         Name string `json:"name"`
79         Fqdn string `json:"fqdn"`
80         Port uint16 `json:"port"`
81 }
82
83 type RtmgrConfig struct {
84         Pcs PlatformComponents `json:"PlatformComponents"`
85 }
86
87 type RicComponents struct {
88         Xapps []XApp
89         Pcs   PlatformComponents
90 }
91
92 type Subscription struct {
93         SubID    int32
94         Fqdn     string
95         Port     uint16
96 }
97