From 7fc16e782950a0175eea0903cbb9e32e963d1aa8 Mon Sep 17 00:00:00 2001 From: Christos Tranoris Date: Mon, 6 Nov 2023 14:15:07 +0200 Subject: [PATCH 01/10] Initial commit --- .gitignore | 4 + pom.xml | 239 ++++++++++++++++++ .../ANSCreateInstanceRequestPayload.java | 36 +++ .../ANSInstantiateInstanceRequestPayload.java | 207 +++++++++++++++ .../osl/sol005nbi/ANSScaleRequestPayload.java | 163 ++++++++++++ .../org/etsi/osl/sol005nbi/OSMClient.java | 81 ++++++ .../osl/sol005nbi/OSMUtil/OSMNSExtractor.java | 35 +++ .../sol005nbi/OSMUtil/OSMVNFDExtractor.java | 34 +++ .../\316\221NSActionRequestPayload.java" | 155 ++++++++++++ 9 files changed, 954 insertions(+) create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/org/etsi/osl/sol005nbi/ANSCreateInstanceRequestPayload.java create mode 100644 src/main/java/org/etsi/osl/sol005nbi/ANSInstantiateInstanceRequestPayload.java create mode 100644 src/main/java/org/etsi/osl/sol005nbi/ANSScaleRequestPayload.java create mode 100644 src/main/java/org/etsi/osl/sol005nbi/OSMClient.java create mode 100644 src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMNSExtractor.java create mode 100644 src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMVNFDExtractor.java create mode 100644 "src/main/java/org/etsi/osl/sol005nbi/\316\221NSActionRequestPayload.java" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0bc3c3c --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +/target/ +/.project +/.classpath +/.settings diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..dd449d0 --- /dev/null +++ b/pom.xml @@ -0,0 +1,239 @@ + + 4.0.0 + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm + 1.2.0-SNAPSHOT + jar + + org.etsi.osl.sol005nbi.osm + + + openslice.io + http://openslice.io + + + 2019 + + + + Apache 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + A business-friendly OSS license + + + + + UTF-8 + ${project.build.directory}/generated-sources/mdsal-binding + UTF-8 + 2.0.0 + apache_v2 + 3.1.2 + + + + + opendaylight-release + opendaylight-release + https://nexus.opendaylight.org/content/repositories/opendaylight.release/ + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + + + + + + opendaylight-release + opendaylight-release + https://nexus.opendaylight.org/content/repositories/opendaylight.release/ + + + opendaylight-snapshot + opendaylight-snapshot + https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + + + + + + + org.opendaylight.yangtools + yangtools-artifacts + 6.0.5 + pom + import + + + + org.springframework.boot + spring-boot-dependencies + ${spring.boot-version} + pom + import + + + + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework.boot + spring-boot-starter-tomcat + + + + + com.google.code.findbugs + jsr305 + 3.0.2 + + + org.opendaylight.yangtools + yang-common + + + org.opendaylight.mdsal + yang-binding + 0.13.1 + + + + + + org.springframework.boot + spring-boot-starter + + + org.springframework + spring-web + + + com.fasterxml.jackson.core + jackson-databind + + + com.fasterxml.jackson.dataformat + jackson-dataformat-yaml + + + org.apache.commons + commons-lang3 + + + org.apache.httpcomponents + httpcore + jar + + + org.json + json + 20160212 + jar + + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + 1.1 + + + + + + + + org.apache.commons + commons-compress + 1.21 + + + + org.apache.commons + commons-io + 1.3.2 + + + + + + + + + + src/main/resources + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 17 + 17 + + + + org.codehaus.mojo + license-maven-plugin + ${maven-license-plugin.version} + + false + ========================LICENSE_START================================= + =========================LICENSE_END================================== + src/main/java/io,src/main/java/OSM5NBIClient,src/main/java/OSM5Util + + + + generate-license-headers + + update-file-header + + process-sources + + ${license.licenseName} + + + + + download-licenses + + download-licenses + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/org/etsi/osl/sol005nbi/ANSCreateInstanceRequestPayload.java b/src/main/java/org/etsi/osl/sol005nbi/ANSCreateInstanceRequestPayload.java new file mode 100644 index 0000000..5f238f3 --- /dev/null +++ b/src/main/java/org/etsi/osl/sol005nbi/ANSCreateInstanceRequestPayload.java @@ -0,0 +1,36 @@ +package org.etsi.osl.sol005nbi; +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol007nbi.osm + * %% + * Copyright (C) 2019 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ + + +/** + * @author ctranoris + * + */ +public class ANSCreateInstanceRequestPayload extends ANSInstantiateInstanceRequestPayload +{ + private final String notificationType = "NsIdentifierCreationNotification"; + + public ANSCreateInstanceRequestPayload() + { + super(); + } +} + diff --git a/src/main/java/org/etsi/osl/sol005nbi/ANSInstantiateInstanceRequestPayload.java b/src/main/java/org/etsi/osl/sol005nbi/ANSInstantiateInstanceRequestPayload.java new file mode 100644 index 0000000..bf072e3 --- /dev/null +++ b/src/main/java/org/etsi/osl/sol005nbi/ANSInstantiateInstanceRequestPayload.java @@ -0,0 +1,207 @@ +package org.etsi.osl.sol005nbi; +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi + * %% + * Copyright (C) 2019 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ + +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class ANSInstantiateInstanceRequestPayload +{ + private String nsName; + public String getNsName() { + return nsName; + } + + public void setNsName(String nsName) { + this.nsName = nsName; + } + + private String vimAccountId; + public String getVimAccountId() { + return vimAccountId; + } + + public void setVimAccountId(String vimAccountId) { + this.vimAccountId = vimAccountId; + } + + private Boolean wimAccountId; + public Boolean getWimAccountId() { + return wimAccountId; + } + + public void setWimAccountId(Boolean wimAccountId) { + this.wimAccountId = wimAccountId; + } + + + private String nsdId; + public String getNsdId() { + return nsdId; + } + + public void setNsdId(String nsdId) { + this.nsdId = nsdId; + } + + public class VnF + { + @JsonProperty("member-vnf-index") + private String memberVnFIndex; + public String getMemberVnFIndex() { + return memberVnFIndex; + } + public void setMemberVnFIndex(String memberVnFIndex) { + this.memberVnFIndex = memberVnFIndex; + } + @JsonProperty("vdu") + private List vdu = null; + + public List getVdu() { + return vdu; + } + public void setVdu(List vdu) { + this.vdu = vdu; + } + + @JsonProperty("vimAccountId") + private String vimAccount; + public String getVimAccount() { + return vimAccount; + } + public void setVimAccount(String vimAccount) { + this.vimAccount = vimAccount; + } + + public VnF() + { + + }; + } + + + public class Vdu + { + @JsonProperty("id") + private String id; + @JsonProperty("interface") + private ArrayList interfaceObj = null; + + public ArrayList getInterfaceObj() { + return interfaceObj; + } + public void setInterfaceObj(ArrayList interfaceObj) { + this.interfaceObj = interfaceObj; + } + public String getId() { + return id; + } + public void setId(String id) { + this.id = id; + } + } + + public class NInterface + { + @JsonProperty("name") + private String name; + @JsonProperty("floating-ip-required") + private Boolean floating_ip_required; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public Boolean getFloating_ip_required() { + return floating_ip_required; + } + public void setFloating_ip_required(Boolean floating_ip_required) { + this.floating_ip_required = floating_ip_required; + } + } + + class Vld + { + @JsonProperty("name") + private String name; + @JsonProperty("vim-network-name") + private LinkedHashMap vimNetworkName = new LinkedHashMap<>(); + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public LinkedHashMap getVimNetworkName() { + return vimNetworkName; + } + public void setVimNetworkName(LinkedHashMap vimNetworkName) { + this.vimNetworkName = vimNetworkName; + } +// private String vimNetworkName; +// public String getVimNetworkName() { +// return vimNetworkName; +// } +// public void setVimNetworkName(String vimNetworkName) { +// this.vimNetworkName = vimNetworkName; +// } + } + private List vnf = new ArrayList<>(); + public List getVnf() { + return vnf; + } + + public void setVnf(List vnf) { + this.vnf = vnf; + } + + private List vld = new ArrayList<>(); + + public List getVld() { + return vld; + } + + public void setVld(List vld) { + this.vld = vld; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + +} diff --git a/src/main/java/org/etsi/osl/sol005nbi/ANSScaleRequestPayload.java b/src/main/java/org/etsi/osl/sol005nbi/ANSScaleRequestPayload.java new file mode 100644 index 0000000..7399287 --- /dev/null +++ b/src/main/java/org/etsi/osl/sol005nbi/ANSScaleRequestPayload.java @@ -0,0 +1,163 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol007nbi.osm + * %% + * Copyright (C) 2019 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ + +package org.etsi.osl.sol005nbi; + +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * @author Ioannis Chatzis + * + */ + +enum ScaleVnfType {SCALE_OUT, SCALE_IN}; + +public class ANSScaleRequestPayload +{ + public class ScaleVnfData + { + public class ScaleByStepData + { + @JsonProperty("scaling-group-descriptor") + private String scaling_group_descriptor; + @JsonProperty("member-vnf-index") + private String member_vnf_index; + @JsonProperty("scaling-policy") + private String scaling_policy; + + public String getScaling_group_descriptor() { + return scaling_group_descriptor; + } + public void setScaling_group_descriptor(String scaling_group_descriptor) { + this.scaling_group_descriptor = scaling_group_descriptor; + } + public String getMember_vnf_index() { + return member_vnf_index; + } + public void setMember_vnf_index(String member_vnf_index) { + this.member_vnf_index = member_vnf_index; + } + public String getScaling_policy() { + return scaling_policy; + } + public void setScaling_policy(String scaling_policy) { + this.scaling_policy = scaling_policy; + } + } + + private String scaleVnfType; + private String vnfInstanceId; + private ScaleByStepData scaleByStepData = new ScaleByStepData(); + + public String getVnfInstanceId() { + return vnfInstanceId; + } + public ScaleByStepData getScaleByStepData() { + return scaleByStepData; + } + public void setScaleByStepData(ScaleByStepData scaleByStepData) { + this.scaleByStepData = scaleByStepData; + } + public void setVnfInstanceId(String vnfInstanceId) { + this.vnfInstanceId = vnfInstanceId; + } + public String getScaleVnfType() { + return scaleVnfType; + } + public void setScaleVnfType(String scaleVnfType) { + this.scaleVnfType = scaleVnfType; + } + + } + + private String lcmOperationType; //"lcmOperationType": "scale" + private String nsInstanceId; + private String scaleType; + @JsonProperty("timeout-ns-scale") + private String timeout_ns_scale; + private ScaleVnfData scaleVnfData = new ScaleVnfData(); + private String scaleTime; + + public String getLcmOperationType() { + return lcmOperationType; + } + + public void setLcmOperationType(String lcmOperationType) { + this.lcmOperationType = lcmOperationType; + } + + public String getNsInstanceId() { + return nsInstanceId; + } + + public void setNsInstanceId(String nsInstanceId) { + this.nsInstanceId = nsInstanceId; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } + + public String getScaleType() { + return scaleType; + } + + public void setScaleType(String scaleType) { + this.scaleType = scaleType; + } + + public String getTimeout_ns_scale() { + return timeout_ns_scale; + } + + public void setTimeout_ns_scale(String timeout_ns_scale) { + this.timeout_ns_scale = timeout_ns_scale; + } + + public ScaleVnfData getScaleVnfData() { + return scaleVnfData; + } + + public void setScaleVnfData(ScaleVnfData scaleVnfData) { + this.scaleVnfData = scaleVnfData; + } + + public String getScaleTime() { + return scaleTime; + } + + public void setScaleTime(String scaleTime) { + this.scaleTime = scaleTime; + } +} + diff --git a/src/main/java/org/etsi/osl/sol005nbi/OSMClient.java b/src/main/java/org/etsi/osl/sol005nbi/OSMClient.java new file mode 100644 index 0000000..d68e66a --- /dev/null +++ b/src/main/java/org/etsi/osl/sol005nbi/OSMClient.java @@ -0,0 +1,81 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm + * %% + * Copyright (C) 2019 - 2020 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ +package org.etsi.osl.sol005nbi; + +import java.io.IOException; + +import org.json.JSONObject; +import org.springframework.http.ResponseEntity; + +public interface OSMClient { + + String getMANOApiEndpoint(); + + JSONObject getNSInstanceInfo(String instanceId); + + JSONObject getVNFInstanceInfo(String instanceId); + + JSONObject getNSInstanceContentInfo(String instanceId); + + JSONObject getNSLCMDetails(String nsLcmOpOccId); + + ResponseEntity getNSLCMDetailsList(); + + String getNSLCMDetailsListByNSID(String nsid); + + ResponseEntity createVNFDPackage(); + + ResponseEntity deleteVNFDPackage(String vnfd_id); + + ResponseEntity uploadVNFDPackageContent(String vnfd_id, String pLocation) throws IOException; + + ResponseEntity uploadVNFDPackageContent(String vnfd_id, byte[] allBytes) throws IOException; + + ResponseEntity createNSDPackage(); + + ResponseEntity uploadNSDPackageContent(String nsd_id, String pLocation) throws IOException; + + ResponseEntity uploadNSDPackageContent(String nsd_id, byte[] allBytes) throws IOException; + + ResponseEntity deleteNSDPackage(String nsd_id); + + ResponseEntity getVNFInstanceInfoNew(String string); + + ResponseEntity createNSInstance(String json); + + ResponseEntity instantiateNSInstance(String nsd_instance_id, String json); + + ResponseEntity deleteNSInstanceNew(String instanceId, boolean force); + + ResponseEntity terminateNSInstanceNew(String instanceId); + + ResponseEntity actionNSInstance(String ns_instance_id, String payload); + + ResponseEntity scaleNSInstance(String ns_instance_id, String payload); + + ResponseEntity getVIMs(); + + ResponseEntity getVNFDescriptorsList(); + + ResponseEntity getNSDescriptorsList(); + + ResponseEntity getNSInstancesList(); + +} diff --git a/src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMNSExtractor.java b/src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMNSExtractor.java new file mode 100644 index 0000000..fe80f80 --- /dev/null +++ b/src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMNSExtractor.java @@ -0,0 +1,35 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm5 + * %% + * Copyright (C) 2019 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ +package org.etsi.osl.sol005nbi.OSMUtil; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public interface OSMNSExtractor { + + public Object extractNsDescriptor() throws IOException ; + + public String getDescriptorYAMLfile() ; + + public void setDescriptorYAMLfile(String descriptorYAMLfile) ; + + public ByteArrayOutputStream getIconfilePath() ; + +} diff --git a/src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMVNFDExtractor.java b/src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMVNFDExtractor.java new file mode 100644 index 0000000..aa0ef91 --- /dev/null +++ b/src/main/java/org/etsi/osl/sol005nbi/OSMUtil/OSMVNFDExtractor.java @@ -0,0 +1,34 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm5 + * %% + * Copyright (C) 2019 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ +package org.etsi.osl.sol005nbi.OSMUtil; + +import java.io.ByteArrayOutputStream; +import java.io.IOException; + +public interface OSMVNFDExtractor { + + Object extractVnfdDescriptor() throws IOException ; + + public String getDescriptorYAMLfile() ; + + public void setDescriptorYAMLfile(String descriptorYAMLfile) ; + + public ByteArrayOutputStream getIconfilePath() ; +} diff --git "a/src/main/java/org/etsi/osl/sol005nbi/\316\221NSActionRequestPayload.java" "b/src/main/java/org/etsi/osl/sol005nbi/\316\221NSActionRequestPayload.java" new file mode 100644 index 0000000..59de200 --- /dev/null +++ "b/src/main/java/org/etsi/osl/sol005nbi/\316\221NSActionRequestPayload.java" @@ -0,0 +1,155 @@ +package org.etsi.osl.sol005nbi; +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm + * %% + * Copyright (C) 2019 openslice.io + * %% + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * 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. + * =========================LICENSE_END================================== + */ + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonAnySetter; +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +/** + * @author ichatzis + * + */ +public class ΑNSActionRequestPayload +{ + + private String nsInstanceId; + private String member_vnf_index; // Needed for VNFD mapping NSD.constituent-vnfd.member-vnf-index. If missing a NSD is targeting. Example: "member_vnf_index": "1", + private String vdu_id; // Needed if target is a VDU. Maps VNFD.vdu-id + private String vdu_count_index; // Needed if the VDU has several replicas (count>1) + private String primitive; // Mandatory. Maps [NSD.ns-configuration or VNFD.vnf-configuration or VNFD.vdu.vdu-configuration].config-primitive.name. Example: "primitive": "touch" + private String param; + private String lcmOperationType; //"lcmOperationType": "action"α + private String vnf_member_index; // TODO for backward compatibility. To remove in future + private String kdu_name; + private Integer timeout_ns_action; + private Map primitive_params = new LinkedHashMap<>(); + + public Map getPrimitive_params() { + return primitive_params; + } + + @JsonAnySetter + public void setPrimitive_params(Map primitive_params) { + this.primitive_params = primitive_params; + } + + public String getMember_vnf_index() { + return member_vnf_index; + } + + public void setMember_vnf_index(String member_vnf_index) { + this.member_vnf_index = member_vnf_index; + } + + public String getVdu_id() { + return vdu_id; + } + + public void setVdu_id(String vdu_id) { + this.vdu_id = vdu_id; + } + + public String getVdu_count_index() { + return vdu_count_index; + } + + public void setVdu_count_index(String vdu_count_index) { + this.vdu_count_index = vdu_count_index; + } + + public String getPrimitive() { + return primitive; + } + + public void setPrimitive(String primitive) { + this.primitive = primitive; + } + + public void setPrimitiveParams(String primitive_name, String primitive_value) { + } + + public String getParam() { + return param; + } + + public void setParam(String param) { + this.param = param; + } + + public String getLcmOperationType() { + return lcmOperationType; + } + + public void setLcmOperationType(String lcmOperationType) { + this.lcmOperationType = lcmOperationType; + } + + public String getNsInstanceId() { + return nsInstanceId; + } + + public void setNsInstanceId(String nsInstanceId) { + this.nsInstanceId = nsInstanceId; + } + + public String getVnf_member_index() { + return vnf_member_index; + } + + public void setVnf_member_index(String vnf_member_index) { + this.vnf_member_index = vnf_member_index; + } + + public String getKdu_name() { + return kdu_name; + } + + public void setKdu_name(String kdu_name) { + this.kdu_name = kdu_name; + } + + public Integer getTimeout_ns_action() { + return timeout_ns_action; + } + + public void setTimeout_ns_action(Integer timeout_ns_action) { + this.timeout_ns_action = timeout_ns_action; + } + + public String toJSON() + { + String jsonInString=null; + ObjectMapper mapper = new ObjectMapper(); + mapper.setSerializationInclusion(Include.NON_NULL); + try { + jsonInString = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(this); + } catch (JsonProcessingException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + return jsonInString; + } +} + -- GitLab From 393f57fcee2797b0cbfd91e6d20265dedfeff48c Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 8 Dec 2023 15:07:16 +0000 Subject: [PATCH 02/10] added mvn artifact ci automation --- .gitlab-ci.yml | 8 ++++++++ ci_settings.xml | 16 ++++++++++++++++ pom.xml | 17 +++++++++++++++++ 3 files changed, 41 insertions(+) create mode 100644 .gitlab-ci.yml create mode 100644 ci_settings.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..db0ad64 --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,8 @@ +stages: + - deploy + +deploy: + stage: deploy + image: maven:3.9.5-ibm-semeru-17-focal + script: + - mvn deploy -s ci_settings.xml -DskipTests diff --git a/ci_settings.xml b/ci_settings.xml new file mode 100644 index 0000000..69ad06e --- /dev/null +++ b/ci_settings.xml @@ -0,0 +1,16 @@ + + + + gitlab-maven + + + + Job-Token + ${CI_JOB_TOKEN} + + + + + + diff --git a/pom.xml b/pom.xml index dd449d0..9daebfe 100644 --- a/pom.xml +++ b/pom.xml @@ -34,6 +34,23 @@ 3.1.2 + + + gitlab-maven + https://labs.etsi.org/rep/api/v4/groups/260/-/packages/maven + + + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + opendaylight-release -- GitLab From bd93f200a84ae134769e051ec4b7908e4668129e Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 8 Dec 2023 15:09:04 +0000 Subject: [PATCH 03/10] removed duplicate label --- pom.xml | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/pom.xml b/pom.xml index 9daebfe..152d975 100644 --- a/pom.xml +++ b/pom.xml @@ -33,23 +33,6 @@ apache_v2 3.1.2 - - - - gitlab-maven - https://labs.etsi.org/rep/api/v4/groups/260/-/packages/maven - - - - - gitlab-maven - ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven - - - gitlab-maven - ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven - - @@ -66,6 +49,10 @@ + + gitlab-maven + https://labs.etsi.org/rep/api/v4/groups/260/-/packages/maven + opendaylight-release opendaylight-release @@ -77,6 +64,16 @@ https://nexus.opendaylight.org/content/repositories/opendaylight.snapshot/ + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + + gitlab-maven + ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/maven + + -- GitLab From 5028b967a1d60ba0f680d2598fb5035b517d27d7 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 12:36:22 +0000 Subject: [PATCH 04/10] refactored ci to use inheritance --- .gitlab-ci.yml | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db0ad64..d400fd1 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,8 +1,21 @@ -stages: - - deploy +include: + - project: osl/code/org.etsi.osl.main + ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + file: + - ci-templates/default.yml + - ci-templates/build.yml + only: + - main + - develop -deploy: - stage: deploy - image: maven:3.9.5-ibm-semeru-17-focal - script: - - mvn deploy -s ci_settings.xml -DskipTests + - project: osl/code/org.etsi.osl.main + ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + file: + - ci-templates/default.yml + - ci-templates/build_unprotected.yml + except: + - main + - develop + +maven_build: + extends: .maven_build -- GitLab From 46ce8d34d50b8e8c993e3044be1e6547cf58319e Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Tue, 19 Dec 2023 13:51:00 +0000 Subject: [PATCH 05/10] used dynamic ref in inheritance --- .gitlab-ci.yml | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d400fd1..49a3cd4 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,27 @@ include: - project: osl/code/org.etsi.osl.main - ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + ref: main file: - ci-templates/default.yml - ci-templates/build.yml - only: - - main - - develop + rules: + - if: '$CI_COMMIT_REF_NAME == "main"' + + - project: osl/code/org.etsi.osl.main + ref: develop + file: + - ci-templates/default.yml + - ci-templates/build.yml + rules: + - if: '$CI_COMMIT_REF_NAME == "develop"' - project: osl/code/org.etsi.osl.main - ref: 12-update-gitlab-ci-file-to-use-inherited-jobs-from-main + ref: develop file: - ci-templates/default.yml - ci-templates/build_unprotected.yml - except: - - main - - develop + rules: + - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"' maven_build: extends: .maven_build -- GitLab From e2779af3abfffcf45af1d77775de04005d5985ea Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 18 Jan 2024 11:01:04 +0000 Subject: [PATCH 06/10] version per osl component from parent --- pom.xml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pom.xml b/pom.xml index 152d975..301daa6 100644 --- a/pom.xml +++ b/pom.xml @@ -1,12 +1,16 @@ + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 4.0.0 - - org.etsi.osl.sol005nbi - org.etsi.osl.sol005nbi.osm - 1.2.0-SNAPSHOT + + org.etsi.osl + org.etsi.osl.main + 1.0.0-SNAPSHOT + ../org.etsi.osl.main + + jar + org.etsi.osl.sol005nbi.osm org.etsi.osl.sol005nbi.osm -- GitLab From 7e58b607d6f3bc1925153a2e3b8427b469a6389c Mon Sep 17 00:00:00 2001 From: trantzas Date: Mon, 22 Jan 2024 11:50:44 +0000 Subject: [PATCH 07/10] Upload license file --- LICENSE | 201 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..261eeb9 --- /dev/null +++ b/LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + 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. -- GitLab From 5d5c2b1866b7a1dc713fc0e6dc98885596cdbb82 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Thu, 13 Jun 2024 12:40:29 +0000 Subject: [PATCH 08/10] feat: version 1.0.0 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 301daa6..5902de6 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ org.etsi.osl org.etsi.osl.main - 1.0.0-SNAPSHOT + 1.0.0 ../org.etsi.osl.main -- GitLab From 41bb6b14b96a77bfb2fb934370af738d498de1ab Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 14 Jun 2024 11:34:48 +0000 Subject: [PATCH 09/10] fix: add protected run --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 49a3cd4..1e7d6e7 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,7 @@ include: - ci-templates/default.yml - ci-templates/build.yml rules: - - if: '$CI_COMMIT_REF_NAME == "develop"' + - if: '$CI_COMMIT_REF_NAME == "develop" || $CI_COMMIT_REF_PROTECTED' - project: osl/code/org.etsi.osl.main ref: develop @@ -21,7 +21,7 @@ include: - ci-templates/default.yml - ci-templates/build_unprotected.yml rules: - - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"' + - if: '$CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop" && !$CI_COMMIT_REF_PROTECTED' maven_build: extends: .maven_build -- GitLab From 6e82bf48f1a016ca585653e9bde2a955a48653f3 Mon Sep 17 00:00:00 2001 From: Dimitrios Giannopoulos Date: Fri, 14 Jun 2024 13:00:11 +0000 Subject: [PATCH 10/10] fix: side branch references main's side branch --- .gitlab-ci.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1e7d6e7..3d872f6 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,7 +13,15 @@ include: - ci-templates/default.yml - ci-templates/build.yml rules: - - if: '$CI_COMMIT_REF_NAME == "develop" || $CI_COMMIT_REF_PROTECTED' + - if: '$CI_COMMIT_REF_NAME == "develop"' + + - project: osl/code/org.etsi.osl.main + ref: $CI_COMMIT_REF_NAME + file: + - ci-templates/default.yml + - ci-templates/build.yml + rules: + - if: '$CI_COMMIT_REF_PROTECTED && $CI_COMMIT_REF_NAME != "main" && $CI_COMMIT_REF_NAME != "develop"' - project: osl/code/org.etsi.osl.main ref: develop -- GitLab