First version of ODU slice assurance usecase
[nonrtric.git] / test / usecases / odusliceassurance / goversion / internal / structures / measurements.go
1 // -
2 //   ========================LICENSE_START=================================
3 //   O-RAN-SC
4 //   %%
5 //   Copyright (C) 2021: Nordix Foundation
6 //   %%
7 //   Licensed under the Apache License, Version 2.0 (the "License");
8 //   you may not use this file except in compliance with the License.
9 //   You may obtain a copy of the License at
10 //
11 //        http://www.apache.org/licenses/LICENSE-2.0
12 //
13 //   Unless required by applicable law or agreed to in writing, software
14 //   distributed under the License is distributed on an "AS IS" BASIS,
15 //   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 //   See the License for the specific language governing permissions and
17 //   limitations under the License.
18 //   ========================LICENSE_END===================================
19 //
20
21 package structures
22
23 type SliceMetric struct {
24         DUId             string
25         CellId           string
26         SliceDiff        int
27         SliceServiceType int
28         RRMPolicyRatioId string
29         PM               map[string]int
30 }
31
32 func NewSliceMetric(duid string, cellid string, sd int, sst int) *SliceMetric {
33         sm := SliceMetric{
34                 DUId:             duid,
35                 CellId:           cellid,
36                 SliceDiff:        sd,
37                 SliceServiceType: sst,
38         }
39         sm.PM = make(map[string]int)
40         return &sm
41 }
42
43 type PolicyRatio struct {
44         PolicyRatioId        string
45         PolicyMaxRatio       int
46         PolicyMinRatio       string
47         PolicyDedicatedRatio int
48 }
49
50 func NewPolicyRatioEntry(id string, max_ratio int, min_ratio string, ded_ratio int) *PolicyRatio {
51         pr := PolicyRatio{
52                 PolicyRatioId:        id,
53                 PolicyMaxRatio:       max_ratio,
54                 PolicyMinRatio:       min_ratio,
55                 PolicyDedicatedRatio: ded_ratio,
56         }
57         return &pr
58 }