2 // ========================LICENSE_START=================================
5 // Copyright (C) 2021: Nordix Foundation
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
11 // http://www.apache.org/licenses/LICENSE-2.0
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===================================
26 "oransc.org/usecase/oduclosedloop/internal/structures"
29 type ORanDuRestConf struct {
30 DistributedUnitFunction DistributedUnitFunction `json:"distributed-unit-functions"`
33 type DistributedUnitFunction struct {
35 Cell []Cell `json:"cell"`
36 RRMPolicyRatio []RRMPolicyRatio `json:"radio-resource-management-policy-ratio"`
41 AdmState string `json:"administrative-state"`
42 OpState string `json:"operational-state"`
43 UserLabel string `json:"user-label"`
46 type RRMPolicyRatio struct {
48 AdmState string `json:"administrative-state"`
49 UserLabel string `json:"user-label"`
50 RRMPolicyMaxRatio int `json:"radio-resource-management-policy-max-ratio"`
51 RRMPolicyMinRatio string `json:"radio-resource-management-policy-min-ratio"`
52 RRMPolicyDedicatedRatio string `json:"radio-resource-management-policy-dedicated-ratio"`
53 ResourceType string `json:"resource-type"`
54 RRMPolicyMembers []RRMPolicyMember `json:"radio-resource-management-policy-members"`
57 type RRMPolicyMember struct {
58 MobileCountryCode string `json:"mobile-country-code"`
59 MobileNetworkCode string `json:"mobile-network-code"`
60 SliceDifferentiator int `json:"slice-differentiator"`
61 SliceServiceType int `json:"slice-service-type"`
64 func GetDedicatedRatioUpdateMessage(metric structures.SliceMetric, policy structures.PolicyRatio, dedicatedRatio int) RRMPolicyRatio {
65 return RRMPolicyRatio{
66 Id: policy.PolicyRatioId,
68 UserLabel: "Some user label",
69 RRMPolicyMaxRatio: policy.PolicyMaxRatio,
70 RRMPolicyMinRatio: policy.PolicyMinRatio,
71 RRMPolicyDedicatedRatio: strconv.Itoa(dedicatedRatio),
73 RRMPolicyMembers: []RRMPolicyMember{
75 MobileCountryCode: "046",
76 MobileNetworkCode: "651",
77 SliceDifferentiator: metric.SliceDiff,
78 SliceServiceType: metric.SliceServiceType,