* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * This source code is part of the near-RT RIC (RAN Intelligent Controller)
+ * platform project (RICP).
+ *
*/
package main
import (
"encoding/json"
"io"
+ "io/ioutil"
"os"
"strconv"
+ "strings"
"time"
"gopkg.in/yaml.v2"
)
+const defaultReportingEntityID = "00000000-0000-0000-0000-000000000000"
+const defaultVNFName = "Vespa"
+const defaultNFNamingCode = "ricp"
+
+func readSystemUUID() string {
+ data, err := ioutil.ReadFile("/sys/class/dmi/id/product_uuid")
+ if err != nil {
+ return defaultReportingEntityID
+ }
+ return strings.TrimSpace(string(data))
+}
+
+func getVNFName() string {
+ VNFName := os.Getenv("VESMGR_VNFNAME")
+ if VNFName == "" {
+ return defaultVNFName
+ }
+ return VNFName
+}
+
+func getNFNamingCode() string {
+ NFNamingCode := os.Getenv("VESMGR_NFNAMINGCODE")
+ if NFNamingCode == "" {
+ return defaultNFNamingCode
+ }
+ return NFNamingCode
+}
+
func basicVespaConf() VESAgentConfiguration {
var vespaconf = VESAgentConfiguration{
DataDir: "/tmp/data",
Debug: false,
Event: EventConfiguration{
- VNFName: "vespa-demo", // XXX
- ReportingEntityID: "1af5bfa9-40b4-4522-b045-40e54f0310f", // XXX
- MaxSize: 2000000,
- NfNamingCode: "hsxp",
- NfcNamingCodes: []NfcNamingCode{
- NfcNamingCode{
- Type: "oam",
- Vnfcs: []string{"lr-ope-0", "lr-ope-1", "lr-ope-2"},
- },
- NfcNamingCode{
- Type: "etl",
- Vnfcs: []string{"lr-pro-0", "lr-pro-1"},
- },
- },
+ VNFName: getVNFName(),
+ ReportingEntityName: "Vespa",
+ ReportingEntityID: readSystemUUID(),
+ MaxSize: 2000000,
+ NfNamingCode: getNFNamingCode(),
+ NfcNamingCodes: []NfcNamingCode{},
RetryInterval: time.Second * 5,
MaxMissed: 2,
},
Measurement: MeasurementConfiguration{
+ // Domain abbreviation has to be set to “Mvfs” for VES 5.3,
+ // and to “Measurement” for later VES interface versions.
DomainAbbreviation: "Mvfs",
MaxBufferingDuration: time.Hour,
Prometheus: PrometheusConfig{