diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..5daa7fad994533601e34c5790acbe779f0e54bee --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +/target/ +/bin/ +/target-ide/ +/.project +/.classpath +/.settings + diff --git a/README.md b/README.md index c6d3f3e064e817ed5a61113c7ade11a0d842ed12..c33123d8898fa2c28efb5dba77d1745b3928bf7e 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,3 @@ # org.etsi.osl.sol005nbi.osm10 - - -## Getting started - -To make it easy for you to get started with GitLab, here's a list of recommended next steps. - -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! - -## Add your files - -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: - -``` -cd existing_repo -git remote add origin https://labs.etsi.org/rep/osl/code/org.etsi.osl.sol005nbi.osm10.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://labs.etsi.org/rep/osl/code/org.etsi.osl.sol005nbi.osm10/-/settings/integrations) - -## Collaborate with your team - -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) - -*** - -# Editing this README - -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. - -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. - -## Name -Choose a self-explaining name for your project. - -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. - -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. - -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. - -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. - -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. - -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. - -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. - -## Contributing -State if you are open to contributions and what your requirements are for accepting them. - -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. - -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. - -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. - -## License -For open source projects, say how it is licensed. - -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. +OSM TEN NBI implementation diff --git a/hackfest_multivdu_vnf.tar b/hackfest_multivdu_vnf.tar new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d Binary files /dev/null and b/hackfest_multivdu_vnf.tar differ diff --git a/hackfest_multivdu_vnf.zip b/hackfest_multivdu_vnf.zip new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d Binary files /dev/null and b/hackfest_multivdu_vnf.zip differ diff --git a/pathname b/pathname new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d Binary files /dev/null and b/pathname differ diff --git a/pathname.tar b/pathname.tar new file mode 100644 index 0000000000000000000000000000000000000000..ca7fd60c5af40c8f62255a5d1a37cc694154fd0d Binary files /dev/null and b/pathname.tar differ diff --git a/pathname.tar.gz b/pathname.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..671f765eef81a4dc7b7a8b1a6ad2c141027ae6a3 Binary files /dev/null and b/pathname.tar.gz differ diff --git a/pom-generate-sources.xml b/pom-generate-sources.xml new file mode 100644 index 0000000000000000000000000000000000000000..3b3efb4c15732090ebf47bd23268b4ee915e059b --- /dev/null +++ b/pom-generate-sources.xml @@ -0,0 +1,16 @@ + + + 4.0.0 + + org.opendaylight.mdsal + binding-parent + 6.0.5 + + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm10 jar + Descriptive Name Goes Here + 0.0.1-SNAPSHOT + \ No newline at end of file diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000000000000000000000000000000000000..f9f92e8f1740d50a93136a63454f1f0902724962 --- /dev/null +++ b/pom.xml @@ -0,0 +1,406 @@ + + 4.0.0 + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm10 + 1.2.0-SNAPSHOT + jar + + org.etsi.osl.sol005nbi.osm10 + + + openslice.io + http://openslice.io + + + 2021 + + + + + + Apache 2.0 + http://www.apache.org/licenses/LICENSE-2.0.txt + repo + A business-friendly OSS license + + + + + + 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/ + + + + + + UTF-8 + ${project.build.directory}/generated-sources/mdsal-binding + UTF-8 + 2.0.0 + apache_v2 + 3.1.2 + 4.0.0-RC2 + + + + + + org.opendaylight.yangtools + yangtools-artifacts + 6.0.5 + pom + + + + 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 + + + + com.google.code.findbugs + annotations + 3.0.1 + + + org.opendaylight.yangtools + yang-common + 6.0.5 + + + + org.opendaylight.mdsal + yang-binding + 7.0.6 + + + + org.opendaylight.yangtools + yang-binding + 0.7.4-Lithium-SR4 + + + + + + + org.apache.httpcomponents.client5 + httpclient5 + 5.2.1 + + + + org.apache.httpcomponents.client5 + httpclient5-fluent + 5.2.1 + + + + + + org.etsi.osl.sol005nbi + org.etsi.osl.sol005nbi.osm + ${project.version} + + + 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.json + json + 20210307 + jar + + + org.apache.geronimo.specs + geronimo-jpa_2.0_spec + 1.1 + + + log4j + log4j + 1.2.17 + + + + + + + org.apache.commons + commons-compress + 1.20 + + + + + commons-io + commons-io + 2.8.0 + + + + + org.eclipse.jdt + org.eclipse.jdt.annotation + 2.2.600 + + + + + + + + + + + + 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/OSMNBIClient,src/main/java/OSMUtil + + + + 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/OSM10NBIClient/NSActionRequestPayload.java b/src/main/java/OSM10NBIClient/NSActionRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..e9eb3237dcb8baed63dbaa3bea64e01d69812fd9 --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSActionRequestPayload.java @@ -0,0 +1,158 @@ +/*- + * ========================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 OSM10NBIClient; + +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; + } +} + diff --git a/src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java b/src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..e0154d07c8d9ab5ab15983be0290a8eea6c116db --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSCreateInstanceRequestPayload.java @@ -0,0 +1,37 @@ +/*- + * ========================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 OSM10NBIClient; + +/** + * @author ctranoris + * + */ +public class NSCreateInstanceRequestPayload extends NSInstantiateInstanceRequestPayload +{ + private final String notificationType = "NsIdentifierCreationNotification"; + + public NSCreateInstanceRequestPayload() + { + super(); + } +} + diff --git a/src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java b/src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..c6530b6a229d3ad93324a6bdc39b1ff60cc07ba7 --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSInstantiateInstanceRequestPayload.java @@ -0,0 +1,209 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * 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 OSM10NBIClient; + +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 NSInstantiateInstanceRequestPayload +{ + 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/OSM10NBIClient/NSScaleRequestPayload.java b/src/main/java/OSM10NBIClient/NSScaleRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..ae3ce45869b27a3fd67fc93e326773824438595e --- /dev/null +++ b/src/main/java/OSM10NBIClient/NSScaleRequestPayload.java @@ -0,0 +1,158 @@ +/*- + * ========================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 OSM10NBIClient; + +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 NSScaleRequestPayload +{ + + private class ScaleVnfData + { + private class ScaleByStepData + { + private String scaling_group_descriptor; + private String member_vnf_index; + 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 ScaleVnfType scaleVnfType; + private String vnfInstanceId; + private ScaleByStepData 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 ScaleVnfType getScaleVnfType() { + return scaleVnfType; + } + public void setScaleVnfType(ScaleVnfType scaleVnfType) { + this.scaleVnfType = scaleVnfType; + } + + } + + private String lcmOperationType; //"lcmOperationType": "scale" + private String nsInstanceId; + private String scaleType; + private String timeout_ns_scale; + private ScaleVnfData 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/OSM10NBIClient/OSM10Client.java b/src/main/java/OSM10NBIClient/OSM10Client.java new file mode 100644 index 0000000000000000000000000000000000000000..cbc532bd1d10d1b79e727e86530c15390c0ef348 --- /dev/null +++ b/src/main/java/OSM10NBIClient/OSM10Client.java @@ -0,0 +1,1503 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * 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 Ioannis Chatzis + * + * Describes a MANO provider that can be accessed via an API + * + */ + +package OSM10NBIClient; + +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.IOException; +import java.io.InputStream; +import java.net.URL; +import java.net.URLConnection; +import java.security.KeyManagementException; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; + +import javax.net.ssl.HostnameVerifier; +import javax.net.ssl.SSLContext; + +import org.apache.commons.io.FileUtils; +import org.apache.hc.client5.http.classic.HttpClient; +import org.apache.hc.client5.http.config.RequestConfig; +import org.apache.hc.client5.http.cookie.Cookie; +import org.apache.hc.client5.http.cookie.StandardCookieSpec; +import org.apache.hc.client5.http.impl.classic.HttpClients; +import org.apache.hc.client5.http.impl.io.PoolingHttpClientConnectionManager; +import org.apache.hc.client5.http.io.HttpClientConnectionManager; +import org.apache.hc.client5.http.socket.ConnectionSocketFactory; +import org.apache.hc.client5.http.socket.PlainConnectionSocketFactory; +import org.apache.hc.client5.http.ssl.NoopHostnameVerifier; +import org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory; +import org.apache.hc.client5.http.ssl.TrustSelfSignedStrategy; +import org.apache.hc.core5.http.config.Registry; +import org.apache.hc.core5.http.config.RegistryBuilder; +import org.apache.hc.core5.ssl.SSLContextBuilder; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; +import org.etsi.osl.sol005nbi.OSMClient; +import org.json.JSONArray; +import org.json.JSONException; +import org.json.JSONObject; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.vnfd.rev170228.project.vnfd.catalog.Vnfd; +//import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +import org.springframework.http.HttpEntity; +import org.springframework.http.HttpHeaders; +import org.springframework.http.HttpMethod; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.http.client.HttpComponentsClientHttpRequestFactory; +import org.springframework.web.client.HttpClientErrorException; +import org.springframework.web.client.HttpStatusCodeException; +import org.springframework.web.client.RestTemplate; + +import com.fasterxml.jackson.databind.ObjectMapper; +import com.fasterxml.jackson.dataformat.yaml.YAMLFactory; + +public class OSM10Client implements OSMClient { + + private static final Logger logger = LogManager.getLogger(OSM10Client.class); + + private HttpClient httpClient; + private String manoProjectId; + private String manoUsername; + private String manoPassword; + private HttpComponentsClientHttpRequestFactory requestFactory; + private String manoApiEndpoint = null; + private String manoAuthorizationBasicHeader = null; + private static Double manoAuthorizationTokenTimeout = 1.0; + private static String manoAuthorizationTokenID = null; + + public static void main(String args[]) { + logger.info("Make your calls here"); + } + + public OSM10Client(String apiEndpoint, String username, String password, String project_id) + throws HttpStatusCodeException { + this.setMANOPassword(password); + this.setMANOUsername(username); + this.setMANOProjectId(project_id); + this.setMANOApiEndpoint(apiEndpoint); + OSM10ClientInit(); + } + + public void closeConn() { +// try { +// this.httpClient.close(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + try { + this.requestFactory.destroy(); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + private void OSM10ClientInit() throws HttpStatusCodeException { + this.authenticateMANO(); + + // use the TrustSelfSignedStrategy to allow Self Signed Certificates + SSLContext sslContext; + try { + sslContext = SSLContextBuilder.create().loadTrustMaterial(new TrustSelfSignedStrategy()).build(); + // we can optionally disable hostname verification. + // if you don't want to further weaken the security, you don't have to include + // this. + HostnameVerifier allowAllHosts = new NoopHostnameVerifier(); + + // create an SSL Socket Factory to use the SSLContext with the trust self signed + // certificate strategy + // and allow all hosts verifier. + SSLConnectionSocketFactory sslConnectionFactory = new SSLConnectionSocketFactory(sslContext, allowAllHosts); + RegistryBuilder registryBuilder = RegistryBuilder.create(); + registryBuilder.register("https", sslConnectionFactory); + registryBuilder.register("http", PlainConnectionSocketFactory.INSTANCE); + Registry rgb = registryBuilder.build(); + + HttpClientConnectionManager ccm = new PoolingHttpClientConnectionManager( rgb ); + + httpClient = HttpClients + .custom() + .setConnectionManager(ccm) + .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec(StandardCookieSpec.STRICT).build()) + .build(); + requestFactory = new HttpComponentsClientHttpRequestFactory(); + + requestFactory.setHttpClient(httpClient); + requestFactory.setConnectTimeout(2000); + } catch (KeyManagementException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (KeyStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } + + public void getUsers() { + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + ResponseEntity entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/users/", + HttpMethod.GET, request, String.class); + logger.debug(entity.getHeaders().toString()); + logger.debug(entity.getBody()); + logger.debug(entity.toString()); + } + + public ResponseEntity getOSMResponse(String reqURL) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = null; + try { + entity = restTemplate.exchange(this.getMANOApiEndpoint() + reqURL, HttpMethod.GET, request, String.class); + } catch (final HttpClientErrorException e) { + entity = ResponseEntity.status(e.getStatusCode()).body(e.getResponseBodyAsString()); + logger.debug(e.getStatusCode()); + logger.debug(e.getResponseBodyAsString()); + } + return entity; + } + + public ResponseEntity getOSMDeleteResponse(String reqURL) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange(this.getMANOApiEndpoint() + reqURL, HttpMethod.DELETE, + request, String.class); + return entity; + } + + public void getVNFPackages() { + ResponseEntity response = this.getOSMResponse("/osm/vnfpkgm/v1/vnf_packages/"); + logger.debug(response.getHeaders().toString()); + String body_tmp = response.getBody(); + logger.debug(body_tmp); + JSONArray jsonArray = new JSONArray(body_tmp); + logger.debug(jsonArray); + } + + public Vnfd[] getVNFDs() { + ResponseEntity response = this.getOSMResponse("/osm/vnfpkgm/v1/vnf_packages/"); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + + try { + Vnfd[] vnfd_array = (Vnfd[]) mapper.readValue(new YAMLFactory().createParser(response.getBody()), + Vnfd[].class); + return vnfd_array; + } catch (IllegalStateException | IOException e) { + logger.debug(response.getBody()); + logger.error(e.getMessage()); + e.printStackTrace(); + } + return null; + } + + public ResponseEntity getVNFDescriptorsList() { + logger.debug("Get VIMs Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_vnfd_entities = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_vnfd_entities = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_vnfd_entities != null) { + if (get_vnfd_entities.getStatusCode().is5xxServerError() ) { + // handle SERVER_ERROR + + logger.error("Server ERROR:" + get_vnfd_entities.getStatusCode().toString()); + } else if (get_vnfd_entities.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_vnfd_entities.getStatusCode().toString()); + if (get_vnfd_entities.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_vnfd_entities.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_vnfd_entities.getHeaders().toString()); + logger.debug(get_vnfd_entities.getBody()); + logger.debug(get_vnfd_entities.toString()); + return get_vnfd_entities; + } + + public Nsd[] getNSDs() { + ResponseEntity response = this.getOSMResponse("/osm/nsd/v1/ns_descriptors"); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Nsd[] nsd_array = (Nsd[]) mapper.readValue(new YAMLFactory().createParser(response.getBody()), Nsd[].class); + return nsd_array; + + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + return null; + } + + public ResponseEntity createVNFDPackage() { + // Create an instance of VNFD Package to fill. + // This is accomplished by posting to "/osm/vnfpkgm/v1/vnf_packages" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + try { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages", HttpMethod.POST, + request, String.class); + + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity createNSDPackage() { + // Create an instance of VNFD Package to fill. + // This is accomplished by posting to "/osm/vnfpkgm/v1/vnf_packages" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + try { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors", HttpMethod.POST, + request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + private byte[] getByteArrayFromPackagePath(String package_path) throws Exception { + byte[] allBytes; + logger.info("Package path = " + package_path); + if (package_path.contains("http") || package_path.contains("localhost")) { + logger.info("Taking the http/localhost logic path"); + URL url = new URL(package_path); + URLConnection conn = url.openConnection(); + logger.info("Trying to open connection to URL"); + logger.info("URL Connection " + conn.toString()); + int contentLength = conn.getContentLength(); + logger.info("Content-Length:" + contentLength); + InputStream inputStream = url.openStream(); + + ByteArrayOutputStream tmpOut; + if (contentLength != -1) { + tmpOut = new ByteArrayOutputStream(contentLength); + } else { + tmpOut = new ByteArrayOutputStream(16384); // Pick some appropriate size + } + + byte[] buf = new byte[512]; + while (true) { + int len = inputStream.read(buf); + if (len == -1) { + break; + } + tmpOut.write(buf, 0, len); + } + tmpOut.close(); // No effect, but good to do anyway to keep the metaphor alive + allBytes = tmpOut.toByteArray(); + logger.info("Package allBytes size = " + allBytes.length); + logger.info("Package Filesize: " + contentLength + " bytes."); + inputStream.close(); + } else { + logger.info("Taking the local file path"); + InputStream inputStream = new FileInputStream(package_path); + long fileSize = new File(package_path).length(); + allBytes = new byte[(int) fileSize]; + inputStream.read(allBytes); + logger.info("Package Filesize: " + fileSize + " bytes."); + inputStream.close(); + } + return allBytes; + } + + public ResponseEntity uploadVNFDPackageContent(String vnfd_id, String package_path) throws IOException { + + byte[] allBytes; + try { + allBytes = this.getByteArrayFromPackagePath(package_path); + } catch (Exception e) { + logger.error("Error during VNFD Package file uploading! " + e.getStackTrace().toString()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body("Error during VNFD Package file uploading! " + e.getMessage().toString()); + } + + return this.uploadVNFDPackageContent(vnfd_id, allBytes); + } + + @Override + public ResponseEntity uploadNSDPackageContent(String nsd_id, String package_path) throws IOException { + byte[] allBytes; + try { + allBytes = this.getByteArrayFromPackagePath(package_path); + } catch (Exception e) { + logger.error("Error during NSD Package file uploading! " + e.getStackTrace().toString()); + return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR) + .body("Error during NSD Package file uploading! " + e.getMessage().toString()); + } + return this.uploadNSDPackageContent(nsd_id, allBytes); + } + + public ResponseEntity uploadVNFDPackageContent(String vnfd_id, byte[] allBytes) throws IOException { + + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/gzip"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity send_zip_request = new HttpEntity<>(allBytes, headers); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/" + vnfd_id + "/package_content", + HttpMethod.PUT, send_zip_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity getVNFDPackageContent(String vnfd_id) throws IOException { + + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/zip"); + headers.add("Accept", "application/zip,application/yaml"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity send_zip_request = new HttpEntity(headers); + ResponseEntity get_vnfd_package_content = null; + try { + get_vnfd_package_content = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/" + vnfd_id + "/vnfd", + HttpMethod.GET, send_zip_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + FileUtils.writeStringToFile(new File("pathname"), get_vnfd_package_content.getBody()); + //.writeByteArrayToFile(new File("pathname"), get_vnfd_package_content.getBody().getBytes(Charset.defaultCharset())); + logger.debug(get_vnfd_package_content); + return get_vnfd_package_content; + } + + public ResponseEntity uploadNSDPackageContent(String nsd_id, byte[] allBytes) throws IOException { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/gzip"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity send_zip_request = new HttpEntity<>(allBytes, headers); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/" + nsd_id + "/nsd_content", HttpMethod.PUT, + send_zip_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + // Creates an NS Instance based on vim_id and nsd_id. + public String createNSInstance(String ns_name, String vim_id, String nsd_id) { + // Response example + // {"notificationType": + // "NsIdentifierCreationNotification","nsName":"mynsi","vimAccountId":"8e0929c5-4cc2-4a78-887f-d3642336e18c","nsdId":"07191481-0213-4b24-a7dd-a2e98e76803c"} + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + // String body="{\"notificationType\": + // \"NsIdentifierCreationNotification\",\"nsName\":\"mynsi\",\"vimAccountId\":\""+vim_id+"\",\"nsdId\":\""+nsd_id+"\"}"; + String body = "{\"notificationType\": \"NsIdentifierCreationNotification\",\"nsName\":\"" + ns_name + + "\",\"vimAccountId\":\"" + vim_id + "\",\"nsdId\":\"" + nsd_id + "\"}"; + + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity create_ns_instance_entity = null; + logger.debug(create_ns_instance_request); + try { + create_ns_instance_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (create_ns_instance_entity != null) { + if (create_ns_instance_entity.getStatusCode().is5xxServerError() ) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + } else if (create_ns_instance_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + if (create_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + return null; + } + + if (create_ns_instance_entity.getStatusCode() == HttpStatus.NO_CONTENT) { + logger.error("No Content Replied!"); + } + if (create_ns_instance_entity.getStatusCode() == HttpStatus.CREATED) { + logger.info("NS Instance Creation Succeded!"); + } + logger.debug(create_ns_instance_entity.getBody()); + JSONObject obj = new JSONObject(create_ns_instance_entity.getBody()); + String ns_instance_id = obj.getString("id"); + logger.info("The new NS Instance id is :" + ns_instance_id); + return ns_instance_id; + } + + public ResponseEntity createNSInstance2(String payload) { + // Response example + // {"notificationType": + // "NsIdentifierCreationNotification","nsName":"mynsi","vimAccountId":"8e0929c5-4cc2-4a78-887f-d3642336e18c","nsdId":"07191481-0213-4b24-a7dd-a2e98e76803c"} + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + // String body="{\"notificationType\": + // \"NsIdentifierCreationNotification\",\"nsName\":\"mynsi\",\"vimAccountId\":\""+vim_id+"\",\"nsdId\":\""+nsd_id+"\"}"; + String body = payload; + + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity create_ns_instance_entity = null; + logger.debug(create_ns_instance_request); + try { + create_ns_instance_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (create_ns_instance_entity != null) { + if (create_ns_instance_entity.getStatusCode().is5xxServerError() ) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + } else if (create_ns_instance_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_ns_instance_entity.getStatusCode().toString()); + if (create_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + } + + return create_ns_instance_entity; + } + + public ResponseEntity createNSInstance(String payload) { + // Response example + // {"notificationType": + // "NsIdentifierCreationNotification","nsName":"mynsi","vimAccountId":"8e0929c5-4cc2-4a78-887f-d3642336e18c","nsdId":"07191481-0213-4b24-a7dd-a2e98e76803c"} + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + // String body="{\"notificationType\": + // \"NsIdentifierCreationNotification\",\"nsName\":\"mynsi\",\"vimAccountId\":\""+vim_id+"\",\"nsdId\":\""+nsd_id+"\"}"; + String body = payload; + + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/", HttpMethod.POST, + create_ns_instance_request, String.class); + + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public JSONObject getNSInstanceInfo(String ns_instance_id) { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_instances/" + ns_instance_id); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONObject ns_instance_info_obj = new JSONObject(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public JSONArray getAllNSInstanceInfo() { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_instances/"); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONArray ns_instance_info_obj = new JSONArray(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public JSONObject getNSInstanceContentInfo(String ns_instance_id) { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_instances_content/" + ns_instance_id); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONObject ns_instance_info_obj = new JSONObject(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public JSONObject getNSLCMDetails(String nsLcmOpOccId) { + ResponseEntity ns_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/ns_lcm_op_occs/" + nsLcmOpOccId); + logger.info("Status of Request: " + ns_instance_id_info_response.getStatusCode()); + if (!ns_instance_id_info_response.getStatusCode().is4xxClientError() + && !ns_instance_id_info_response.getStatusCode().is5xxServerError()) { + JSONObject ns_instance_info_obj = new JSONObject(ns_instance_id_info_response.getBody()); + return ns_instance_info_obj; + } else + return null; + } + + public ResponseEntity getNSLCMDetailsList() { + return this.getOSMResponse("/osm/nslcm/v1/ns_lcm_op_occs/"); + } + + public JSONObject getVNFInstanceInfo(String vnf_instance_id) { + ResponseEntity vnf_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/vnf_instances/" + vnf_instance_id); + JSONObject vnf_instance_info_obj = new JSONObject(vnf_instance_id_info_response.getBody()); + return vnf_instance_info_obj; + } + + public String getPDUDetails() { + ResponseEntity pdu_details_response = this.getOSMResponse("/pdu/v1/pdu_descriptors/"); + // JSONObject pdu_details_response_obj = new + // JSONObject(pdu_details_response.getBody()); + return pdu_details_response.toString(); + } + + public ResponseEntity getVNFInstanceInfoNew(String vnf_instance_id) { + ResponseEntity vnf_instance_id_info_response = this + .getOSMResponse("/osm/nslcm/v1/vnf_instances/" + vnf_instance_id); + // We should check if we got an error response. + // If we didn't we could do the JSON conversion in the application + // If we did get an error response we should decide on the behavior + try { + return vnf_instance_id_info_response; + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity instantiateNSInstance(String ns_instance_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/instantiate"); + + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/instantiate", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity actionNSInstance(String ns_instance_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/action"); + + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/action", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public String terminateNSInstance(String ns_instance_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate"); + + ResponseEntity terminate_ns_instance_entity = null; + try { + terminate_ns_instance_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate", + HttpMethod.POST, request, String.class); + } catch (RuntimeException e) { + if (terminate_ns_instance_entity != null) { + if (terminate_ns_instance_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + terminate_ns_instance_entity.getStatusCode().toString()); + } else if (terminate_ns_instance_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + terminate_ns_instance_entity.getStatusCode().toString()); + if (terminate_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + terminate_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + return null; + } + + if (terminate_ns_instance_entity.getStatusCode() == HttpStatus.NO_CONTENT) { + logger.error("No Content Replied!"); + } + if (terminate_ns_instance_entity.getStatusCode() == HttpStatus.CREATED) { + logger.info("NS Termination Succeded!"); + } + logger.debug(terminate_ns_instance_entity.getBody()); + JSONObject obj = new JSONObject(terminate_ns_instance_entity.getBody()); + String ns_instanciation_id = obj.getString("id"); + logger.info("The NS termination id is :" + ns_instanciation_id); + return ns_instanciation_id; + + } + + public ResponseEntity terminateNSInstanceNew(String ns_instance_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate"); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/terminate", + HttpMethod.POST, request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public ResponseEntity deleteNSInstance(String ns_instance_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity delete_ns_instance_entity = null; + delete_ns_instance_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id, HttpMethod.DELETE, request, + String.class); + if (delete_ns_instance_entity != null) { + if (delete_ns_instance_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + delete_ns_instance_entity.getStatusCode().toString()); + } else if (delete_ns_instance_entity.getStatusCode().is4xxClientError() ) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + delete_ns_instance_entity.getStatusCode().toString()); + if (delete_ns_instance_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + delete_ns_instance_entity.getBody()); + } else { + logger.error("Error! Null Response"); + } + + if (delete_ns_instance_entity.getStatusCode() == HttpStatus.NO_CONTENT) { + logger.error("No Content Replied!"); + } + if (delete_ns_instance_entity.getStatusCode() == HttpStatus.CREATED) { + logger.info("NS Deletion Succeded!"); + } + logger.debug("The NS instance deletion response is :" + delete_ns_instance_entity.getBody()); + return delete_ns_instance_entity; + } + + public ResponseEntity deleteNSInstanceNew(String ns_instance_id, boolean force) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + try { + if (force) { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "?FORCE=TRUE", + HttpMethod.DELETE, request, String.class); + } else { + return restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id, + HttpMethod.DELETE, request, String.class); + } + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + public Vnfd getVNFDbyID(String aVNFDid) { + logger.debug("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ResponseEntity response = this.getOSMResponse("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Vnfd vnfd = (Vnfd) mapper.readValue(new YAMLFactory().createParser(response.getBody()), Vnfd.class); + return vnfd; + } catch (IllegalStateException | IOException e) { +// logger.error(e.getMessage() ); + e.printStackTrace(); + } + return null; + } + + public Nsd getNSDbyID(String aNSDid) { + logger.debug("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ResponseEntity response = this.getOSMResponse("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Nsd nsd = (Nsd) mapper.readValue(new YAMLFactory().createParser(response.getBody()), Nsd.class); + logger.debug(nsd.toString()); + return nsd; + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + return null; + } + + public void deleteVNFDbyID(String aVNFDid) { + logger.debug("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ResponseEntity response = this.getOSMDeleteResponse("/osm/vnfpkgm/v1/vnf_packages/" + aVNFDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Vnfd vnfd = mapper.readValue(new YAMLFactory().createParser(response.getBody()), Vnfd.class); + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + } + + public ResponseEntity deleteVNFDPackage(String vnfd_id) throws HttpClientErrorException { + // Create an instance of VNFD Package to fill. + // This is accomplished by posting to "/osm/vnfpkgm/v1/vnf_packages" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = null; + try { + entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/vnfpkgm/v1/vnf_packages/" + vnfd_id, + HttpMethod.DELETE, request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + logger.info("The delete NSD Package with id " + vnfd_id + " returned :" + entity.toString()); + + return entity; + } + + public void deleteNSDbyID(String aNSDid) { + logger.debug("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ResponseEntity response = this.getOSMDeleteResponse("/osm/nsd/v1/ns_descriptors/" + aNSDid); + ObjectMapper mapper = new ObjectMapper(new YAMLFactory()); + try { + Nsd nsd = mapper.readValue(new YAMLFactory().createParser(response.getBody()), Nsd.class); + } catch (IllegalStateException | IOException e) { + logger.error(e.getMessage()); + e.printStackTrace(); + } + } + + public ResponseEntity deleteNSDPackage(String nsd_id) { + // Create an instance of NSD Package to fill. + // This is accomplished by posting to "/osm/nsd/v1/ns_descriptors/" + // The API returns the ID of the instance. + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = null; + try { + entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/" + nsd_id, + HttpMethod.DELETE, request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + logger.info("The delete NSD Package with id " + nsd_id + " returned :" + entity.toString()); + return entity; + } + + public void authenticateMANO() throws HttpStatusCodeException { + // use the TrustSelfSignedStrategy to allow Self Signed Certificates + SSLContext sslContext; + try { + sslContext = SSLContextBuilder.create().loadTrustMaterial(new TrustSelfSignedStrategy()).build(); + // we can optionally disable hostname verification. + // if you don't want to further weaken the security, you don't have to include + // this. + HostnameVerifier allowAllHosts = new NoopHostnameVerifier(); + + // create an SSL Socket Factory to use the SSLContext with the trust self signed + // certificate strategy + // and allow all hosts verifier. + SSLConnectionSocketFactory sslConnectionFactory = new SSLConnectionSocketFactory(sslContext, allowAllHosts); + RegistryBuilder registryBuilder = RegistryBuilder.create(); + registryBuilder.register("https", sslConnectionFactory); + registryBuilder.register("http", PlainConnectionSocketFactory.INSTANCE); + Registry rgb = registryBuilder.build(); + + HttpClientConnectionManager ccm = new PoolingHttpClientConnectionManager( rgb ); + + httpClient = HttpClients + .custom() + .setConnectionManager(ccm) + .setDefaultRequestConfig(RequestConfig.custom().setCookieSpec( StandardCookieSpec.STRICT ).build()) + .build(); + requestFactory = new HttpComponentsClientHttpRequestFactory(); + + requestFactory.setHttpClient(httpClient); + requestFactory.setConnectTimeout(2000); + } catch (KeyManagementException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (NoSuchAlgorithmException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } catch (KeyStoreException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + String body = "{\"password\": \"" + this.getMANOPassword() + "\", \"username\": \"" + this.getMANOUsername() + + "\", \"project_id\": \"" + this.getMANOProjectId() + "\"}"; + HttpEntity request = new HttpEntity(body, headers); + logger.debug(request.toString()); + ResponseEntity entity = null; + entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/tokens/", HttpMethod.POST, request, + String.class); + logger.debug(entity.getHeaders().toString()); + logger.debug(entity.getBody()); + logger.debug(entity.toString()); + + JSONObject obj = new JSONObject(entity.getBody()); + this.setΜΑΝΟAuthorizationBasicHeader(obj.getString("id")); + OSM10Client.setManoAuthorizationTokenTimeout(obj.getDouble("expires")); + OSM10Client.setManoAuthorizationTokenID(obj.getString("id")); +// try { +// httpClient.close(); +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } + } + + private static String getManoAuthorizationTokenID() { + // TODO Auto-generated method stub + return OSM10Client.manoAuthorizationTokenID; + } + + private static void setManoAuthorizationTokenID(String tokenID) { + // TODO Auto-generated method stub + OSM10Client.manoAuthorizationTokenID = tokenID; + } + + public String getMANOApiEndpoint() { + return manoApiEndpoint; + } + + public void setMANOApiEndpoint(String apiEndpoint) { + this.manoApiEndpoint = apiEndpoint; + } + + /** + * @return the project_id + */ + public String getMANOProjectId() { + return manoProjectId; + } + + /** + * @param project_id the project_id to set + */ + public void setMANOProjectId(String project_id) { + this.manoProjectId = project_id; + } + + /** + * @return the username + */ + private String getMANOUsername() { + return manoUsername; + } + + /** + * @param username the username to set + */ + public void setMANOUsername(String username) { + this.manoUsername = username; + } + + /** + * @return the password + */ + private String getMANOPassword() { + return manoPassword; + } + + /** + * @param password the password to set + */ + public void setMANOPassword(String password) { + this.manoPassword = password; + } + + public String getMANOAuthorizationBasicHeader() { + return manoAuthorizationBasicHeader; + } + + public void setΜΑΝΟAuthorizationBasicHeader(String authorizationBasicHeader) { + this.manoAuthorizationBasicHeader = authorizationBasicHeader; + } + + /** + * @return the manoAuthorizationTokenTimeout + */ + public static Double getManoAuthorizationTokenTimeout() { + return manoAuthorizationTokenTimeout; + } + + /** + * @param manoAuthorizationTokenTimeout the manoAuthorizationTokenTimeout to set + */ + public static void setManoAuthorizationTokenTimeout(double manoAuthorizationTokenTimeout) { + OSM10Client.manoAuthorizationTokenTimeout = manoAuthorizationTokenTimeout; + } + + public String getNSLCMDetailsListByNSID(String nsid) { + ResponseEntity response = this.getOSMResponse("/osm/nslcm/v1/ns_lcm_op_occs/"); + String response_body = response.getBody(); + try { + JSONArray array = new JSONArray(response_body); + JSONArray array2 = new JSONArray(); + for (int i = 0; i < array.length(); ++i) { + JSONObject obj = array.getJSONObject(i); + String id = obj.getString("nsInstanceId"); + if (id.equals(nsid)) { + array2.put(obj); + } + + } + return array2.toString(); + } catch (JSONException e) { + return null; + } + } + + @Override + public ResponseEntity scaleNSInstance(String ns_instance_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + logger.debug("/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/scale"); + + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + logger.debug(create_ns_instance_request); + try { + return restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/nslcm/v1/ns_instances/" + ns_instance_id + "/scale", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (HttpStatusCodeException e) { + return ResponseEntity.status(e.getRawStatusCode()).headers(e.getResponseHeaders()) + .body(e.getResponseBodyAsString()); + } + } + + + public void getNSDescriptors() { + ResponseEntity response = this.getOSMResponse("/osm/nsd/v1/ns_descriptors/"); + logger.debug(response.getHeaders().toString()); + logger.debug(response.getBody()); + } + + public ResponseEntity getNSDescriptorsList() { + logger.debug("Get NSDs Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_nsd_entities = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_nsd_entities = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_nsd_entities != null) { + if (get_nsd_entities.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + get_nsd_entities.getStatusCode().toString()); + } else if (get_nsd_entities.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_nsd_entities.getStatusCode().toString()); + if (get_nsd_entities.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_nsd_entities.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_nsd_entities.getHeaders().toString()); + logger.debug(get_nsd_entities.getBody()); + logger.debug(get_nsd_entities.toString()); + return get_nsd_entities; + } + + public ResponseEntity getNSInstancesList() { + logger.debug("Get NSInstances Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_ns_instances = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_ns_instances = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/nsd/v1/ns_descriptors/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_ns_instances != null) { + if (get_ns_instances.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + get_ns_instances.getStatusCode().toString()); + } else if (get_ns_instances.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_ns_instances.getStatusCode().toString()); + if (get_ns_instances.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_ns_instances.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_ns_instances.getHeaders().toString()); + logger.debug(get_ns_instances.getBody()); + logger.debug(get_ns_instances.toString()); + return get_ns_instances; + } + + public ResponseEntity getVIMs() + { + logger.debug("Get VIMs Start"); + // Make an authenticated request for users + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + ResponseEntity get_vim_entities = null; + HttpEntity request = new HttpEntity(headers); + logger.debug(request.toString()); + try { + get_vim_entities = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/", + HttpMethod.GET, request, String.class); + } catch (RuntimeException e) { + if (get_vim_entities != null) { + if (get_vim_entities.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + get_vim_entities.getStatusCode().toString()); + } else if (get_vim_entities.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + get_vim_entities.getStatusCode().toString()); + if (get_vim_entities.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + get_vim_entities.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + logger.debug(get_vim_entities.getHeaders().toString()); + logger.debug(get_vim_entities.getBody()); + logger.debug(get_vim_entities.toString()); + return get_vim_entities; + } + + public ResponseEntity createVim(String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity create_vim_entity = null; + logger.debug(create_ns_instance_request); + try { + create_vim_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/", + HttpMethod.POST, create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (create_vim_entity != null) { + if (create_vim_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_vim_entity.getStatusCode().toString()); + } else if (create_vim_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_vim_entity.getStatusCode().toString()); + if (create_vim_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_vim_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return create_vim_entity; + } + + public ResponseEntity editVim(String vim_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_ns_instance_request = new HttpEntity<>(body, headers); + ResponseEntity edit_vim_entity = null; + logger.debug(create_ns_instance_request); + try { + edit_vim_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/" + vim_id + "/", HttpMethod.PATCH, + create_ns_instance_request, String.class); + } catch (RuntimeException e) { + if (edit_vim_entity != null) { + if (edit_vim_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + edit_vim_entity.getStatusCode().toString()); + } else if (edit_vim_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + edit_vim_entity.getStatusCode().toString()); + if (edit_vim_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + edit_vim_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return edit_vim_entity; + } +// public ResponseEntity deleteVim() +// {} + + public ResponseEntity createUser(String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_user_request = new HttpEntity<>(body, headers); + ResponseEntity create_user_entity = null; + logger.debug(create_user_request); + try { + create_user_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/users/", + HttpMethod.POST, create_user_request, String.class); + } catch (RuntimeException e) { + if (create_user_entity != null) { + if (create_user_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_user_entity.getStatusCode().toString()); + } else if (create_user_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_user_entity.getStatusCode().toString()); + if (create_user_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_user_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return create_user_entity; + } + + public ResponseEntity editUser(String user_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + // String + // body="{\"password\":\"123\",\"add_project_role_mappings\":[{\"project\":\"admin\",\"role\":\"project_admin\"},{\"project\":\"test\",\"role\":\"project_admin\"}]}"; + // String body="{\"password\":\"1234\"}"; + // {"username":"ioannis","password":"123","projects":["admin","test"],"project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"add_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"remove_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}]} + + HttpEntity edit_user_request = new HttpEntity<>(body, headers); + ResponseEntity edit_user_entity = null; + logger.debug(edit_user_request); + try { + edit_user_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/users/" + user_id + "/", + HttpMethod.PATCH, edit_user_request, String.class); + } catch (RuntimeException e) { + if (edit_user_entity != null) { + if (edit_user_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + edit_user_entity.getStatusCode().toString()); + } else if (edit_user_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + edit_user_entity.getStatusCode().toString()); + if (edit_user_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + edit_user_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + return edit_user_entity; + } + + public ResponseEntity createProject(String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity create_project_request = new HttpEntity<>(body, headers); + ResponseEntity create_project_entity = null; + logger.debug(create_project_request); + try { + create_project_entity = restTemplate.exchange(this.getMANOApiEndpoint() + "/osm/admin/v1/projects/", + HttpMethod.POST, create_project_request, String.class); + } catch (RuntimeException e) { + if (create_project_entity != null) { + if (create_project_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + create_project_entity.getStatusCode().toString()); + } else if (create_project_entity.getStatusCode().is4xxClientError()) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + create_project_entity.getStatusCode().toString()); + if (create_project_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + create_project_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + + return create_project_entity; + } + + public ResponseEntity editProject(String project_id, String payload) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + String body = payload; + HttpEntity edit_project_request = new HttpEntity<>(body, headers); + ResponseEntity edit_user_entity = null; + logger.debug(edit_project_request); + try { + edit_user_entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/projects/" + project_id + "/", HttpMethod.PATCH, + edit_project_request, String.class); + } catch (RuntimeException e) { + if (edit_user_entity != null) { + if (edit_user_entity.getStatusCode().is5xxServerError()) { + // handle SERVER_ERROR + logger.error("Server ERROR:" + edit_user_entity.getStatusCode().toString()); + } else if (edit_user_entity.getStatusCode().is4xxClientError() ) { + // handle CLIENT_ERROR + logger.error("Client ERROR:" + edit_user_entity.getStatusCode().toString()); + if (edit_user_entity.getStatusCode() == HttpStatus.NOT_FOUND) { + logger.error("Unknown Response Status"); + } + } + logger.error("Error! " + edit_user_entity.getBody()); + } else { + logger.error("Error! Null Response, " + e.getMessage()); + } + } + return edit_user_entity; + } + + public ResponseEntity getProjectDeleteResponse(String project_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/projects/" + project_id + "/", HttpMethod.DELETE, request, + String.class); + return entity; + } + + public ResponseEntity getUserDeleteResponse(String user_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/users/" + user_id + "/", HttpMethod.DELETE, request, + String.class); + return entity; + } + + public ResponseEntity getVIMDeleteResponse(String vim_id) { + RestTemplate restTemplate = new RestTemplate(requestFactory); + HttpHeaders headers = new HttpHeaders(); + headers.add("content-type", "application/json"); + headers.add("accept", "application/json"); + headers.add("Authorization", "Bearer " + this.getMANOAuthorizationBasicHeader()); + HttpEntity request = new HttpEntity(headers); + ResponseEntity entity = restTemplate.exchange( + this.getMANOApiEndpoint() + "/osm/admin/v1/vim_accounts/" + vim_id + "/", HttpMethod.DELETE, request, + String.class); + return entity; + } + +// public ResponseEntity deleteUser() +// {} +// + +// public ResponseEntity createProject() +// {} +// public ResponseEntity editProject() +// {} +// public ResponseEntity deleteProject() +// {} +// + +// +// public ResponseEntity createRole() +// {} +// public ResponseEntity editRole() +// {} +// public ResponseEntity deleteRole() +// {} + +} diff --git a/src/main/java/OSM10NBIClient/OSM10NBIClientT.java b/src/main/java/OSM10NBIClient/OSM10NBIClientT.java new file mode 100644 index 0000000000000000000000000000000000000000..07e1c947da68aed653193caf242b3ff4e152658e --- /dev/null +++ b/src/main/java/OSM10NBIClient/OSM10NBIClientT.java @@ -0,0 +1,488 @@ +package OSM10NBIClient; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Date; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +import org.eclipse.jdt.annotation.Nullable; +import org.etsi.osl.sol005nbi.OSMClient; +import org.json.JSONArray; +import org.json.JSONObject; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.nsd.constituent.vnfd.ConstituentVnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.nsd.constituent.vnfd.ConstituentVnfdKey; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.Nsd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.vnfd.rev170228.project.vnfd.catalog.Vnfd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.nsd.rev170228.project.nsd.catalog.NsdBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.nsd.rev190425.nsd.NsdBuilder; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.project.vnfd.rev170228.project.vnfd.catalog.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +//import org.opendaylight.yang.gen.v1.urn.etsi.osm.yang.vnfr.rev170228.project.vnfr.catalog.vnfr.VnfdBuilder; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder; + +import org.springframework.http.ResponseEntity; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +import OSM10NBIClient.NSInstantiateInstanceRequestPayload.NInterface; +import OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vdu; +import OSM10Util.OSM10VNFReq.OSM10VNFRequirements; + +public class OSM10NBIClientT { + + public static void main(String args[]) { + OSM10Client OSM10Client = new OSM10Client("https://10.10.10.41:9999","admin","admin","admin"); + String body="{\"username\":\"ioannis\",\"domain_name\":\"test\",\"password\":\"123\",\"projects\":[\"admin\",\"test\"],\"project_role_mappings\":[{\"project\":\"admin\",\"role\":\"system_admin\"},{\"project\":\"test\",\"role\":\"system_admin\"}]}"; + //{"username":"ioannis","domain_name":"test","password":"123","projects":["admin","test"],"project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}]} + //String body = payload; + +// //PROJECT CREATE +// ProjectCreateRequestPayload payloadCreateProject = new ProjectCreateRequestPayload(); +// payloadCreateProject.setName("test5"); +// payloadCreateProject.setAdmin(true); +// payloadCreateProject.setDomain_name("test"); +// OSM10Client.createProject(payloadCreateProject.toJSON()); + +// //PROJECT EDIT +// ProjectEditRequestPayload payloadEditProject = new ProjectEditRequestPayload(); +// payloadEditProject.setAdmin(false); +// payloadEditProject.setName("test6"); +// OSM10Client.editProject("521ff1e9-f980-475f-9266-c428de028f37",payloadEditProject.toJSON()); + + //OSM10Client.getProjectDeleteResponse("b127ae37-b39a-4c3e-abe8-8ffb2b4bd61f"); + +// //USER CREATE +// UserCreateRequestPayload payloadNewUser = new UserCreateRequestPayload(); +// payloadNewUser.setUsername("ioannis3"); +// payloadNewUser.setDomain_name("test"); +// payloadNewUser.setPassword("123"); +// List tmpProjects = new ArrayList(); +// tmpProjects.add("admin"); +// tmpProjects.add("test"); +// payloadNewUser.setProjects(tmpProjects); +// ProjectRoleMapping prm = new ProjectRoleMapping("admin","system_admin"); +// List prml = new ArrayList(); +// prml.add(prm); +// prm = new ProjectRoleMapping("test","system_admin"); +// prml.add(prm); +// payloadNewUser.setProject_role_mappings(prml); +// //System.out.println("Payload "+payloadNewUser.toJSON()); +// OSM10Client.createUser(payloadNewUser.toJSON()); + + //USER EDIT +// UserEditRequestPayload payloadEditUser = new UserEditRequestPayload(); +// //payloadEditUser.setUsername("ioannis3"); +// payloadEditUser.setPassword("123"); +// List tmpProjectsEdit = new ArrayList(); +// tmpProjectsEdit.add("admin"); +// tmpProjectsEdit.add("test"); +// tmpProjectsEdit.add("test2"); +// payloadEditUser.setProjects(tmpProjectsEdit); +// List prmlEdit = new ArrayList(); +// prmlEdit.add(new ProjectRoleMapping("admin","system_admin")); +// prmlEdit.add(new ProjectRoleMapping("test","project_user")); +// prmlEdit.add(new ProjectRoleMapping("test2","project_user")); +// payloadEditUser.setProject_role_mappings(prmlEdit); +//// List prmlEdit2 = new ArrayList(); +//// prmlEdit2.add(new ProjectRoleMapping("test2","system_admin")); +//// payloadEditUser.setAdd_project_role_mappings(prmlEdit2); +//// System.out.println("Payload "+payloadEditUser.toJSON()); +// OSM10Client.editUser("1914ec5b-af9a-4f32-8806-b6aa29b302f2",payloadEditUser.toJSON()); + + +// //VIM CREATE +// VIMCreateRequestPayload payloadNewVIM = new VIMCreateRequestPayload(); +// payloadNewVIM.setName("CloudVille3"); +// payloadNewVIM.setVim_type("openstack"); +// payloadNewVIM.setVim_url("http://10.80.0.11:5000/v3/"); +// payloadNewVIM.setVim_tenant_name("OSMFIVE"); +// payloadNewVIM.setVim_user("osmfivevim"); +// payloadNewVIM.setVim_password("osmfivevim5g#"); +// OSM10Client.createVim(payloadNewVIM.toJSON()); + ResponseEntity vims_list_entity = OSM10Client.getVIMs(); + if (vims_list_entity == null || vims_list_entity.getStatusCode().is4xxClientError() + || vims_list_entity.getStatusCode().is5xxServerError()) { + System.out.println("VIMs List Get Request failed. Status Code:" + vims_list_entity.getStatusCode().toString() + + ", Payload:" + vims_list_entity.getBody().toString()); + } else { + // NS action starts + System.out.println("Got VIM list "+vims_list_entity.getBody()); + } + + try { + ResponseEntity vnfd_package_content = OSM10Client.getVNFDPackageContent("5261da07-b38f-4115-863c-1465893bd8d3"); + } catch (IOException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + JSONArray tmp = OSM10Client.getAllNSInstanceInfo(); + System.out.println(tmp.toString()); +// +// //VIM EDIT +// VIMEditRequestPayload payloadEditVIM = new VIMEditRequestPayload(); +// payloadEditVIM.setName("CloudVille"); +// payloadEditVIM.setVim_url("http://10.80.0.11:5000/v3/"); +// payloadEditVIM.setVim_type("Openstack"); +// payloadEditVIM.setDatacenter("datacenter"); +// payloadEditVIM.setDescription("description"); +// payloadEditVIM.setVim_password("osmfivevim5g#"); +// payloadEditVIM.setVim_user("OSMFIVE"); +// String vim_id = "6d080e3b-cbd1-4c4e-a114-9c556c285eb4"; +// OSM10Client.editVim(vim_id,payloadEditVIM.toJSON()); + + +// System.out.println("************************"); +// System.out.println("Getting Users"); +// System.out.println("************************"); +// OSM10Client.getUsers(); +// System.out.println("************************"); +// System.out.println("Getting VNFPackages"); +// System.out.println("************************"); +// OSM10Client.getVNFPackages(); +// System.out.println("************************"); +// System.out.println("Getting VNFDs"); +// System.out.println("************************"); +// Vnfd[] vnfds = OSM10Client.getVNFDs(); +// if(vnfds!=null) +// { +// for (Vnfd v : vnfds) { +// System.out.println("=== LIST VNFDs POJO object response: " + v.toString()); +// System.out.println("=== LIST VNFDs POJO object id: " + v.getId() + ", Name: " + v.getProductName()); +// Vnfd tmp_vnfd = OSM10Client.getVNFDbyID(v.getId()); +// System.out.println("=== LIST VNFDs POJO object id: " + tmp_vnfd.getId() + ", Name: " + tmp_vnfd.getProductName()); +// } +// } +// System.out.println("************************"); +// System.out.println("Getting NSDescriptors"); +// System.out.println("************************"); +// OSM10Client.getNSDescriptors(); +// System.out.println("************************"); +// System.out.println("Getting NSDs"); +// System.out.println("************************"); +// Nsd[] nsds = OSM10Client.getNSDs(); +// for (Nsd v : nsds) { +// System.out.println("=== LIST NSDs POJO object response: " + v.toString()); +// System.out.println("=== LIST NSDs POJO object id: " + v.getId() + ", Name: " + v.getName()); +// Nsd tmp_nsd = OSM10Client.getNSDbyID(v.getId()); +// System.out.println("=== LIST NSDs POJO object id: " + tmp_nsd.getId() + ", Name: " + tmp_nsd.getName()); +// } +// System.out.println("Working Directory = " +System.getProperty("user.dir")); +// +// //Create VNFD +// System.out.println("************************"); +// System.out.println("Creating VNF Instance"); +// System.out.println("************************"); +// ResponseEntity response = null; +// response = OSM10Client.createVNFDPackage(); +// if (response == null || response.getStatusCode().is4xxClientError() || response.getStatusCode().is5xxServerError()) { +// System.out.println("VNFD Package Creation failed."); +// return; +// } +// else +// { +// JSONObject obj = new JSONObject(response.getBody()); +// String vnfd_id = obj.getString("id"); +// System.out.println(response.getStatusCode()+" replied. The new VNFD Package id is :" + vnfd_id); +// System.out.println("Uploading VNF Package from URL"); +// System.out.println("************************"); +// String vnfd_package_path = "http://localhost/osm/hackfest_multivdu_vnf.tar.gz"; +// try { +// response = OSM10Client.uploadVNFDPackageContent(vnfd_id, vnfd_package_path); +// if (response == null || response.getStatusCode().is4xxClientError() +// || response.getStatusCode().is5xxServerError()) { +// System.out.println("Upload of VNFD Package Content failed. Deleting VNFD Package."+response.getBody()); +// // Delete the package from the OSM +// OSM10Client.deleteVNFDPackage(vnfd_id); +// return; +// } +// else +// { +// System.out.println("VNFD Package uploaded successfully"); +// } +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } + + +//// System.out.println("************************"); +//// System.out.println("Uploading VNF Zip from local file"); +//// System.out.println("************************"); +//// String vnfd_zip_path = "./src/main/resources/temp/cirros_vnf.tar.gz"; +//// try +//// { +//// OSM10Client.uploadVNFDZip(vnfd_id, vnfd_zip_path); +//// } +//// catch(IOException e) +//// { +//// System.out.println(e.getMessage()); +//// return; +//// } + +// System.out.println("Uploading NSD Package from URL"); +// System.out.println("************************"); +// String nsd_package_path = "http://localhost/osm/hackfest_multivdu_ns.tar.gz"; +// String nsd_id = null; +// response = OSM10Client.createNSDPackage(); +// if (response == null || response.getStatusCode().is4xxClientError() || response.getStatusCode().is5xxServerError()) { +// System.out.println("NSD Package Creation failed."); +// return; +// } +// else +// { +// JSONObject obj = new JSONObject(response.getBody()); +// nsd_id = obj.getString("id"); +// System.out.println(response.getStatusCode()+" replied. The new NSD Package id is :" + nsd_id); +// System.out.println("Uploading NS Package from URL"); +// System.out.println("************************"); +// try { +// response = OSM10Client.uploadNSDPackageContent(nsd_id, nsd_package_path); +// if (response == null || response.getStatusCode().is4xxClientError() +// || response.getStatusCode().is5xxServerError()) { +// System.out.println("Upload of NSD Package Content failed. Deleting NSD Package."); +// // Delete the package from the OSM +// OSM10Client.deleteVNFDPackage(nsd_id); +// return; +// } +// else +// { +// System.out.println("NSD Package uploaded successfully"); +// } +// } catch (IOException e) { +// // TODO Auto-generated catch block +// e.printStackTrace(); +// } +// } +// +// //Create NSD +// System.out.println("************************"); +// System.out.println("Uploading NSD Zip from local file"); +// System.out.println("************************"); +// System.out.println("************************"); +// System.out.println("Creating NSD Instance"); +// System.out.println("************************"); +// String nsd_id = OSM10Client.createNSDPackage(); +// // TODO Handle failure acquiring a vnfd_id +// System.out.println("************************"); +// System.out.println("Uploading NSD Zip"); +// System.out.println("************************"); +// String nsd_zip_path = "C:/EP/OSMDEVOPS/OSMvFIVE_NSDs/cirros_2vnf_ns_b.tar.gz"; +// OSM10Client.uploadNSDZip(nsd_id, nsd_zip_path); +// +// //Create NS Instance +// System.out.println("************************"); +// System.out.println("Creating NS Instance"); +// System.out.println("************************"); +// String vim_id="033797cd-cc1e-4727-b9a6-9f7024c92c6e"; +// String ns_instance_id = OSM10Client.createNSInstance("test",vim_id, nsd_id); +// if(ns_instance_id!=null) +// { +// OSM10Client.InstantiateNSInstance(ns_instance_id); +// } +// pressAnyKeyToContinue(); +// if(ns_instance_id!=null) +// { +// OSM10Client.deleteNSInstance(ns_instance_id); +// } + + } +// @Nullable Map constituentVnfds = OSM10Client.getNSDbyID(nsd_id).getConstituentVnfd(); +// NSCreateInstanceRequestPayload nscreateinstancerequestpayload = new NSCreateInstanceRequestPayload(); +// nscreateinstancerequestpayload.setNsName("test"); +// nscreateinstancerequestpayload.setVimAccountId("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// nscreateinstancerequestpayload.setWimAccountId(false); +// // Here we need to get the ExperimentOnBoardDescriptor based on the Experiment. +// // An Experiment might have multiple OnBoardDescriptors if it is OnBoarded to multiple OSM MANOs. +// // We temporarily select the first (and most probably the only one). +// // Otherwise the user needs to define the OSM MANO where the Experiment is OnBoarded in order to instantiate. +// nscreateinstancerequestpayload.setNsdId(nsd_id); +// Integer count = 0; +// for(ConstituentVnfd constituenVnfd : constituentVnfds.values()) +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.VnF vnf_tmp = nscreateinstancerequestpayload.new VnF(); +// count=count+1; +// vnf_tmp.setMemberVnFIndex(count.toString()); +// if(count!=2) +// vnf_tmp.setVimAccount("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// else +// { +// vnf_tmp.setVimAccount("8571aa95-4c17-4d87-a865-c98126dd0241"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vdu vdu_tmp = nscreateinstancerequestpayload.new Vdu(); +// vdu_tmp.setId("cirros_vnfd-VM"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.NInterface interface_tmp = nscreateinstancerequestpayload.new NInterface(); +// interface_tmp.setName("eth0"); +// interface_tmp.setFloating_ip_required(true); +// vdu_tmp.setInterfaceObj(new ArrayList()); +// vdu_tmp.getInterfaceObj().add(interface_tmp); +// vnf_tmp.setVdu(new ArrayList()); +// vnf_tmp.getVdu().add(vdu_tmp); +// } +// nscreateinstancerequestpayload.getVnf().add(vnf_tmp); +// } +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp = nscreateinstancerequestpayload.new Vld(); +// vld_tmp.setName("cirros_3vnf_nsd_vld1"); +// +//// IpProfileParamsBuilder ipprofileparamsbuilder = new IpProfileParamsBuilder(); +//// ipprofileparamsbuilder.setIpVersion(IpVersion.Ipv4); +//// ipprofileparamsbuilder.setSubnetAddress(new IpPrefix(new Ipv4Prefix("192.168.100.0/24"))); +//// ipprofileparamsbuilder.setGatewayAddress(new IpAddress(new Ipv4Address("0.0.0.0"))); +//// List dnsserverlist = new ArrayList(); +//// DnsServerBuilder dnsserverbuilder = new DnsServerBuilder(); +//// dnsserverbuilder.setAddress(new IpAddress(new Ipv4Address("8.8.8.8"))); +//// dnsserverlist.add(dnsserverbuilder.build()); +//// ipprofileparamsbuilder.setDnsServer(dnsserverlist); +//// IpProfileParams ipprofileparams_tmp = ipprofileparamsbuilder.build(); +//// vld_tmp.setIpProfile(ipprofileparams_tmp); +// +// //vld_tmp.setVimNetworkName("OSMFIVE_selfservice01"); +// LinkedHashMap tmp=new LinkedHashMap<>(); +// tmp.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSMFIVE_selfservice01"); +// tmp.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSMFIVE_selfservice01"); +// vld_tmp.setVimNetworkName(tmp); +// nscreateinstancerequestpayload.getVld().add(vld_tmp); +// +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp2 = nscreateinstancerequestpayload.new Vld(); +// vld_tmp2.setName("cirros_3vnf_nsd_vld2"); +// //vld_tmp2.setVimNetworkName("OSM_mgmt_net"); +// LinkedHashMap tmp2=new LinkedHashMap<>(); +// tmp2.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSM_mgmt_net"); +// tmp2.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSM_mgmt_net"); +// vld_tmp2.setVimNetworkName(tmp2); +// nscreateinstancerequestpayload.getVld().add(vld_tmp2); +// } +// //String tmptmp="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\"65a644b1-6079-44ba-a227-34577079928b\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"},{\"member-vnf-index\":\"3\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}],\"vld\":[{\"name\":\"cirros_3vnf_nsd_vld1\",\"vim-network-name\":\"OSMFIVE_selfservice01\"},{\"name\":\"cirros_3vnf_nsd_vld2\",\"vim-network-name\":\"OSM_mgmt_net\"}]}"; +// // Get Experiment ID and VIM ID and create NS Instance. +// System.out.println("NS Instance creation payload : " + nscreateinstancerequestpayload.toJSON()); +// ResponseEntity ns_instance_creation_entity = OSM10Client.createNSInstance(nscreateinstancerequestpayload.toJSON()); +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\""+nsd_id+"\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\", \"vdu\":[ {\"id\": \"mgmtVM\", \"interface\": [{\"name\": \"mgmtVM-eth0\", \"floating-ip-required\": true }]} ]},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}],\"vld\": [ {\"name\": \"mgmtnet\", \"vim-network-name\": \"OSMFIVE_selfservice01\"}]}"; +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\""+nsd_id+"\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}],\"vld\": [ {\"name\": \"mgmtnet\", \"vim-network-name\": \"OSMFIVE_selfservice01\"}]}"; +// //System.out.println("NS Instance creation payload : " + test_payload); +// //ResponseEntity ns_instance_creation_entity = OSM10Client.createNSInstance(test_payload); +// // The NS Instance ID is set +// +// // NS instance creation +// if (ns_instance_creation_entity == null || ns_instance_creation_entity.getStatusCode().is4xxClientError() +// || ns_instance_creation_entity.getStatusCode().is5xxServerError()) { +// // NS instance creation failed +// System.out.println("NS Instance creation failed with response: "+ ns_instance_creation_entity.getBody().toString()); +// } else { +// // String nsr_id = +// JSONObject ns_instance_creation_entity_json_obj = new JSONObject(ns_instance_creation_entity.getBody()); +// System.out.println("NS creation succeded with "+ns_instance_creation_entity.getBody()); +// String nsd_instance_id = ns_instance_creation_entity_json_obj.getString("id"); +// // Instantiate NS Instance +// NSInstantiateInstanceRequestPayload nsrequestpayload = new NSInstantiateInstanceRequestPayload(); +// nsrequestpayload.setNsName("test"); +// nsrequestpayload.setVimAccountId("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// nsrequestpayload.setWimAccountId(false); +// nsrequestpayload.setNsdId(nsd_id); +// count = 0; +// for(ConstituentVnfd constituenVnfd : constituentVnfds.values()) +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.VnF vnf_tmp = nsrequestpayload.new VnF(); +// count=count+1; +// vnf_tmp.setMemberVnFIndex(count.toString()); +// if(count!=2) +// vnf_tmp.setVimAccount("4efd8bf4-5292-4634-87b7-7b3d49108b36"); +// else +// { +// vnf_tmp.setVimAccount("8571aa95-4c17-4d87-a865-c98126dd0241"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vdu vdu_tmp = nscreateinstancerequestpayload.new Vdu(); +// vdu_tmp.setId("cirros_vnfd-VM"); +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.NInterface interface_tmp = nscreateinstancerequestpayload.new NInterface(); +// interface_tmp.setName("eth0"); +// interface_tmp.setFloating_ip_required(true); +// vdu_tmp.setInterfaceObj(new ArrayList()); +// vdu_tmp.getInterfaceObj().add(interface_tmp); +// vnf_tmp.setVdu(new ArrayList()); +// vnf_tmp.getVdu().add(vdu_tmp); +// } +// nsrequestpayload.getVnf().add(vnf_tmp); +// } +// { +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp = nsrequestpayload.new Vld(); +// vld_tmp.setName("cirros_3vnf_nsd_vld1"); +// +//// IpProfileParamsBuilder ipprofileparamsbuilder = new IpProfileParamsBuilder(); +//// ipprofileparamsbuilder.setIpVersion(IpVersion.Ipv4); +//// ipprofileparamsbuilder.setSubnetAddress(new IpPrefix(new Ipv4Prefix("192.168.100.0/24"))); +//// ipprofileparamsbuilder.setGatewayAddress(new IpAddress(new Ipv4Address("0.0.0.0"))); +//// List dnsserverlist = new ArrayList(); +//// DnsServerBuilder dnsserverbuilder = new DnsServerBuilder(); +//// dnsserverbuilder.setAddress(new IpAddress(new Ipv4Address("8.8.8.8"))); +//// dnsserverlist.add(dnsserverbuilder.build()); +//// ipprofileparamsbuilder.setDnsServer(dnsserverlist); +//// IpProfileParams ipprofileparams_tmp = ipprofileparamsbuilder.build(); +//// vld_tmp.setIpProfile(ipprofileparams_tmp); +// +// //vld_tmp.setVimNetworkName("OSMFIVE_selfservice01"); +// LinkedHashMap tmp=new LinkedHashMap<>(); +// tmp.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSMFIVE_selfservice01"); +// tmp.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSMFIVE_selfservice01"); +// vld_tmp.setVimNetworkName(tmp); +// nsrequestpayload.getVld().add(vld_tmp); +// +// OSM10NBIClient.NSInstantiateInstanceRequestPayload.Vld vld_tmp2 = nsrequestpayload.new Vld(); +// vld_tmp2.setName("cirros_3vnf_nsd_vld2"); +// //vld_tmp2.setVimNetworkName("OSM_mgmt_net"); +// LinkedHashMap tmp2=new LinkedHashMap<>(); +// tmp2.put("4efd8bf4-5292-4634-87b7-7b3d49108b36","OSM_mgmt_net"); +// tmp2.put("8571aa95-4c17-4d87-a865-c98126dd0241","OSM_mgmt_net"); +// vld_tmp2.setVimNetworkName(tmp2); +// nsrequestpayload.getVld().add(vld_tmp2); +// } +// System.out.println("NS Instantiation payload : " + nsrequestpayload.toJSON()); +// +// +// //String test_payload={"nsName":"test","vimAccountId":"4efd8bf4-5292-4634-87b7-7b3d49108b36","nsdId":"acc18b58-1b82-40e8-8c35-2bfcc8293cdf","vnf":[{"member-vnf-index":"1","vimAccountId":"4efd8bf4-5292-4634-87b7-7b3d49108b36", vdu:[ {id: mgmtVM, interface: [{name: "mgmtVM-eth0", floating-ip-required: true }]} ], vld: [ {name: mgmtnet, vim-network-name: "OSMFIVE_selfservice01"} ]},{"member-vnf-index":"2","vimAccountId":"4efd8bf4-5292-4634-87b7-7b3d49108b36"}]}; +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\"acc18b58-1b82-40e8-8c35-2bfcc8293cdf\",\"vnf\":[{\"member-vnf-index\":\"1\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\", vdu:[ {id: mgmtVM, interface: [{name: \"mgmtVM-eth0\", floating-ip-required: true }]} ], vld: [ {name: mgmtnet, vim-network-name: \"OSMFIVE_selfservice01\"} ]},{\"member-vnf-index\":\"2\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\"}]}"; +// //String test_payload="{\"nsName\":\"test\",\"vimAccountId\":\"4efd8bf4-5292-4634-87b7-7b3d49108b36\",\"nsdId\":\""+nsd_id+"\"}"; +// //ResponseEntity instantiate_ns_instance_entity = OSM10Client.instantiateNSInstance(nsd_instance_id, test_payload); +// // Here we need the feedback +// ResponseEntity instantiate_ns_instance_entity = OSM10Client.instantiateNSInstance(nsd_instance_id, nsrequestpayload.toJSON()); +// if (instantiate_ns_instance_entity == null || instantiate_ns_instance_entity.getStatusCode().is4xxClientError() || instantiate_ns_instance_entity.getStatusCode().is5xxServerError()) { +// System.out.println("NS Instantiation failed. Status Code:" +// + instantiate_ns_instance_entity.getStatusCode().toString() + ", Payload:" +// + ns_instance_creation_entity.getBody().toString()); +// } else { +// // NS Instantiation starts +// System.out.println("NS Instantiation of NS with id" + nsd_instance_id + " started."); +// // Save the changes to DeploymentDescriptor +// } +// } +// +// +// } +//// public OSM10Client() { +//// // Properties file path. +//// String filePath = "osm4.properties.xml"; +//// Properties prop = new Properties(); +//// try (InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(filePath)) { +//// +//// // Loading the properties. +//// prop.loadFromXML(inputStream); +//// +//// // Getting properties +//// this.manoApiEndpoint = prop.getProperty("osm4.apiEndPoint"); +//// this.manoUsername = prop.getProperty("osm4.username"); +//// this.manoPassword = prop.getProperty("osm4.password"); +//// this.manoProjectId = prop.getProperty("osm4.projectId"); +//// } catch (IOException ex) { +//// logger.error("Problem while reading properties file !"); +//// ex.printStackTrace(); +//// } +//// +//// OSM10ClientInit(); +//// } +// + +} diff --git a/src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java b/src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..3b231cc3f143c007140382a08f7bfc4b9268c795 --- /dev/null +++ b/src/main/java/OSM10NBIClient/ProjectCreateRequestPayload.java @@ -0,0 +1,65 @@ +package OSM10NBIClient; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +//{"name":"test4","quotas":{"vnfds":1,"nsds":0,"slice_templates":0,"pduds":0,"ns_instances":0,"slice_instances":0,"vim_accounts":0,"wim_accounts":0,"sdn_controllers":0,"k8sclusters":0,"k8srepos":0,"osmrepos":1}} +public class ProjectCreateRequestPayload { + + String name; + Boolean admin; + String domain_name; + List> quotas; + + public List> getQuotas() { + return quotas; + } + + public void setQuotas(List> quotas) { + this.quotas = quotas; + } + + public Boolean getAdmin() { + return admin; + } + + public void setAdmin(Boolean admin) { + this.admin = admin; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public String getDomain_name() { + return domain_name; + } + + public void setDomain_name(String domain_name) { + this.domain_name = domain_name; + } + + 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/OSM10NBIClient/ProjectEditRequestPayload.java b/src/main/java/OSM10NBIClient/ProjectEditRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..f87b4ea4698db3eba75ff36be03633902c6297da --- /dev/null +++ b/src/main/java/OSM10NBIClient/ProjectEditRequestPayload.java @@ -0,0 +1,54 @@ +package OSM10NBIClient; + +import java.util.List; +import java.util.Map; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class ProjectEditRequestPayload { + + String name; + Boolean admin; + List> quotas; + + public List> getQuotas() { + return quotas; + } + + public void setQuotas(List> quotas) { + this.quotas = quotas; + } + + public Boolean getAdmin() { + return admin; + } + + public void setAdmin(Boolean admin) { + this.admin = admin; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + 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/OSM10NBIClient/ProjectRoleMapping.java b/src/main/java/OSM10NBIClient/ProjectRoleMapping.java new file mode 100644 index 0000000000000000000000000000000000000000..a652e2f50b96cd819a9c794ea0e38d7f0d610ad3 --- /dev/null +++ b/src/main/java/OSM10NBIClient/ProjectRoleMapping.java @@ -0,0 +1,24 @@ +package OSM10NBIClient; + +public class ProjectRoleMapping { + private String project; + private String role; + + public ProjectRoleMapping(String project, String role) { + // TODO Auto-generated constructor stub + this.project=project; + this.role=role; + } + public String getProject() { + return project; + } + public void setProject(String project) { + this.project = project; + } + public String getRole() { + return role; + } + public void setRole(String role) { + this.role = role; + } +} diff --git a/src/main/java/OSM10NBIClient/UserCreateRequestPayload.java b/src/main/java/OSM10NBIClient/UserCreateRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..910a96b454dea29b54eb0368470ade0feaaf0e70 --- /dev/null +++ b/src/main/java/OSM10NBIClient/UserCreateRequestPayload.java @@ -0,0 +1,73 @@ +package OSM10NBIClient; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class UserCreateRequestPayload { + + private String username; + private String domain_name; + private String password; + private List projects; + + public List getProjects() { + return projects; + } + + public void setProjects(List projects) { + this.projects = projects; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public List getProject_role_mappings() { + return project_role_mappings; + } + + public void setProject_role_mappings(List project_role_mappings) { + this.project_role_mappings = project_role_mappings; + } + + private List project_role_mappings = new ArrayList(); + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + public String getDomain_name() { + return domain_name; + } + + public void setDomain_name(String domain_name) { + this.domain_name = domain_name; + } + + 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/OSM10NBIClient/UserEditRequestPayload.java b/src/main/java/OSM10NBIClient/UserEditRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..4f1d924cdad3942a8fbf5c401a607ccceaa61d90 --- /dev/null +++ b/src/main/java/OSM10NBIClient/UserEditRequestPayload.java @@ -0,0 +1,83 @@ +package OSM10NBIClient; + +import java.util.ArrayList; +import java.util.List; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +//{"username":"ioannis","password":"123","projects":["admin","test"],"project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"add_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}],"remove_project_role_mappings":[{"project":"admin","role":"system_admin"},{"project":"test","role":"system_admin"}]} +public class UserEditRequestPayload { + + private String username; + private String password; + private List projects; + private List project_role_mappings = null; + private List add_project_role_mappings = null; + private List remove_project_role_mappings = null; + + + public List getAdd_project_role_mappings() { + return add_project_role_mappings; + } + + public void setAdd_project_role_mappings(List add_project_role_mappings) { + this.add_project_role_mappings = add_project_role_mappings; + } + + public List getRemove_project_role_mappings() { + return remove_project_role_mappings; + } + + public void setRemove_project_role_mappings(List remove_project_role_mappings) { + this.remove_project_role_mappings = remove_project_role_mappings; + } + + public List getProjects() { + return projects; + } + + public void setProjects(List projects) { + this.projects = projects; + } + + public String getPassword() { + return password; + } + + public void setPassword(String password) { + this.password = password; + } + + public List getProject_role_mappings() { + return project_role_mappings; + } + + public void setProject_role_mappings(List project_role_mappings) { + this.project_role_mappings = project_role_mappings; + } + + public String getUsername() { + return username; + } + + public void setUsername(String username) { + this.username = username; + } + + 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/OSM10NBIClient/VIMCreateRequestPayload.java b/src/main/java/OSM10NBIClient/VIMCreateRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..c53855f37da240642cc26d53764e31745907da73 --- /dev/null +++ b/src/main/java/OSM10NBIClient/VIMCreateRequestPayload.java @@ -0,0 +1,109 @@ +package OSM10NBIClient; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class VIMCreateRequestPayload { + private String schema_version; + private String schema_type; + private String name; + private String description; + private String vim; + private String datacenter; + private String vim_type; + private String vim_url; + private String vim_tenant_name; + private String vim_user; + private String vim_password; + private String config; + + public String getSchema_version() { + return schema_version; + } + public void setSchema_version(String schema_version) { + this.schema_version = schema_version; + } + public String getSchema_type() { + return schema_type; + } + public void setSchema_type(String schema_type) { + this.schema_type = schema_type; + } + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public String getVim() { + return vim; + } + public void setVim(String vim) { + this.vim = vim; + } + public String getDatacenter() { + return datacenter; + } + public void setDatacenter(String datacenter) { + this.datacenter = datacenter; + } + public String getVim_type() { + return vim_type; + } + public void setVim_type(String vim_type) { + this.vim_type = vim_type; + } + public String getVim_url() { + return vim_url; + } + public void setVim_url(String vim_url) { + this.vim_url = vim_url; + } + public String getVim_tenant_name() { + return vim_tenant_name; + } + public void setVim_tenant_name(String vim_tenant_name) { + this.vim_tenant_name = vim_tenant_name; + } + public String getVim_user() { + return vim_user; + } + public void setVim_user(String vim_user) { + this.vim_user = vim_user; + } + public String getVim_password() { + return vim_password; + } + public void setVim_password(String vim_password) { + this.vim_password = vim_password; + } + public String getConfig() { + return config; + } + public void setConfig(String config) { + this.config = config; + } + + 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/OSM10NBIClient/VIMEditRequestPayload.java b/src/main/java/OSM10NBIClient/VIMEditRequestPayload.java new file mode 100644 index 0000000000000000000000000000000000000000..0c9d6d935664369116110117c64ca1f253189f07 --- /dev/null +++ b/src/main/java/OSM10NBIClient/VIMEditRequestPayload.java @@ -0,0 +1,94 @@ +package OSM10NBIClient; + +import com.fasterxml.jackson.annotation.JsonInclude.Include; +import com.fasterxml.jackson.core.JsonProcessingException; +import com.fasterxml.jackson.databind.ObjectMapper; + +public class VIMEditRequestPayload { + private String name; + private String description; + private String vim; + private String datacenter; + private String vim_type; + private String vim_url; + private String vim_tenant_name; + private String vim_user; + private String vim_password; + private String config; + + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public String getDescription() { + return description; + } + public void setDescription(String description) { + this.description = description; + } + public String getVim() { + return vim; + } + public void setVim(String vim) { + this.vim = vim; + } + public String getDatacenter() { + return datacenter; + } + public void setDatacenter(String datacenter) { + this.datacenter = datacenter; + } + public String getVim_type() { + return vim_type; + } + public void setVim_type(String vim_type) { + this.vim_type = vim_type; + } + public String getVim_url() { + return vim_url; + } + public void setVim_url(String vim_url) { + this.vim_url = vim_url; + } + public String getVim_tenant_name() { + return vim_tenant_name; + } + public void setVim_tenant_name(String vim_tenant_name) { + this.vim_tenant_name = vim_tenant_name; + } + public String getVim_user() { + return vim_user; + } + public void setVim_user(String vim_user) { + this.vim_user = vim_user; + } + public String getVim_password() { + return vim_password; + } + public void setVim_password(String vim_password) { + this.vim_password = vim_password; + } + public String getConfig() { + return config; + } + public void setConfig(String config) { + this.config = config; + } + + 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/OSM10NBIClient/testjsonparse.java b/src/main/java/OSM10NBIClient/testjsonparse.java new file mode 100644 index 0000000000000000000000000000000000000000..9aa307337c6cd2669b42b7096fd8e070552d325e --- /dev/null +++ b/src/main/java/OSM10NBIClient/testjsonparse.java @@ -0,0 +1,3977 @@ +package OSM10NBIClient; +//package OSM10NBIClient; +// +//import org.json.JSONArray; +//import org.json.JSONException; +//import org.json.JSONObject; +// +//public class testjsonparse { +// +// public static void main(String args[]) { +// +// String previous = "[\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927630.8796887,\r\n" +// + " \"modified\": 1613927845.185602,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"nsdId\": \"f9e6028b-c244-4125-9143-4f218da44ea9\",\r\n" +// + " \"nsName\": \"test\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\",\r\n" +// + " \"vnf\": [\r\n" +// + " {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\"\r\n" +// + " }\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927630.8796134,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/2efab51b-1357-4c32-a1d8-597b2875fddc\"\r\n" +// + " },\r\n" +// + " \"_id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927845.1855993\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927932.8781176,\r\n" +// + " \"modified\": 1613927964.094152,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927933.033377\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927932.8780527,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\"\r\n" +// + " },\r\n" +// + " \"_id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927964.0941498\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927992.9959521,\r\n" +// + " \"modified\": 1613928045.7064617,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927993.138056\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927992.9959092,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d6c18899-4857-4dd8-81b8-f44078660f16\"\r\n" +// + " },\r\n" +// + " \"_id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613928045.7064598\r\n" +// + " }\r\n" +// + "]"; +// String current = "[\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927630.8796887,\r\n" +// + " \"modified\": 1613927845.185602,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"nsdId\": \"f9e6028b-c244-4125-9143-4f218da44ea9\",\r\n" +// + " \"nsName\": \"test\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\",\r\n" +// + " \"vnf\": [\r\n" +// + " {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\"\r\n" +// + " }\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927630.8796134,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/2efab51b-1357-4c32-a1d8-597b2875fddc\"\r\n" +// + " },\r\n" +// + " \"_id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"id\": \"2efab51b-1357-4c32-a1d8-597b2875fddc\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927845.1855993\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927932.8781176,\r\n" +// + " \"modified\": 1613927964.094152,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927933.033377\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927932.8780527,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\"\r\n" +// + " },\r\n" +// + " \"_id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"id\": \"78ad3102-eb9e-41f9-bcc0-ef8c6c3d7c56\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613927964.0941498\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613927992.9959521,\r\n" +// + " \"modified\": 1613928045.7064617,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613927993.138056\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613927992.9959092,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d6c18899-4857-4dd8-81b8-f44078660f16\"\r\n" +// + " },\r\n" +// + " \"_id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"id\": \"d6c18899-4857-4dd8-81b8-f44078660f16\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613928045.7064598\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"24b235ed-01d3-46ba-83c6-fb0c1513b9bd\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613928052.969308,\r\n" +// + " \"modified\": 1613928095.3507125,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613928053.115541\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613928052.9692612,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/86daf254-e83f-4364-b1ce-dfb348af11ab\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/38b13afd-a8fc-41fa-8dd3-fbc807348881\"\r\n" +// + " },\r\n" +// + " \"_id\": \"38b13afd-a8fc-41fa-8dd3-fbc807348881\",\r\n" +// + " \"id\": \"38b13afd-a8fc-41fa-8dd3-fbc807348881\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613928095.3507106\r\n" +// + " }\r\n" +// + "]"; +// String response_body = "[\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613908559.4522517,\r\n" +// + " \"modified\": 1613908786.152224,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"lcmOperationType\": \"instantiate\",\r\n" +// + " \"nsdId\": \"f9e6028b-c244-4125-9143-4f218da44ea9\",\r\n" +// + " \"nsName\": \"test1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\",\r\n" +// + " \"vnf\": [\r\n" +// + " {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"vimAccountId\": \"e06d0d06-bef6-4678-ac17-77d848d422ba\"\r\n" +// + " }\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"startTime\": 1613908559.4522042,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/62fca486-e858-4f5b-98c5-3dba20f8d553\"\r\n" +// + " },\r\n" +// + " \"_id\": \"62fca486-e858-4f5b-98c5-3dba20f8d553\",\r\n" +// + " \"id\": \"62fca486-e858-4f5b-98c5-3dba20f8d553\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613908786.152222\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909256.2432952,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909225.026151\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:07:04.882729Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9d99076b-570c-4e00-b022-ceaa1e65dc26\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909224.8827221,\r\n" +// + " \"_id\": \"9d99076b-570c-4e00-b022-ceaa1e65dc26\",\r\n" +// + " \"id\": \"9d99076b-570c-4e00-b022-ceaa1e65dc26\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909256.243293\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909296.6228228,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909265.189120\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:07:35.041867Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/6a8a245a-5c4b-488e-a84f-5801f10b2a55\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909255.04186,\r\n" +// + " \"_id\": \"6a8a245a-5c4b-488e-a84f-5801f10b2a55\",\r\n" +// + " \"id\": \"6a8a245a-5c4b-488e-a84f-5801f10b2a55\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909296.6228206\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909331.819041,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909305.441519\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:08:05.283424Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/96865d6e-1261-4cbe-9533-4b5495a5054d\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909285.283418,\r\n" +// + " \"_id\": \"96865d6e-1261-4cbe-9533-4b5495a5054d\",\r\n" +// + " \"id\": \"96865d6e-1261-4cbe-9533-4b5495a5054d\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909331.8190389\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909335.6219559,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:08:35.521255Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1ecf8599-2d7f-4e5e-bd33-b79cbb5bad2e\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909315.5212488,\r\n" +// + " \"_id\": \"1ecf8599-2d7f-4e5e-bd33-b79cbb5bad2e\",\r\n" +// + " \"id\": \"1ecf8599-2d7f-4e5e-bd33-b79cbb5bad2e\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909335.621953\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909375.9247396,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:09:35.822264Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/ec20f68d-e7c0-4bd6-9625-3986aecb4a56\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909375.8222575,\r\n" +// + " \"_id\": \"ec20f68d-e7c0-4bd6-9625-3986aecb4a56\",\r\n" +// + " \"id\": \"ec20f68d-e7c0-4bd6-9625-3986aecb4a56\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909375.924737\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909406.1463256,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:10:06.064572Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/fd745050-bc9c-4b82-98db-97c73ebd96f2\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909406.064563,\r\n" +// + " \"_id\": \"fd745050-bc9c-4b82-98db-97c73ebd96f2\",\r\n" +// + " \"id\": \"fd745050-bc9c-4b82-98db-97c73ebd96f2\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909406.1463227\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909462.8980637,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613909436.376222\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:10:36.234204Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/6f4fffa9-46af-4df5-9503-0cd741959cb4\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909436.2341976,\r\n" +// + " \"_id\": \"6f4fffa9-46af-4df5-9503-0cd741959cb4\",\r\n" +// + " \"id\": \"6f4fffa9-46af-4df5-9503-0cd741959cb4\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909462.8980615\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909436.677574,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:10:36.435677Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/89ce4737-83cd-4014-9e5f-e4c69ac7dc8f\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909436.4356704,\r\n" +// + " \"_id\": \"89ce4737-83cd-4014-9e5f-e4c69ac7dc8f\",\r\n" +// + " \"id\": \"89ce4737-83cd-4014-9e5f-e4c69ac7dc8f\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909436.6775715\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909466.8011858,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:11:06.680565Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/466f1317-608f-45b3-8d1f-ef972e9df18d\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909466.680558,\r\n" +// + " \"_id\": \"466f1317-608f-45b3-8d1f-ef972e9df18d\",\r\n" +// + " \"id\": \"466f1317-608f-45b3-8d1f-ef972e9df18d\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909466.801183\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909527.1077504,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:12:07.009793Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d3aa410e-ca75-404e-8947-c3e8a560fd2f\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909527.0097864,\r\n" +// + " \"_id\": \"d3aa410e-ca75-404e-8947-c3e8a560fd2f\",\r\n" +// + " \"id\": \"d3aa410e-ca75-404e-8947-c3e8a560fd2f\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909527.1077466\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909557.2773156,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:12:37.175890Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/17b3eaa8-50af-4a7f-81cf-86a333b74bf3\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909557.1758833,\r\n" +// + " \"_id\": \"17b3eaa8-50af-4a7f-81cf-86a333b74bf3\",\r\n" +// + " \"id\": \"17b3eaa8-50af-4a7f-81cf-86a333b74bf3\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909557.2773128\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909587.4373255,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:13:07.346313Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9e51c559-1d3c-4102-ae30-239423178612\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909587.346306,\r\n" +// + " \"_id\": \"9e51c559-1d3c-4102-ae30-239423178612\",\r\n" +// + " \"id\": \"9e51c559-1d3c-4102-ae30-239423178612\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909587.4373229\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909617.6450963,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:13:37.551139Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8ab152ba-006a-42fa-bb7a-89613997c5c4\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909617.5511324,\r\n" +// + " \"_id\": \"8ab152ba-006a-42fa-bb7a-89613997c5c4\",\r\n" +// + " \"id\": \"8ab152ba-006a-42fa-bb7a-89613997c5c4\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909617.6450934\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909678.0753574,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:14:37.983770Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/621e38f9-fbcf-49f2-8c85-62cf39b8bc1d\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909677.9837644,\r\n" +// + " \"_id\": \"621e38f9-fbcf-49f2-8c85-62cf39b8bc1d\",\r\n" +// + " \"id\": \"621e38f9-fbcf-49f2-8c85-62cf39b8bc1d\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909678.0753548\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909708.3707678,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:15:08.256051Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/3e17aeda-c027-4750-9bea-6a887521d51e\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909708.25604,\r\n" +// + " \"_id\": \"3e17aeda-c027-4750-9bea-6a887521d51e\",\r\n" +// + " \"id\": \"3e17aeda-c027-4750-9bea-6a887521d51e\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909708.3707652\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909738.3489835,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:15:38.253779Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/87aa1856-545f-43fb-bd08-1d8fc4dbd5f0\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909738.2537727,\r\n" +// + " \"_id\": \"87aa1856-545f-43fb-bd08-1d8fc4dbd5f0\",\r\n" +// + " \"id\": \"87aa1856-545f-43fb-bd08-1d8fc4dbd5f0\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909738.348981\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909768.4961011,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:16:08.413956Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8fb31d19-265f-4f7c-b2c7-3890c0e53e61\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909768.4139502,\r\n" +// + " \"_id\": \"8fb31d19-265f-4f7c-b2c7-3890c0e53e61\",\r\n" +// + " \"id\": \"8fb31d19-265f-4f7c-b2c7-3890c0e53e61\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909768.4960983\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909768.6613002,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:16:08.573133Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/b16abf83-7f15-4249-9f44-2884a0abc244\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909768.5731268,\r\n" +// + " \"_id\": \"b16abf83-7f15-4249-9f44-2884a0abc244\",\r\n" +// + " \"id\": \"b16abf83-7f15-4249-9f44-2884a0abc244\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909768.6612976\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909869.189726,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:17:49.096628Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1cd9e694-4c2f-4cde-8a8c-67a9d7927cac\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909869.0966208,\r\n" +// + " \"_id\": \"1cd9e694-4c2f-4cde-8a8c-67a9d7927cac\",\r\n" +// + " \"id\": \"1cd9e694-4c2f-4cde-8a8c-67a9d7927cac\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909869.1897235\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613909929.58234,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:18:49.488232Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/c92013c4-a65d-4d7f-b0a2-7d43281091ae\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613909929.4882257,\r\n" +// + " \"_id\": \"c92013c4-a65d-4d7f-b0a2-7d43281091ae\",\r\n" +// + " \"id\": \"c92013c4-a65d-4d7f-b0a2-7d43281091ae\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613909929.5823371\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910034.2460053,\r\n" +// + " \"modified\": 1613910034.3472185,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910034.2459593,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/189ac178-682b-4b85-8a2e-9a88a6c68638\"\r\n" +// + " },\r\n" +// + " \"_id\": \"189ac178-682b-4b85-8a2e-9a88a6c68638\",\r\n" +// + " \"id\": \"189ac178-682b-4b85-8a2e-9a88a6c68638\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910034.347216\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910094.2656207,\r\n" +// + " \"modified\": 1613910109.8943396,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910094.392173\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910094.265575,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/d732ffcd-138e-4d45-a3a5-835ab5157c7b\"\r\n" +// + " },\r\n" +// + " \"_id\": \"d732ffcd-138e-4d45-a3a5-835ab5157c7b\",\r\n" +// + " \"id\": \"d732ffcd-138e-4d45-a3a5-835ab5157c7b\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910109.894338\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910154.8435988,\r\n" +// + " \"modified\": 1613910186.6822402,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910155.037702\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910154.8435192,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/5c46ada3-4da4-4fbc-a09b-aa61d048f52d\"\r\n" +// + " },\r\n" +// + " \"_id\": \"5c46ada3-4da4-4fbc-a09b-aa61d048f52d\",\r\n" +// + " \"id\": \"5c46ada3-4da4-4fbc-a09b-aa61d048f52d\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910186.6822376\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910214.6640532,\r\n" +// + " \"modified\": 1613910214.7608726,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910214.6640062,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/84215289-3b25-49bd-a49d-ec14dd7ba285\"\r\n" +// + " },\r\n" +// + " \"_id\": \"84215289-3b25-49bd-a49d-ec14dd7ba285\",\r\n" +// + " \"id\": \"84215289-3b25-49bd-a49d-ec14dd7ba285\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910214.7608697\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910274.9706578,\r\n" +// + " \"modified\": 1613910290.6332529,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910275.148673\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910274.970613,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/29bd71cf-1db3-4526-b94d-a725dc88d6e9\"\r\n" +// + " },\r\n" +// + " \"_id\": \"29bd71cf-1db3-4526-b94d-a725dc88d6e9\",\r\n" +// + " \"id\": \"29bd71cf-1db3-4526-b94d-a725dc88d6e9\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910290.6332498\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910364.581714,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910322.314141\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:24:52.077444Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/7d0260bb-9c28-4d0a-9c94-92689b29c48a\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910292.077437,\r\n" +// + " \"_id\": \"7d0260bb-9c28-4d0a-9c94-92689b29c48a\",\r\n" +// + " \"id\": \"7d0260bb-9c28-4d0a-9c94-92689b29c48a\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910364.5817118\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910334.381761,\r\n" +// + " \"modified\": 1613910350.0165374,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910334.526976\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910334.3817139,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/bfbdc4a0-a3cc-4fec-abc0-29cbdccc2e32\"\r\n" +// + " },\r\n" +// + " \"_id\": \"bfbdc4a0-a3cc-4fec-abc0-29cbdccc2e32\",\r\n" +// + " \"id\": \"bfbdc4a0-a3cc-4fec-abc0-29cbdccc2e32\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910350.0165346\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910429.7995875,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910382.571596\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:25:52.390508Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/50b54f54-f834-4685-9870-d8dce8f5416e\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910352.3905017,\r\n" +// + " \"_id\": \"50b54f54-f834-4685-9870-d8dce8f5416e\",\r\n" +// + " \"id\": \"50b54f54-f834-4685-9870-d8dce8f5416e\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910429.7995856\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910394.5855768,\r\n" +// + " \"modified\": 1613910431.4787664,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910394.721723\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910394.5855281,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/0bbb84f2-05e8-48f2-9504-e29113f140a8\"\r\n" +// + " },\r\n" +// + " \"_id\": \"0bbb84f2-05e8-48f2-9504-e29113f140a8\",\r\n" +// + " \"id\": \"0bbb84f2-05e8-48f2-9504-e29113f140a8\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910431.4787643\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910443.2732882,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:26:53.165084Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a9cb6f0f-46d2-4848-a224-a79bfbb73ce0\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910413.165078,\r\n" +// + " \"_id\": \"a9cb6f0f-46d2-4848-a224-a79bfbb73ce0\",\r\n" +// + " \"id\": \"a9cb6f0f-46d2-4848-a224-a79bfbb73ce0\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910443.2732852\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910454.705805,\r\n" +// + " \"modified\": 1613910465.215382,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910454.844086\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910454.7057567,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/234a616c-87f6-45e1-a193-3e953e1f80fb\"\r\n" +// + " },\r\n" +// + " \"_id\": \"234a616c-87f6-45e1-a193-3e953e1f80fb\",\r\n" +// + " \"id\": \"234a616c-87f6-45e1-a193-3e953e1f80fb\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910465.21538\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910473.6185863,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:27:53.523440Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a3756a3c-7c77-4f6f-b145-89e8d1be8a30\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910473.5234346,\r\n" +// + " \"_id\": \"a3756a3c-7c77-4f6f-b145-89e8d1be8a30\",\r\n" +// + " \"id\": \"a3756a3c-7c77-4f6f-b145-89e8d1be8a30\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910473.618584\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910515.3454695,\r\n" +// + " \"modified\": 1613910541.7016327,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910515.565245\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910515.3453994,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9ce258c7-8424-4ab9-bda7-bf21920a5fac\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9ce258c7-8424-4ab9-bda7-bf21920a5fac\",\r\n" +// + " \"id\": \"9ce258c7-8424-4ab9-bda7-bf21920a5fac\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910541.701631\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910570.9613228,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910534.252119\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:28:54.093851Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/bcc40603-7a36-46c0-bd1b-edc9c5bdd066\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910534.0938444,\r\n" +// + " \"_id\": \"bcc40603-7a36-46c0-bd1b-edc9c5bdd066\",\r\n" +// + " \"id\": \"bcc40603-7a36-46c0-bd1b-edc9c5bdd066\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910570.9613204\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910575.2397785,\r\n" +// + " \"modified\": 1613910590.870802,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910575.392916\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910575.2397187,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/73cfbe6b-c3a1-4b0e-aab3-3c80a365773b\"\r\n" +// + " },\r\n" +// + " \"_id\": \"73cfbe6b-c3a1-4b0e-aab3-3c80a365773b\",\r\n" +// + " \"id\": \"73cfbe6b-c3a1-4b0e-aab3-3c80a365773b\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910590.8707998\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"nsInstanceId\": \"957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"3964a87d-e098-45c5-ae3b-5f5dced8893d\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"modified\": 1613910626.0078642,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910594.628977\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"scaleTime\": \"2021-02-21T12:29:54.468485Z\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/957f161d-b2b8-4ec7-a2f2-48195fe6ae8a\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/db048e5a-bd83-48c7-8218-a37b29466080\"\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910594.4684794,\r\n" +// + " \"_id\": \"db048e5a-bd83-48c7-8218-a37b29466080\",\r\n" +// + " \"id\": \"db048e5a-bd83-48c7-8218-a37b29466080\",\r\n" +// + " \"isAutomaticInvocation\": true,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910626.0078623\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910635.138362,\r\n" +// + " \"modified\": 1613910677.2629888,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910635.279426\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910635.138297,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8bb32fd9-68bd-48fb-8f64-1bc5816fb911\"\r\n" +// + " },\r\n" +// + " \"_id\": \"8bb32fd9-68bd-48fb-8f64-1bc5816fb911\",\r\n" +// + " \"id\": \"8bb32fd9-68bd-48fb-8f64-1bc5816fb911\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910677.2629857\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910694.940018,\r\n" +// + " \"modified\": 1613910710.5964007,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910695.072941\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910694.9399714,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1533bb7f-9260-4fc3-aab5-5dbcb64aca23\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1533bb7f-9260-4fc3-aab5-5dbcb64aca23\",\r\n" +// + " \"id\": \"1533bb7f-9260-4fc3-aab5-5dbcb64aca23\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910710.5963984\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910755.0686476,\r\n" +// + " \"modified\": 1613910797.2895927,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910755.216604\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910755.0685987,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1527f671-f917-4421-bd34-918b3ad09fea\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1527f671-f917-4421-bd34-918b3ad09fea\",\r\n" +// + " \"id\": \"1527f671-f917-4421-bd34-918b3ad09fea\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910797.2895906\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910815.0303142,\r\n" +// + " \"modified\": 1613910846.841692,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910815.214299\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910815.0302649,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a06b303b-f7f7-40ca-b5ff-fec58bb5fa75\"\r\n" +// + " },\r\n" +// + " \"_id\": \"a06b303b-f7f7-40ca-b5ff-fec58bb5fa75\",\r\n" +// + " \"id\": \"a06b303b-f7f7-40ca-b5ff-fec58bb5fa75\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910846.84169\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910874.8476086,\r\n" +// + " \"modified\": 1613910890.4736896,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910874.985552\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910874.847478,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9bbc24ff-feac-4006-af36-dcb4afabdf09\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9bbc24ff-feac-4006-af36-dcb4afabdf09\",\r\n" +// + " \"id\": \"9bbc24ff-feac-4006-af36-dcb4afabdf09\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910890.473688\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910935.1008294,\r\n" +// + " \"modified\": 1613910945.6500735,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910935.269509\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910935.100782,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/b899e50b-bd61-425b-8922-5e9ccdfd9178\"\r\n" +// + " },\r\n" +// + " \"_id\": \"b899e50b-bd61-425b-8922-5e9ccdfd9178\",\r\n" +// + " \"id\": \"b899e50b-bd61-425b-8922-5e9ccdfd9178\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613910945.6500702\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613910996.4660888,\r\n" +// + " \"modified\": 1613911033.2293398,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613910996.656248\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613910996.466044,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/f53b8dc3-fdf4-4c20-902a-7cc2c23b3b99\"\r\n" +// + " },\r\n" +// + " \"_id\": \"f53b8dc3-fdf4-4c20-902a-7cc2c23b3b99\",\r\n" +// + " \"id\": \"f53b8dc3-fdf4-4c20-902a-7cc2c23b3b99\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911033.229338\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911050.5486434,\r\n" +// + " \"modified\": 1613911066.225315,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911050.688298\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911050.548594,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/69e4b810-1fe9-438d-a31b-6cf9b31d45f7\"\r\n" +// + " },\r\n" +// + " \"_id\": \"69e4b810-1fe9-438d-a31b-6cf9b31d45f7\",\r\n" +// + " \"id\": \"69e4b810-1fe9-438d-a31b-6cf9b31d45f7\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911066.225313\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911110.5881708,\r\n" +// + " \"modified\": 1613911121.0799134,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911110.750472\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911110.5881114,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/28d548bb-daaf-4c13-93fc-094907981564\"\r\n" +// + " },\r\n" +// + " \"_id\": \"28d548bb-daaf-4c13-93fc-094907981564\",\r\n" +// + " \"id\": \"28d548bb-daaf-4c13-93fc-094907981564\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911121.0799115\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911171.1116796,\r\n" +// + " \"modified\": 1613911171.1979456,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911171.1116383,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/3eae096d-2f05-4fdd-ab3e-a347183591e2\"\r\n" +// + " },\r\n" +// + " \"_id\": \"3eae096d-2f05-4fdd-ab3e-a347183591e2\",\r\n" +// + " \"id\": \"3eae096d-2f05-4fdd-ab3e-a347183591e2\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911171.1979434\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911230.813983,\r\n" +// + " \"modified\": 1613911230.8896387,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911230.8139443,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9ac0c28e-76ae-47aa-9bca-d103bc5e84c6\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9ac0c28e-76ae-47aa-9bca-d103bc5e84c6\",\r\n" +// + " \"id\": \"9ac0c28e-76ae-47aa-9bca-d103bc5e84c6\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911230.8896365\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 0 (min-instance-count) scaling-in operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911383.1045403,\r\n" +// + " \"modified\": 1613911383.2016208,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911383.1044917,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1f0f5e6b-7718-4d3d-a280-652d9eb3d13f\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1f0f5e6b-7718-4d3d-a280-652d9eb3d13f\",\r\n" +// + " \"id\": \"1f0f5e6b-7718-4d3d-a280-652d9eb3d13f\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911383.2016182\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911439.4396203,\r\n" +// + " \"modified\": 1613911465.6242385,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911439.585795\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911439.4395723,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a81e4764-481f-4518-91d3-ae3ce8cb305d\"\r\n" +// + " },\r\n" +// + " \"_id\": \"a81e4764-481f-4518-91d3-ae3ce8cb305d\",\r\n" +// + " \"id\": \"a81e4764-481f-4518-91d3-ae3ce8cb305d\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911465.6242363\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911499.3622625,\r\n" +// + " \"modified\": 1613911514.9143875,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911499.498071\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911499.3622153,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/5890fedb-800b-4e67-93d6-db15ff706895\"\r\n" +// + " },\r\n" +// + " \"_id\": \"5890fedb-800b-4e67-93d6-db15ff706895\",\r\n" +// + " \"id\": \"5890fedb-800b-4e67-93d6-db15ff706895\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911514.9143853\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911559.2898803,\r\n" +// + " \"modified\": 1613911595.531617,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911559.436866\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911559.2898374,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/8bfe4851-c453-4ffb-8806-1b39e86fde8e\"\r\n" +// + " },\r\n" +// + " \"_id\": \"8bfe4851-c453-4ffb-8806-1b39e86fde8e\",\r\n" +// + " \"id\": \"8bfe4851-c453-4ffb-8806-1b39e86fde8e\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911595.5316153\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911620.0033092,\r\n" +// + " \"modified\": 1613911635.637214,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911620.148513\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911620.0032625,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/1c692144-803a-4815-b47a-b000ef7a914a\"\r\n" +// + " },\r\n" +// + " \"_id\": \"1c692144-803a-4815-b47a-b000ef7a914a\",\r\n" +// + " \"id\": \"1c692144-803a-4815-b47a-b000ef7a914a\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911635.6372118\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911679.276305,\r\n" +// + " \"modified\": 1613911716.0668747,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911679.438384\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911679.2762609,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/facf2b4a-0a8c-4bff-acfd-9b054fcbf57f\"\r\n" +// + " },\r\n" +// + " \"_id\": \"facf2b4a-0a8c-4bff-acfd-9b054fcbf57f\",\r\n" +// + " \"id\": \"facf2b4a-0a8c-4bff-acfd-9b054fcbf57f\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911716.0668714\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911739.6183205,\r\n" +// + " \"modified\": 1613911750.1136234,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911739.747430\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911739.6182737,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/63ad2615-f034-4386-9c79-3590ae44bbdf\"\r\n" +// + " },\r\n" +// + " \"_id\": \"63ad2615-f034-4386-9c79-3590ae44bbdf\",\r\n" +// + " \"id\": \"63ad2615-f034-4386-9c79-3590ae44bbdf\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911750.1136212\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911799.2334297,\r\n" +// + " \"modified\": 1613911841.2871606,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911799.363900\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911799.2333803,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/98a025c6-f9c1-4f2f-881a-97091aead12d\"\r\n" +// + " },\r\n" +// + " \"_id\": \"98a025c6-f9c1-4f2f-881a-97091aead12d\",\r\n" +// + " \"id\": \"98a025c6-f9c1-4f2f-881a-97091aead12d\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911841.2871587\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"type\": \"delete\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911859.3068163,\r\n" +// + " \"modified\": 1613911874.888463,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911859.466150\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_IN\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911859.3067691,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/00fa47c7-a987-4705-b500-c84e05eb3131\"\r\n" +// + " },\r\n" +// + " \"_id\": \"00fa47c7-a987-4705-b500-c84e05eb3131\",\r\n" +// + " \"id\": \"00fa47c7-a987-4705-b500-c84e05eb3131\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911874.8884618\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911919.2559352,\r\n" +// + " \"modified\": 1613911961.0181375,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911919.429585\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911919.255896,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/9acdaa1c-d7f0-4173-ab0a-52499e3e26c6\"\r\n" +// + " },\r\n" +// + " \"_id\": \"9acdaa1c-d7f0-4173-ab0a-52499e3e26c6\",\r\n" +// + " \"id\": \"9acdaa1c-d7f0-4173-ab0a-52499e3e26c6\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613911961.0181353\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613911979.2063522,\r\n" +// + " \"modified\": 1613912010.748398,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613911979.363413\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613911979.2062573,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/b2f86ede-4545-4263-9b87-a226750886e4\"\r\n" +// + " },\r\n" +// + " \"_id\": \"b2f86ede-4545-4263-9b87-a226750886e4\",\r\n" +// + " \"id\": \"b2f86ede-4545-4263-9b87-a226750886e4\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613912010.748396\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"errorMessage\": null,\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"operations\": [\r\n" +// + " {\r\n" +// + " \"vdu_id\": null,\r\n" +// + " \"primitive\": null,\r\n" +// + " \"vdu_count_index\": null,\r\n" +// + " \"detailed-status\": \"Done\",\r\n" +// + " \"lcmOperationType\": \"SCALE-RO\",\r\n" +// + " \"operationState\": \"COMPLETED\",\r\n" +// + " \"RO_nsr_id\": \"1ced6a58-39fd-449c-a308-019b5aababa6\",\r\n" +// + " \"RO_scaling_info\": [\r\n" +// + " {\r\n" +// + " \"osm_vdu_id\": \"apache_vdu\",\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"count\": 1,\r\n" +// + " \"cloud_init\": [\r\n" +// + " \"#cloud-config\\nhostname: ubuntu\\npassword: hi\\nchpasswd: { expire: False }\\nssh_pwauth: True\"\r\n" +// + " ],\r\n" +// + " \"type\": \"create\"\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"member_vnf_index\": \"1\",\r\n" +// + " \"primitive_params\": null\r\n" +// + " }\r\n" +// + " ],\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613912039.3231254,\r\n" +// + " \"modified\": 1613912076.0972588,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"deploy\": {\r\n" +// + " \"RO\": \"ACTION-1613912039.461176\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613912039.3230777,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/bb155452-4044-4750-a0ec-b1ff15ecf6ad\"\r\n" +// + " },\r\n" +// + " \"_id\": \"bb155452-4044-4750-a0ec-b1ff15ecf6ad\",\r\n" +// + " \"id\": \"bb155452-4044-4750-a0ec-b1ff15ecf6ad\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613912076.0972567\r\n" +// + " },\r\n" +// + " {\r\n" +// + " \"queuePosition\": 0,\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"detailed-status\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"operationState\": \"FAILED\",\r\n" +// + " \"errorMessage\": \"FAILED Sending scale order to VIM: reached the limit of 3 (max-instance-count) scaling-out operations for the scaling-group-descriptor 'apache_vdu_autoscale'\",\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"_admin\": {\r\n" +// + " \"projects_write\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ],\r\n" +// + " \"created\": 1613912098.5701716,\r\n" +// + " \"modified\": 1613912098.681397,\r\n" +// + " \"worker\": \"dd52ddce9643\",\r\n" +// + " \"projects_read\": [\r\n" +// + " \"44f213c8-49ff-40be-b670-e89fef7f25ed\"\r\n" +// + " ]\r\n" +// + " },\r\n" +// + " \"detailedStatus\": null,\r\n" +// + " \"stage\": \"\",\r\n" +// + " \"operationParams\": {\r\n" +// + " \"nsInstanceId\": \"b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"scaleType\": \"SCALE_VNF\",\r\n" +// + " \"lcmOperationType\": \"scale\",\r\n" +// + " \"scaleVnfData\": {\r\n" +// + " \"scaleByStepData\": {\r\n" +// + " \"member-vnf-index\": \"1\",\r\n" +// + " \"scaling-group-descriptor\": \"apache_vdu_autoscale\"\r\n" +// + " },\r\n" +// + " \"scaleVnfType\": \"SCALE_OUT\"\r\n" +// + " }\r\n" +// + " },\r\n" +// + " \"startTime\": 1613912098.5701249,\r\n" +// + " \"links\": {\r\n" +// + " \"nsInstance\": \"/osm/nslcm/v1/ns_instances/b87a6b38-2f46-4b65-9791-f86f482ec267\",\r\n" +// + " \"self\": \"/osm/nslcm/v1/ns_lcm_op_occs/a1cbf62f-1b32-4788-9da6-3a9fdafd3ef9\"\r\n" +// + " },\r\n" +// + " \"_id\": \"a1cbf62f-1b32-4788-9da6-3a9fdafd3ef9\",\r\n" +// + " \"id\": \"a1cbf62f-1b32-4788-9da6-3a9fdafd3ef9\",\r\n" +// + " \"isAutomaticInvocation\": false,\r\n" +// + " \"isCancelPending\": false,\r\n" +// + " \"statusEnteredTime\": 1613912098.6813943\r\n" +// + " }\r\n" +// + "]"; +//// System.out.println("Round 1"); +//// String output = getNSLCMDetailsListByNSID(response_body, "b87a6b38-2f46-4b65-9791-f86f482ec267"); +//// System.out.println(output); +//// System.out.println("Round 2"); +//// output = getNSLCMDetailsListByNSID(output, "b87a6b38-2f46-4b65-9791-f86f482ec267"); +//// System.out.println(output); +//// System.out.println("Round 3"); +//// output = getNSLCMDetailsListByNSID(output, "b87a6b38-2f46-4b65-9791-f86f482ec267"); +//// System.out.println(output); +// System.out.println(compareNSLCMDetailsScaleOpsList(current, current)); +// System.out.println(compareNSLCMDetailsScaleOpsList(current, current).length()); +// } +// +// public static JSONArray compareNSLCMDetailsScaleOpsList(String previous, String current) +// { +// JSONArray result = new JSONArray(); +// try { +// JSONArray array = new JSONArray(previous); +// JSONArray array2 = new JSONArray(current); +// if(array.length()%s
", this.nsDescriptor.getName() ); + fmt.format("%s: %s
", "Vendor", nsDescriptor.getDesigner()); + fmt.format("%s: %s
", "Version", nsDescriptor.getVersion()); + fmt.format("%s: %s
", "Description", nsDescriptor.getName()); + if ( nsDescriptor.getDf() != null ) { + fmt.format("%s: %d
", "VNF Count", nsDescriptor.getDf().size()); + } + + fmt.format("%s: %d
", "VM Count", vmCount); + fmt.format("%s: %d
", "vCPU Count", vcpuCount); + fmt.format("%s: %d MB
", "Memory", memoryMB); + fmt.format("%s: %d GB
", "Storage", storageGB); + + fmt.format("

%s


", "ConstituentVnfds" ); + if ( nsDescriptor.getDf() != null ) { + @Nullable Map vl = nsDescriptor.getDf(); + for (Df df : vl.values()) { + fmt.format("%s: %s
", "VnfdId", df.getId()); + } + } + + + return stringBuilder.toString(); + } + + @Override + public String toString() { + return "NSRequirements{" + + "nsName=" + nsDescriptor.getName() + + ", memoryMB=" + memoryMB + + ", storageGB=" + storageGB + + ", vcpuCount=" + vcpuCount + + ", vmCount=" + vmCount + + '}'; + } +} diff --git a/src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java b/src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java new file mode 100644 index 0000000000000000000000000000000000000000..e8ef42a1017481a10c4e6b9497b4f7a649de71cb --- /dev/null +++ b/src/main/java/OSM10Util/OSM10VNFReq/OSM10VNFRequirements.java @@ -0,0 +1,92 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * 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 OSM10Util.OSM10VNFReq; + +import java.util.Formatter; +import java.util.Map; + +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; + +public class OSM10VNFRequirements { + public Vnfd descriptor; + + public boolean unknownFields = false; + public int memoryMB = 0; + public int storageGB = 0; + public int vcpuCount = 0; + public int vmCount = 0; + + public OSM10VNFRequirements() + {} + + public OSM10VNFRequirements(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd vnfHackfestMultiVduDescriptor) { + this.descriptor = vnfHackfestMultiVduDescriptor; + + this.memoryMB = 0; + this.storageGB = 0; + this.vcpuCount = 0; + this.vmCount = 0; + Map virtualComputeDescMap = vnfHackfestMultiVduDescriptor.getVirtualComputeDesc(); + if ( virtualComputeDescMap != null) { + for(VirtualComputeDesc tmp : virtualComputeDescMap.values()) + { + this.memoryMB = tmp.getVirtualMemory().getSize().intValue(); + this.vcpuCount = tmp.getVirtualCpu().getNumVirtualCpu().intValue(); + this.vmCount++; + } + Map virtualStorageDescMap = vnfHackfestMultiVduDescriptor.getVirtualStorageDesc(); + for(VirtualStorageDesc tmp : virtualStorageDescMap.values()) + { + this.storageGB = tmp.getSizeOfStorage().intValue(); + } + } + + } + + public String toHTML() { + StringBuilder stringBuilder = new StringBuilder(); + Formatter fmt = new Formatter(stringBuilder); + fmt.format("

%s


", descriptor.getProductName()); + fmt.format("%s: %s
", "Vendor", descriptor.getProvider() ); + fmt.format("%s: %s
", "Version", descriptor.getVersion() ); + fmt.format("%s: %s
", "Description", descriptor.getProductInfoDescription()); + fmt.format("%s: %d
", "VM Count", vmCount); + fmt.format("%s: %d
", "vCPU Count", vcpuCount); + fmt.format("%s: %d MB
", "Memory", memoryMB); + fmt.format("%s: %d GB
", "Storage", storageGB); + + return stringBuilder.toString(); + } + + @Override + public String toString() { + return "VNFRequirements{" + + "vnfName=" + descriptor.getProductName() + + ", memoryMB=" + memoryMB + + ", storageGB=" + storageGB + + ", vcpuCount=" + vcpuCount + + ", vmCount=" + vmCount + + '}'; + } +} diff --git a/src/main/java/OSM10Util/examples/Example.java b/src/main/java/OSM10Util/examples/Example.java new file mode 100644 index 0000000000000000000000000000000000000000..4f12a14d1eee5d85760fdc061823a49f6d2307be --- /dev/null +++ b/src/main/java/OSM10Util/examples/Example.java @@ -0,0 +1,83 @@ +/*- + * ========================LICENSE_START================================= + * org.etsi.osl.sol005nbi.osm10 + * %% + * 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 OSM10Util.examples; + +import java.io.File; +import java.io.IOException; +import java.net.URL; +import java.util.Map; + +import org.apache.commons.io.FileUtils; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; + +import OSM10Util.OSM10ArchiveExtractor.OSM10NSExtractor; +import OSM10Util.OSM10ArchiveExtractor.OSM10VNFDExtractor; +import OSM10Util.OSM10NSReq.OSM10NSRequirements; +import OSM10Util.OSM10VNFReq.OSM10VNFRequirements; + + + +public class Example { + //private static URL cirrosVnfUrl; + //private static URL hackfest1VnfUrl; + //private static URL hackfest2VnfUrl; + //private static URL pingPongNsUrl; + private static URL hackfestMultiVduUrl; + private static URL hackfestMultiVduNSUrl; + + public static void main(String[] args) throws IOException { + hackfestMultiVduUrl = new URL("http://localhost/osm/hackfest_multivdu_vnf.tar.gz"); + hackfestMultiVduNSUrl = new URL("http://localhost/osm/hackfest_multivdu_ns.tar.gz"); + + File hackfestMultiVduFile = File.createTempFile("hackfest_multivdu_vnf", ".tar.gz"); + File hackfestMultiVduNSFile = File.createTempFile("hackfest_multivdu_ns", ".tar.gz"); + //File pingPongNsFile = File.createTempFile("ping_pong_ns", ".tar.gz"); + + hackfestMultiVduFile.deleteOnExit(); + hackfestMultiVduNSFile.deleteOnExit(); + + System.out.println("Downloading VNF"); + + FileUtils.copyURLToFile(hackfestMultiVduUrl, hackfestMultiVduFile); + FileUtils.copyURLToFile(hackfestMultiVduNSUrl, hackfestMultiVduNSFile); + + System.out.println("Calculating requirements..."); + + OSM10VNFDExtractor vnfHackfestMultiVduExtract = new OSM10VNFDExtractor(hackfestMultiVduFile.getPath()); + Vnfd vnfHackfestMultiVduDescriptor = vnfHackfestMultiVduExtract.extractVnfdDescriptor(); + System.out.println(vnfHackfestMultiVduDescriptor.toString()); + OSM10VNFRequirements vnfHackfestMultiVduRequirements = new OSM10VNFRequirements(vnfHackfestMultiVduDescriptor); + System.out.println(vnfHackfestMultiVduRequirements.toHTML()); + OSM10NSExtractor nsExtractor = new OSM10NSExtractor(hackfestMultiVduNSFile); + Nsd hackfestMultiVduNSDescriptor = nsExtractor.extractNsDescriptor(); + OSM10NSRequirements hackfestMultiVduNSRequirements = new OSM10NSRequirements(hackfestMultiVduNSDescriptor); + + for (Df v : hackfestMultiVduNSDescriptor.getDf().values()) { + for( VnfProfile q : v.getVnfProfile().values()) + { + System.out.println("setMemberVNFIndex: "+Integer.parseInt(q.getId())); + System.out.println("setVNFDIdRef: "+(String) q.getVnfdId()); + } + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java new file mode 100644 index 0000000000000000000000000000000000000000..710b8fa2cc762c6eca2169dc3ea1492b497d558e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModelBindingProvider.java @@ -0,0 +1,12 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; + +import java.lang.Override; +import org.opendaylight.yangtools.yang.binding.YangModelBindingProvider; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; + +public final class $YangModelBindingProvider implements YangModelBindingProvider { + @Override + public YangModuleInfo getModuleInfo() { + return $YangModuleInfoImpl.getInstance(); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java new file mode 100644 index 0000000000000000000000000000000000000000..debda92eab6df17345e79277c6923e1b3bece9dd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/$YangModuleInfoImpl.java @@ -0,0 +1,173 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; + +import com.google.common.collect.ImmutableSet; +import java.lang.Override; +import java.lang.String; +import java.util.HashSet; +import java.util.Set; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.ResourceYangModuleInfo; +import org.opendaylight.yangtools.yang.binding.YangModuleInfo; +import org.opendaylight.yangtools.yang.common.QName; + +public final class $YangModuleInfoImpl extends ResourceYangModuleInfo { + private static final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-descriptors").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new $YangModuleInfoImpl(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + public static @NonNull QName qnameOf(final String localName) { + return QName.create(NAME, localName).intern(); + } + + private $YangModuleInfoImpl() { + Set set = new HashSet<>(); + set.add(EtsiNfvNsInfo.getInstance()); + set.add(EtsiNfvCommonInfo.getInstance()); + set.add(EtsiNfvVnfInfo.getInstance()); + set.add(EtsiNfvPnfInfo.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-descriptors@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + + private static final class EtsiNfvNsInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-ns").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvNsInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvNsInfo() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-ns@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } + + private static final class EtsiNfvCommonInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-common").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvCommonInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvCommonInfo() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-common@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } + + private static final class EtsiNfvVnfInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-03-18", "etsi-nfv-vnf").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvVnfInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvVnfInfo() { + Set set = new HashSet<>(); + set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.$YangModuleInfoImpl.getInstance()); + set.add(org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.$YangModuleInfoImpl.getInstance()); + importedModules = ImmutableSet.copyOf(set); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-vnf@2019-03-18.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } + + private static final class EtsiNfvPnfInfo extends ResourceYangModuleInfo { + private final @NonNull QName NAME = QName.create("urn:etsi:nfv:yang:etsi-nfv-descriptors", "2019-04-25", "etsi-nfv-pnf").intern(); + private static final @NonNull YangModuleInfo INSTANCE = new EtsiNfvPnfInfo(); + + private final @NonNull ImmutableSet importedModules; + + public static @NonNull YangModuleInfo getInstance() { + return INSTANCE; + } + + private EtsiNfvPnfInfo() { + importedModules = ImmutableSet.of(); + } + + @Override + public QName getName() { + return NAME; + } + + @Override + protected String resourceName() { + return "/META-INF/yang/etsi-nfv-pnf@2019-04-25.yang"; + } + + @Override + public ImmutableSet getImportedModules() { + return importedModules; + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java new file mode 100644 index 0000000000000000000000000000000000000000..e3311f1a41e479a6555b4aed9269343bea8400ce --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AddressType.java @@ -0,0 +1,32 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the type of the address to be assigned to the CP instantiated from + * parent CPD. Value: • MAC address. • IP address. • … The content type shall be + * aligned with the address type supported by the layerProtocol attribute of the + * parent CPD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity address-type {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/address-type + * + */ +public interface AddressType + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("address-type"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java new file mode 100644 index 0000000000000000000000000000000000000000..7ede8794e0630c5c68ce5f013b8f09068c72764d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityScope.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum AffinityScope implements Enumeration { + NfviNode(0, "nfvi-node"), + + ZoneGroup(1, "zone-group"), + + Zone(2, "zone"), + + NfviPop(3, "nfvi-pop") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (AffinityScope enumItem : AffinityScope.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private AffinityScope(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding AffinityScope item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding AffinityScope item, or null if no such item exists + */ + public static AffinityScope forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java new file mode 100644 index 0000000000000000000000000000000000000000..b32148b52df86650489e4f778dcbdd0de32353b8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/AffinityType.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum AffinityType implements Enumeration { + Affinity(0, "affinity"), + + AntiAffinity(1, "anti-affinity") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (AffinityType enumItem : AffinityType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private AffinityType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding AffinityType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding AffinityType item, or null if no such item exists + */ + public static AffinityType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java new file mode 100644 index 0000000000000000000000000000000000000000..8db3309c5c1d2b2134668e7582d528489d599589 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChangeVnfFlavour.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation changes the DF of a VNF instance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity change-vnf-flavour {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/change-vnf-flavour + * + */ +public interface ChangeVnfFlavour + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("change-vnf-flavour"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java new file mode 100644 index 0000000000000000000000000000000000000000..e97ae86c6c9abea56f41280ea4ad9aa437328611 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ChecksumAlgorithm.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies the algorithms supported for the purpose of calculating the checksum. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity checksum-algorithm {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/checksum-algorithm + * + */ +public interface ChecksumAlgorithm + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("checksum-algorithm"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java new file mode 100644 index 0000000000000000000000000000000000000000..ee2e87aea7edaf5f70488baadb16244f588fe226 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ConnectivityType.java @@ -0,0 +1,48 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping connectivity-type {
+ *   container connectivity-type {
+ *     leaf-list layer-protocol {
+ *       type identityref {
+ *         base layer-protocol;
+ *       }
+ *     }
+ *     leaf flow-pattern {
+ *       type flow-pattern;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/connectivity-type + * + */ +public interface ConnectivityType + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("connectivity-type"); + + @Override + Class implementedInterface(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType connectivityType, or null if not present + */ + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.@Nullable ConnectivityType getConnectivityType(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java new file mode 100644 index 0000000000000000000000000000000000000000..2b5c8b0da3e5f633c75aacb349bd0920c7f467de --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/CpRole.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies the role of the port in the context of the traffic flow patterns in + * the VNF or parent NS. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity cp-role {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cp-role + * + */ +public interface CpRole + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cp-role"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java new file mode 100644 index 0000000000000000000000000000000000000000..adfbda8ea77147281e7a4883e9c12ab4e8ccbb5b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Cpd.java @@ -0,0 +1,175 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.ProtocolKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * A Cpd information element describes network connectivity to a compute resource + * or a VL. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping cpd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf-list layer-protocol {
+ *     default ethernet;
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   leaf role {
+ *     type identityref {
+ *       base cp-role;
+ *     }
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list protocol {
+ *     key associated-layer-protocol;
+ *     leaf associated-layer-protocol {
+ *       type identityref {
+ *         base layer-protocol;
+ *       }
+ *     }
+ *     list address-data {
+ *       key type;
+ *       leaf type {
+ *         type identityref {
+ *           base address-type;
+ *         }
+ *       }
+ *       container l2-address-data {
+ *         when "../type='mac-address'";
+ *         leaf mac-address-assignment {
+ *           type boolean;
+ *         }
+ *       }
+ *       container l3-address-data {
+ *         when "../type='ip-address'";
+ *         leaf ip-address-assignment {
+ *           type boolean;
+ *         }
+ *         leaf floating-ip-activated {
+ *           type boolean;
+ *         }
+ *         leaf ip-address-type {
+ *           type enumeration {
+ *             enum ipv4;
+ *             enum ipv6;
+ *           }
+ *         }
+ *         leaf number-of-ip-addresses {
+ *           type uint32;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   leaf trunk-mode {
+ *     type boolean;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd + * + */ +public interface Cpd + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("cpd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this Cpd information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies a protocol that the connection points corresponding to the CPD + * support for connectivity purposes (e.g. Ethernet, MPLS, ODU2, IPV4, IPV6, + * Pseudo-Wire, etc.). + * + * + * + * @return java.util.List layerProtocol, or null if not present + */ + @Nullable List> getLayerProtocol(); + + /** + * Identifies the role of the connection points corresponding to the CPD in the + * context of the traffic flow patterns in the VNF, PNF or NS. For example an NS + * with a tree flow pattern within the NS will have legal cpRoles of ROOT and LEAF. + * + * + * + * @return java.lang.Class role, or null if not present + */ + @Nullable Class getRole(); + + /** + * Provides human-readable information on the purpose of the connection point (e.g. + * connection point for control plane traffic). + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Identifies the protocol layering information the CP uses for connectivity + * purposes and associated information. There shall be one cpProtocol for each + * layer protocol as indicated by the attribute layerProtocol. When a PnfExtCpd as + * defined in ETSI GS NFV-IFA 014 [i.8] is inherited from this Cpd, the cardinality + * is set to 0. + * + * + * + * @return java.util.Map protocol, or null if not present + */ + @Nullable Map getProtocol(); + + /** + * @return java.util.Map protocol, or an empty list if it is not present + */ + default @NonNull Map nonnullProtocol() { + return CodeHelpers.nonnull(getProtocol()); + } + + /** + * Information about whether the Cp instantiated from this CPD is in Trunk mode + * (802.1Q or other). When operating in 'trunk mode', the Cp is capable of carrying + * traffic for several VLANs. A cardinality of 0 implies that trunkMode is not + * configured for the Cp i.e. It is equivalent to Boolean value 'false'. + * + * + * + * @return java.lang.Boolean trunkMode, or null if not present + */ + @Nullable Boolean isTrunkMode(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java new file mode 100644 index 0000000000000000000000000000000000000000..da1a7ea1aefb8ff1aa932f945196a8766f409d1b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EphemeralStorage.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Ephemeral type of storage. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ephemeral-storage {
+ *   base storage-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ephemeral-storage + * + */ +public interface EphemeralStorage + extends + StorageType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ephemeral-storage"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java new file mode 100644 index 0000000000000000000000000000000000000000..d8752a1d4c77de3f24591139987f0a59389f7a81 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ethernet.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ethernet {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ethernet + * + */ +public interface Ethernet + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ethernet"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java new file mode 100644 index 0000000000000000000000000000000000000000..de70e2748c116702b8f419b470c2aac3f171bc6b --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/EtsiNfvDescriptorsData.java @@ -0,0 +1,53 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataRoot; + +/** + * Network Function Virtualization Descriptors + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * module etsi-nfv-descriptors {
+ *   yang-version 1.1;
+ *   namespace urn:etsi:nfv:yang:etsi-nfv-descriptors;
+ *   prefix nfv;
+ *   include etsi-nfv-common;
+ *   include etsi-nfv-ns;
+ *   include etsi-nfv-vnf;
+ *   include etsi-nfv-pnf;
+ *   revision 2019-04-25 {
+ *   }
+ *   container nfv {
+ *     list vnfd {
+ *       key id;
+ *       uses vnfd;
+ *     }
+ *     list nsd {
+ *       key id;
+ *       uses nsd;
+ *     }
+ *     list pnfd {
+ *       key id;
+ *       uses pnfd;
+ *     }
+ *   }
+ * }
+ * 
+ * + */ +public interface EtsiNfvDescriptorsData + extends + DataRoot +{ + + + + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv nfv, or null if not present + */ + @Nullable Nfv getNfv(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java new file mode 100644 index 0000000000000000000000000000000000000000..ce428437949d81e72fb3d20e619ebd322e94368c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/FlowPattern.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum FlowPattern implements Enumeration { + Line(0, "line"), + + Tree(1, "tree"), + + Mesh(2, "mesh") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (FlowPattern enumItem : FlowPattern.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private FlowPattern(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding FlowPattern item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding FlowPattern item, or null if no such item exists + */ + public static FlowPattern forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java new file mode 100644 index 0000000000000000000000000000000000000000..441fa9edb552d0b411680d7e62536c435d88b2b2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/HealVnf.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation enables the NFVO to request a VNFM to perform a VNF healing + * procedure. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity heal-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/heal-vnf + * + */ +public interface HealVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("heal-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java new file mode 100644 index 0000000000000000000000000000000000000000..c0a8ef19382385caa4aafd2bef4c0d5449070085 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InstantiateVnf.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation instantiates a particular DF of a VNF based on the definition in + * the VNFD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity instantiate-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/instantiate-vnf + * + */ +public interface InstantiateVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("instantiate-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java new file mode 100644 index 0000000000000000000000000000000000000000..1f5290e291229dafdb3cb146e3d9e0c04c61c6fb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/InternalLifecycleManagementScriptEvent.java @@ -0,0 +1,99 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.opendaylight.yangtools.yang.binding.Enumeration; + +public enum InternalLifecycleManagementScriptEvent implements Enumeration { + StartInstantiation(0, "start-instantiation"), + + EndInstantiation(1, "end-instantiation"), + + StartScaling(2, "start-scaling"), + + EndScaling(3, "end-scaling"), + + StartHealing(4, "start-healing"), + + EndHealing(5, "end-healing"), + + StartTermination(6, "start-termination"), + + EndTermination(7, "end-termination"), + + StartVnfFlavourChange(8, "start-vnf-flavour-change"), + + EndVnfFlavourChange(9, "end-vnf-flavour-change"), + + StartVnfOperationChange(10, "start-vnf-operation-change"), + + EndVnfOperationChange(11, "end-vnf-operation-change"), + + StartVnfExtConnChange(12, "start-vnf-ext-conn-change"), + + EndVnfExtConnChange(13, "end-vnf-ext-conn-change"), + + StartVnfinfoModification(14, "start-vnfinfo-modification"), + + EndVnfinfoModification(15, "end-vnfinfo-modification") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (InternalLifecycleManagementScriptEvent enumItem : InternalLifecycleManagementScriptEvent.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private InternalLifecycleManagementScriptEvent(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding InternalLifecycleManagementScriptEvent item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding InternalLifecycleManagementScriptEvent item, or null if no such item exists + */ + public static InternalLifecycleManagementScriptEvent forValue(int intValue) { + return VALUE_MAP.get(intValue); + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java new file mode 100644 index 0000000000000000000000000000000000000000..8ccb48668ef226d80e1226a1977ee8726102e196 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/IpAddress.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ip-address {
+ *   base address-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ip-address + * + */ +public interface IpAddress + extends + AddressType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ip-address"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java new file mode 100644 index 0000000000000000000000000000000000000000..d43c9d22793d462daf414389bb658bd369b0a8c8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv4.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ipv4 {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ipv4 + * + */ +public interface Ipv4 + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ipv4"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java new file mode 100644 index 0000000000000000000000000000000000000000..c6b337a178d4d7d02135807f8cb6da244f048b4d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Ipv6.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity ipv6 {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/ipv6 + * + */ +public interface Ipv6 + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ipv6"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java new file mode 100644 index 0000000000000000000000000000000000000000..321aaf37049e978d5997cb022842d24d4dfe17e9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LayerProtocol.java @@ -0,0 +1,27 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity layer-protocol;
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/layer-protocol + * + */ +public interface LayerProtocol + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("layer-protocol"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java new file mode 100644 index 0000000000000000000000000000000000000000..0a757cf6827e4aab6c4596d044f822bfc3e065dd --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Leaf.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity leaf {
+ *   base cp-role;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/leaf + * + */ +public interface Leaf + extends + CpRole +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("leaf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java new file mode 100644 index 0000000000000000000000000000000000000000..8ddd79acdd8f2de3eb40ac9df4b13ad08eb05769 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LinkBitrateRequirements.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping link-bitrate-requirements {
+ *   leaf root {
+ *     type uint64;
+ *     units Mbps;
+ *   }
+ *   leaf leaf {
+ *     type uint64;
+ *     units Mbps;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/link-bitrate-requirements + * + */ +public interface LinkBitrateRequirements + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("link-bitrate-requirements"); + + @Override + Class implementedInterface(); + + /** + * Specifies the throughput requirement of the link (e.g. bitrate of E-Line, root + * bitrate of E-Tree, aggregate capacity of E-LAN). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 root, or null if not present + */ + @Nullable Uint64 getRoot(); + + /** + * Specifies the throughput requirement of leaf connections to the link when + * applicable to the connectivity type (e.g. for E-Tree and E-LAN branches). + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 leaf, or null if not present + */ + @Nullable Uint64 getLeaf(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java new file mode 100644 index 0000000000000000000000000000000000000000..9008dee88e866c3c941f021bfc9e6b090443ed6e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/LocalAffinityOrAntiAffinityRule.java @@ -0,0 +1,57 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRuleKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping local-affinity-or-anti-affinity-rule {
+ *   list local-affinity-or-anti-affinity-rule {
+ *     key "affinity-type affinity-scope";
+ *     leaf affinity-type {
+ *       type affinity-type;
+ *     }
+ *     leaf affinity-scope {
+ *       type affinity-scope;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/local-affinity-or-anti-affinity-rule + * + */ +public interface LocalAffinityOrAntiAffinityRule + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("local-affinity-or-anti-affinity-rule"); + + @Override + Class implementedInterface(); + + /** + * @return java.util.Map localAffinityOrAntiAffinityRule, or null if not present + */ + @Nullable Map getLocalAffinityOrAntiAffinityRule(); + + /** + * @return java.util.Map localAffinityOrAntiAffinityRule, or an empty list if it is not present + */ + default @NonNull Map nonnullLocalAffinityOrAntiAffinityRule() { + return CodeHelpers.nonnull(getLocalAffinityOrAntiAffinityRule()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java new file mode 100644 index 0000000000000000000000000000000000000000..66934107c86b1448cf5f14cc3e51491a6bcf98ab --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MacAddress.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity mac-address {
+ *   base address-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/mac-address + * + */ +public interface MacAddress + extends + AddressType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("mac-address"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java new file mode 100644 index 0000000000000000000000000000000000000000..ba547a53bdd068da673918210fae65132b55a6cf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ModifyVnfInformation.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation allows updating information about a VNF instance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity modify-vnf-information {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/modify-vnf-information + * + */ +public interface ModifyVnfInformation + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("modify-vnf-information"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java new file mode 100644 index 0000000000000000000000000000000000000000..a5b39a1d46ba136992fb96a735b336c8ac79f498 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/MonitoringParameter.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint64; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping monitoring-parameter {
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf performance-metric {
+ *     type string;
+ *   }
+ *   leaf collection-period {
+ *     type uint64;
+ *     units ms;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/monitoring-parameter + * + */ +public interface MonitoringParameter + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitoring-parameter"); + + @Override + Class implementedInterface(); + + /** + * Human readable name of the monitoring parameter. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Performance metric that is monitored. This attribute shall contain the related + * 'Measurement Name' value as defined in clause 7.2 of ETSI GS NFV-IFA 027 + * + * + * + * @return java.lang.String performanceMetric, or null if not present + */ + @Nullable String getPerformanceMetric(); + + /** + * An attribute that describes the recommended periodicity at which to collect the + * performance information. VNFM determines if this parameter is considered. The + * vendor may provide this information as a guidance for creating PmJobs if needed. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint64 collectionPeriod, or null if not present + */ + @Nullable Uint64 getCollectionPeriod(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java new file mode 100644 index 0000000000000000000000000000000000000000..bfdeb636981615bddd4a6ec62b9122c24abdcf6c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Mpls.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity mpls {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/mpls + * + */ +public interface Mpls + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("mpls"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java new file mode 100644 index 0000000000000000000000000000000000000000..5b0214dc02e502d821f26a20e328295431c62f3e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nfv.java @@ -0,0 +1,112 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.PnfdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container nfv {
+ *   list vnfd {
+ *     key id;
+ *     uses vnfd;
+ *   }
+ *   list nsd {
+ *     key id;
+ *     uses nsd;
+ *   }
+ *   list pnfd {
+ *     key id;
+ *     uses pnfd;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv + * + *

To create instances of this class use {@link NfvBuilder}. + * @see NfvBuilder + * + */ +public interface Nfv + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nfv"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv.class; + } + + /** + * A VNF Descriptor (VNFD) is a deployment template which describes a VNF in terms + * of deployment and operational behaviour requirements. It also contains + * connectivity, interface and virtualised resource requirements + * + * + * + * @return java.util.Map vnfd, or null if not present + */ + @Nullable Map getVnfd(); + + /** + * @return java.util.Map vnfd, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfd() { + return CodeHelpers.nonnull(getVnfd()); + } + + /** + * The NSD information element is a deployment template whose instances are used by + * the NFVO for the lifecycle management of NSs. + * + * + * + * @return java.util.Map nsd, or null if not present + */ + @Nullable Map getNsd(); + + /** + * @return java.util.Map nsd, or an empty list if it is not present + */ + default @NonNull Map nonnullNsd() { + return CodeHelpers.nonnull(getNsd()); + } + + /** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only. + * + * + * + * @return java.util.Map pnfd, or null if not present + */ + @Nullable Map getPnfd(); + + /** + * @return java.util.Map pnfd, or an empty list if it is not present + */ + default @NonNull Map nonnullPnfd() { + return CodeHelpers.nonnull(getPnfd()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..81f9e2d69cbfea3b9c4f25899c5747b605a77a0d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/NfvBuilder.java @@ -0,0 +1,331 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Pnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.PnfdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NfvBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NfvBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NfvBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NfvBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NfvBuilder + * @see Builder + * + */ +public class NfvBuilder implements Builder { + + private Map _nsd; + private Map _pnfd; + private Map _vnfd; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NfvBuilder() { + } + + public NfvBuilder(Nfv base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._nsd = base.getNsd(); + this._pnfd = base.getPnfd(); + this._vnfd = base.getVnfd(); + } + + + public Map getNsd() { + return _nsd; + } + + public Map getPnfd() { + return _pnfd; + } + + public Map getVnfd() { + return _vnfd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NfvBuilder setNsd(final Map values) { + this._nsd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder setNsd(final List values) { + return setNsd(CodeHelpers.compatMap(values)); + } + public NfvBuilder setPnfd(final Map values) { + this._pnfd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPnfd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder setPnfd(final List values) { + return setPnfd(CodeHelpers.compatMap(values)); + } + public NfvBuilder setVnfd(final Map values) { + this._vnfd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder setVnfd(final List values) { + return setVnfd(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NfvBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NfvBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NfvBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NfvBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nfv build() { + return new NfvImpl(this); + } + + private static final class NfvImpl + extends AbstractAugmentable + implements Nfv { + + private final Map _nsd; + private final Map _pnfd; + private final Map _vnfd; + + NfvImpl(NfvBuilder base) { + super(base.augmentation); + this._nsd = CodeHelpers.emptyToNull(base.getNsd()); + this._pnfd = CodeHelpers.emptyToNull(base.getPnfd()); + this._vnfd = CodeHelpers.emptyToNull(base.getVnfd()); + } + + @Override + public Map getNsd() { + return _nsd; + } + + @Override + public Map getPnfd() { + return _pnfd; + } + + @Override + public Map getVnfd() { + return _vnfd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_nsd); + result = prime * result + Objects.hashCode(_pnfd); + result = prime * result + Objects.hashCode(_vnfd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nfv.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nfv other = (Nfv)obj; + if (!Objects.equals(_nsd, other.getNsd())) { + return false; + } + if (!Objects.equals(_pnfd, other.getPnfd())) { + return false; + } + if (!Objects.equals(_vnfd, other.getVnfd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NfvImpl otherImpl = (NfvImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nfv"); + CodeHelpers.appendValue(helper, "_nsd", _nsd); + CodeHelpers.appendValue(helper, "_pnfd", _pnfd); + CodeHelpers.appendValue(helper, "_vnfd", _vnfd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java new file mode 100644 index 0000000000000000000000000000000000000000..1e808376dc18aa3a1e40f3bde049f6d13cafd2d7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Nsd.java @@ -0,0 +1,867 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.NsdBuilder.NsdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder.VnfdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.SapdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VnffgdKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping nsd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf designer {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf invariant-id {
+ *     type string;
+ *   }
+ *   leaf-list nested-nsd-id {
+ *     must ". != ../id";
+ *     type leafref {
+ *       path ../../nsd/id;
+ *     }
+ *   }
+ *   leaf-list vnfd-id {
+ *     type leafref {
+ *       path ../../vnfd/id;
+ *     }
+ *   }
+ *   leaf-list pnfd-id {
+ *     type leafref {
+ *       path ../../pnfd/id;
+ *     }
+ *   }
+ *   list sapd {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf address-assignment {
+ *       type boolean;
+ *     }
+ *     choice cpd-or-virtual-link {
+ *       case virtual-link-desc {
+ *         leaf virtual-link-desc {
+ *           type leafref {
+ *             path ../../virtual-link-desc/id;
+ *           }
+ *         }
+ *       }
+ *       case vnf {
+ *         container vnf {
+ *           leaf vnfd-id {
+ *             type leafref {
+ *               path ../../../../vnfd/id;
+ *             }
+ *             must boolean(../../../vnfd-id[.=current()]);
+ *           }
+ *           leaf ext-cpd-id {
+ *             type leafref {
+ *               path deref(../vnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case pnf {
+ *         container pnf {
+ *           leaf pnfd-id {
+ *             type leafref {
+ *               path ../../../../pnfd/id;
+ *             }
+ *             must boolean(../pnfd-id[.=current()]);
+ *           }
+ *           leaf ext-cpd-id {
+ *             type leafref {
+ *               path deref(../pnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case ns {
+ *         container ns {
+ *           leaf nsd-id {
+ *             type leafref {
+ *               path ../../../../nsd/id;
+ *             }
+ *             must boolean(../nsd-id[.=current()]);
+ *           }
+ *           leaf ext-cpd-id {
+ *             type leafref {
+ *               path deref(../nsd-id)/../sapd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     uses connectivity-type;
+ *     list df {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container qos {
+ *         presence "VL QoS parameters";
+ *         leaf latency {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-delay-variation {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-loss-ratio {
+ *           type decimal64 {
+ *             fraction-digits 2;
+ *             range 0..1.00;
+ *           }
+ *         }
+ *         leaf priority {
+ *           type uint32;
+ *         }
+ *       }
+ *       leaf service-availability-level {
+ *         type enumeration {
+ *           enum level-1;
+ *           enum level-2;
+ *           enum level-3;
+ *         }
+ *       }
+ *     }
+ *     leaf test-access {
+ *       type enumeration {
+ *         enum none;
+ *         enum passive-monitoring;
+ *         enum active;
+ *       }
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     uses security-parameters;
+ *   }
+ *   list vnffgd {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf-list vnf-profile-id {
+ *       type leafref {
+ *         path ../../df/vnf-profile/id;
+ *       }
+ *     }
+ *     leaf-list pnf-profile-id {
+ *       type leafref {
+ *         path ../../df/pnf-profile/id;
+ *       }
+ *     }
+ *     leaf-list nested-ns-profile-id {
+ *       type leafref {
+ *         path ../../df/ns-profile/id;
+ *       }
+ *     }
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../df/virtual-link-profile/id;
+ *       }
+ *     }
+ *     list cpd-pool {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       choice constituent-base-element-id {
+ *         case vnf-profile {
+ *           container vnf-profile {
+ *             leaf vnf-profile-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/df/vnf-profile/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case pnf-profile {
+ *           container pnf-profile {
+ *             leaf pnf-profile-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/df/pnf-profile/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case ns-profile {
+ *           container ns-profile {
+ *             leaf ns-profile-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/df/ns-profile/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *       }
+ *       choice constituent-cpd-id {
+ *         case vnf {
+ *           container vnf {
+ *             leaf vnfd-id {
+ *               type leafref {
+ *                 path ../../../../../vnfd/id;
+ *               }
+ *             }
+ *             leaf cpd-id {
+ *               type leafref {
+ *                 path deref(../vnfd-id)/../ext-cpd/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case pnf {
+ *           container pnf {
+ *             leaf pnfd-id {
+ *               type leafref {
+ *                 path ../../../../../pnfd/id;
+ *               }
+ *             }
+ *             leaf pnf-cpd-id {
+ *               type leafref {
+ *                 path deref(../pnfd-id)/../ext-cpd/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         case ns {
+ *           container ns {
+ *             leaf nsd-id {
+ *               type leafref {
+ *                 path ../../../../../nsd/id;
+ *               }
+ *             }
+ *             leaf sap-cpd-id {
+ *               type leafref {
+ *                 path deref(../nsd-id)/../sapd/id;
+ *               }
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list nfpd {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf rule {
+ *         type string;
+ *       }
+ *       list position-desc-id {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         list cp-profile-id {
+ *           key id;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           list constituent-profile-elements {
+ *             key id;
+ *             leaf id {
+ *               type string;
+ *             }
+ *             leaf cpd-id {
+ *               type string;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   leaf-list autoscale-rule {
+ *     type string;
+ *   }
+ *   list lifecycle-management-script {
+ *     key event;
+ *     leaf event {
+ *       type string;
+ *     }
+ *     leaf script {
+ *       type string;
+ *     }
+ *   }
+ *   list df {
+ *     min-elements 1;
+ *     must "default-instantiation-level or count(ns-instantiation-level) = 1" {
+ *       error-message
+ *         "default-instantiation-level must be present if there multiple instantion-level";
+ *     }
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf flavour-key {
+ *       type leafref {
+ *         path ../monitored-info/id;
+ *       }
+ *     }
+ *     list vnf-profile {
+ *       must "min-number-of-instances <= max-number-of-instances";
+ *       must boolean(../../vnfd-id[.=current()/vnfd-id]) {
+ *         error-message
+ *           "VNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *       }
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf vnfd-id {
+ *         type leafref {
+ *           path ../../../../vnfd/id;
+ *         }
+ *       }
+ *       leaf flavour-id {
+ *         type leafref {
+ *           path deref(../vnfd-id)/../df/id;
+ *         }
+ *       }
+ *       leaf instantiation-level {
+ *         type leafref {
+ *           path deref(../flavour-id)/../instantiation-level/id;
+ *         }
+ *       }
+ *       leaf min-number-of-instances {
+ *         default 1;
+ *         type uint16;
+ *       }
+ *       leaf max-number-of-instances {
+ *         default 1;
+ *         type uint16;
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       list virtual-link-connectivity {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         list constituent-cpd-id {
+ *           key constituent-base-element-id;
+ *           leaf constituent-base-element-id {
+ *             type leafref {
+ *               path ../../../id;
+ *             }
+ *           }
+ *           leaf constituent-cpd-id {
+ *             type leafref {
+ *               path deref(../../../vnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list pnf-profile {
+ *       key id;
+ *       must boolean(../../pnfd-id[.=current()/pnfd-id]) {
+ *         error-message
+ *           "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *       }
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf pnfd-id {
+ *         type leafref {
+ *           path ../../../../pnfd/id;
+ *         }
+ *       }
+ *       list virtual-link-connectivity {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         list constituent-cpd-id {
+ *           key constituent-base-element-id;
+ *           leaf constituent-base-element-id {
+ *             type leafref {
+ *               path ../../../id;
+ *             }
+ *           }
+ *           leaf constituent-cpd-id {
+ *             type leafref {
+ *               path deref(../../../pnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-profile {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf virtual-link-desc-id {
+ *         type leafref {
+ *           path ../../../virtual-link-desc/id;
+ *         }
+ *       }
+ *       leaf flavour-id {
+ *         type leafref {
+ *           path deref(../virtual-link-desc-id)/../df/id;
+ *         }
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       container max-bitrate-requirements {
+ *         uses link-bitrate-requirements;
+ *       }
+ *       container min-bitrate-requirements {
+ *         uses link-bitrate-requirements;
+ *       }
+ *     }
+ *     list scaling-aspect {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       leaf scaling-level {
+ *         type leafref {
+ *           path ../../ns-instantiation-level/id;
+ *         }
+ *       }
+ *     }
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf type {
+ *         type affinity-type;
+ *       }
+ *       leaf scope {
+ *         type affinity-scope;
+ *       }
+ *     }
+ *     list ns-instantiation-level {
+ *       min-elements 1;
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       list vnf-to-level-mapping {
+ *         key vnf-profile-id;
+ *         leaf vnf-profile-id {
+ *           type leafref {
+ *             path ../../../vnf-profile/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           default 1;
+ *           type uint32;
+ *         }
+ *       }
+ *       list virtual-link-to-level-mapping {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         uses link-bitrate-requirements;
+ *       }
+ *       list ns-to-level-mapping {
+ *         key ns-profile-id;
+ *         leaf ns-profile-id {
+ *           type leafref {
+ *             path ../../../ns-profile/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           default 1;
+ *           type uint32;
+ *         }
+ *       }
+ *       must "(count(vnf-to-level-mapping) + count(virtual-link-to-level-mapping) + count(ns-to-level-mapping)) > 0" {
+ *         error-message
+ *           "At least one attribute between vnf-to-level-mapping, virtual-link-to-level-mapping and ns-to-level-mapping shall be present.";
+ *       }
+ *     }
+ *     leaf default-instantiation-level {
+ *       type leafref {
+ *         path ../ns-instantiation-level/id;
+ *       }
+ *     }
+ *     list ns-profile {
+ *       must "min-number-of-instances <= max-number-of-instances" {
+ *         error-message
+ *           "min-number-of-instances has to be less than or equalmax-number-of-instances.";
+ *       }
+ *       must boolean(../../nested-nsd-id[.=current()/nsd-id]) {
+ *         error-message
+ *           "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *       }
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf nsd-id {
+ *         type leafref {
+ *           path ../../../../nsd/id;
+ *         }
+ *       }
+ *       leaf ns-df-id {
+ *         type leafref {
+ *           path deref(../nsd-id)/../df/id;
+ *         }
+ *       }
+ *       leaf instantiation-level-id {
+ *         type leafref {
+ *           path deref(../ns-df-id)/../ns-instantiation-level/id;
+ *         }
+ *       }
+ *       leaf min-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *       }
+ *       leaf max-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *       }
+ *       list affinity-or-anti-affinity-group-id {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       list virtual-link-connectivity {
+ *         key virtual-link-profile-id;
+ *         leaf virtual-link-profile-id {
+ *           type leafref {
+ *             path ../../../virtual-link-profile/id;
+ *           }
+ *         }
+ *         list constituent-cpd-id {
+ *           key constituent-base-element-id;
+ *           leaf constituent-base-element-id {
+ *             type leafref {
+ *               path ../../../id;
+ *             }
+ *           }
+ *           leaf constituent-cpd-id {
+ *             type leafref {
+ *               path deref(../../../nsd-id)/../sapd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list dependencies {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       choice primary-id {
+ *         case primary-vnf-profile {
+ *           leaf primary-vnf-profile {
+ *             type leafref {
+ *               path ../../vnf-profile/vnfd-id;
+ *             }
+ *           }
+ *         }
+ *         case primary-ns-profile {
+ *           leaf primary-ns-profile {
+ *             type leafref {
+ *               path ../../ns-profile/nsd-id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       choice secondary-id {
+ *         case secondary-vnf-profile {
+ *           leaf secondary-vnf-profile {
+ *             type leafref {
+ *               path ../../vnf-profile/vnfd-id;
+ *             }
+ *           }
+ *         }
+ *         case secondary-ns-profile {
+ *           leaf secondary-ns-profile {
+ *             type leafref {
+ *               path ../../ns-profile/nsd-id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list monitored-info {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container vnf-indicator-info {
+ *         leaf vnfd-id {
+ *           type leafref {
+ *             path ../../../../../vnfd/id;
+ *           }
+ *         }
+ *         leaf vnf-indicator {
+ *           type leafref {
+ *             path deref(../vnfd-id)/../indicator/id;
+ *           }
+ *         }
+ *       }
+ *       container monitoring-parameter {
+ *         leaf id {
+ *           type string;
+ *         }
+ *         leaf name {
+ *           type string;
+ *         }
+ *         leaf performance-metric {
+ *           type string;
+ *         }
+ *         leaf collection-period {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   uses security-parameters;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd + * + */ +@JsonDeserialize(as = NsdImpl.class) +@JsonIgnoreProperties(value= {"virtualStorageDesc","extCpd","securityGroupRule","indicator","swImageDesc"}, ignoreUnknown = true) +public interface Nsd + extends + DataObject, + SecurityParameters +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nsd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this NSD information element. It Globally uniquely identifies an + * instance of the NSD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies the designer of the NSD. + * + * + * + * @return java.lang.String designer, or null if not present + */ + @Nullable String getDesigner(); + + /** + * Identifies the version of the NSD. + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * Provides the human readable name of the NSD. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Identifies an NSD in a version independent manner. This attribute is invariant + * across versions of the network service descriptor. + * + * + * + * @return java.lang.String invariantId, or null if not present + */ + @Nullable String getInvariantId(); + + /** + * References the NSD of a constituent nested NS. + * + * + * + * @return java.util.List nestedNsdId, or null if not present + */ + @Nullable List getNestedNsdId(); + + /** + * References the VNFD of a constituent VNF. + * + * + * + * @return java.util.List vnfdId, or null if not present + */ + @Nullable List getVnfdId(); + + /** + * References the PNFD of a constituent PNF. + * + * + * + * @return java.util.List pnfdId, or null if not present + */ + @Nullable List getPnfdId(); + + /** + * Provides the descriptor of a service access point of the network service. + * + * + * + * @return java.util.Map sapd, or null if not present + */ + @Nullable Map getSapd(); + + /** + * @return java.util.Map sapd, or an empty list if it is not present + */ + default @NonNull Map nonnullSapd() { + return CodeHelpers.nonnull(getSapd()); + } + + /** + * Provides the constituent VLDs. + * + * + * + * @return java.util.Map virtualLinkDesc, or null if not present + */ + @Nullable Map getVirtualLinkDesc(); + + /** + * @return java.util.Map virtualLinkDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkDesc() { + return CodeHelpers.nonnull(getVirtualLinkDesc()); + } + + /** + * Provides the descriptors of the applicable forwarding graphs. + * + * + * + * @return java.util.Map vnffgd, or null if not present + */ + @Nullable Map getVnffgd(); + + /** + * @return java.util.Map vnffgd, or an empty list if it is not present + */ + default @NonNull Map nonnullVnffgd() { + return CodeHelpers.nonnull(getVnffgd()); + } + + /** + * @return java.util.List autoscaleRule, or null if not present + */ + @Nullable List getAutoscaleRule(); + + /** + * @return java.util.Map lifecycleManagementScript, or null if not present + */ + @Nullable Map getLifecycleManagementScript(); + + /** + * @return java.util.Map lifecycleManagementScript, or an empty list if it is not present + */ + default @NonNull Map nonnullLifecycleManagementScript() { + return CodeHelpers.nonnull(getLifecycleManagementScript()); + } + + /** + * Identifies a DF within the scope of an NSD. + * + * + * + * @return java.util.Map df, or null if not present + */ + @Nullable Map getDf(); + + /** + * @return java.util.Map df, or an empty list if it is not present + */ + default @NonNull Map nonnullDf() { + return CodeHelpers.nonnull(getDf()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java new file mode 100644 index 0000000000000000000000000000000000000000..c1b8c17002d82f35e8c48548c18b707571973c94 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Odu2.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity odu2 {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/odu2 + * + */ +public interface Odu2 + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("odu2"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java new file mode 100644 index 0000000000000000000000000000000000000000..f3f7b5fe5bc52c6439805c12844dcc61d1c582d5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/OperateVnf.java @@ -0,0 +1,30 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation enables requesting to change the state of a VNF instance, + * including starting and stopping the VNF instance. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity operate-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/operate-vnf + * + */ +public interface OperateVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("operate-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java new file mode 100644 index 0000000000000000000000000000000000000000..adb94602df9bb842da60d973da2db587827ad871 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Pnfd.java @@ -0,0 +1,175 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.SecurityKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping pnfd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf function-description {
+ *     type string;
+ *   }
+ *   leaf provider {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   leaf invariant-id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   list ext-cpd {
+ *     key id;
+ *     uses cpd;
+ *   }
+ *   list security {
+ *     key signature;
+ *     uses security-parameters;
+ *   }
+ *   leaf geographical-location-info {
+ *     type string;
+ *   }
+ *   uses security-group-rule;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/pnfd + * + */ +public interface Pnfd + extends + DataObject, + SecurityGroupRule +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnfd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this Pnfd information element. It uniquely identifies the PNFD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Describes the PNF function. + * + * + * + * @return java.lang.String functionDescription, or null if not present + */ + @Nullable String getFunctionDescription(); + + /** + * Identifies the provider of the PNFD. + * + * + * + * @return java.lang.String provider, or null if not present + */ + @Nullable String getProvider(); + + /** + * Identifies the version of the PNFD. + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * Identifies a PNFD in a version independent manner. This attribute is invariant + * across versions of PNFD. + * + * + * + * @return java.lang.String invariantId, or null if not present + */ + @Nullable String getInvariantId(); + + /** + * Provides the human readable name of the PNFD. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Specifies the characteristics of one or more connection points where to connect + * the PNF to a VL. + * + * + * + * @return java.util.Map extCpd, or null if not present + */ + @Nullable Map getExtCpd(); + + /** + * @return java.util.Map extCpd, or an empty list if it is not present + */ + default @NonNull Map nonnullExtCpd() { + return CodeHelpers.nonnull(getExtCpd()); + } + + /** + * Provides a signature to prevent tampering. Editor's Note: While IFA014 does + * specify that the PNFD includes a security parameter. SOL001 does not have one. + * We need to harmonize SOL001 & SOL006 on this point. + * + * + * + * @return java.util.Map security, or null if not present + */ + @Nullable Map getSecurity(); + + /** + * @return java.util.Map security, or an empty list if it is not present + */ + default @NonNull Map nonnullSecurity() { + return CodeHelpers.nonnull(getSecurity()); + } + + /** + * It provides information about the geographical location (e.g. geographic + * coordinates or address of the building, etc.) of the PNF. The cardinality 0 is + * used when the location is unknown. Editor's Note: The type is TBD in SOL001. We + * need to make a common SOL001/SOL006 decision. + * + * + * + * @return java.lang.String geographicalLocationInfo, or null if not present + */ + @Nullable String getGeographicalLocationInfo(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java new file mode 100644 index 0000000000000000000000000000000000000000..cf1adcc3489e73ecf1774de8005564ee6698e88f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/PseudoWire.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity pseudo-wire {
+ *   base layer-protocol;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/pseudo-wire + * + */ +public interface PseudoWire + extends + LayerProtocol +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pseudo-wire"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java new file mode 100644 index 0000000000000000000000000000000000000000..2906f3ebf914c0250ea82bd11ef5b1c6f7f6eee9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/QueryVnf.java @@ -0,0 +1,31 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation provides information about VNF instances. The applicable VNF + * instances can be chosen based on filtering criteria, and the information can be + * restricted to selected attributes. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity query-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/query-vnf + * + */ +public interface QueryVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("query-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java new file mode 100644 index 0000000000000000000000000000000000000000..41738be15b6cd65e8ccc3d42adc4abf68164229e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ResourceHandle.java @@ -0,0 +1,58 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping resource-handle {
+ *   leaf vim-id {
+ *     type string;
+ *   }
+ *   leaf resource-provider-id {
+ *     type string;
+ *   }
+ *   leaf resource-id {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/resource-handle + * + */ +public interface ResourceHandle + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("resource-handle"); + + @Override + Class implementedInterface(); + + /** + * @return java.lang.String vimId, or null if not present + */ + @Nullable String getVimId(); + + /** + * @return java.lang.String resourceProviderId, or null if not present + */ + @Nullable String getResourceProviderId(); + + /** + * @return java.lang.String resourceId, or null if not present + */ + @Nullable String getResourceId(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java new file mode 100644 index 0000000000000000000000000000000000000000..c71ed85ef49246a6668935e55e87845e95e45fa0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Root.java @@ -0,0 +1,28 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity root {
+ *   base cp-role;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/root + * + */ +public interface Root + extends + CpRole +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("root"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java new file mode 100644 index 0000000000000000000000000000000000000000..4de09bcdef7937e819b9e403885ab4481f63d911 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/RootStorage.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Root type of storage. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity root-storage {
+ *   base storage-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/root-storage + * + */ +public interface RootStorage + extends + StorageType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("root-storage"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java new file mode 100644 index 0000000000000000000000000000000000000000..7ad35e4444c9d878ab049a873260fe61fcc695f4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnf.java @@ -0,0 +1,32 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation provides methods to request scaling a VNF in multiple ways: • + * horizontal scaling: - scale out: adding additional VNFC instances to the VNF to + * increase capacity - scale in: removing VNFC instances from the VNF, in order to + * release unused capacity + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity scale-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/scale-vnf + * + */ +public interface ScaleVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scale-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java new file mode 100644 index 0000000000000000000000000000000000000000..ba34b21cd7b5391a2fe1f99755834fdf6ebbfa14 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/ScaleVnfToLevel.java @@ -0,0 +1,34 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation scales an instantiated VNF of a particular DF to a target size. + * The target size is either expressed as an instantiation level of that DF as + * defined in the VNFD, or given as a list of scale levels, one per scaling aspect + * of that DF. Instantiation levels and scaling aspects are declared in the VNFD. + * Typically, the result of this operation is adding and/or removing Network + * Functions Virtualization Infrastructure (NFVI) resources to/from the VNF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity scale-vnf-to-level {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/scale-vnf-to-level + * + */ +public interface ScaleVnfToLevel + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scale-vnf-to-level"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java new file mode 100644 index 0000000000000000000000000000000000000000..032472d17cd22c7309af99fbde916d1190f68362 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityGroupRule.java @@ -0,0 +1,93 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping security-group-rule {
+ *   list security-group-rule {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf direction {
+ *       type enumeration {
+ *         enum ingress;
+ *         enum egress;
+ *       }
+ *       default ingress;
+ *     }
+ *     leaf ether-type {
+ *       type enumeration {
+ *         enum ipv4;
+ *         enum ipv6;
+ *       }
+ *       default ipv4;
+ *     }
+ *     leaf protocol {
+ *       type enumeration {
+ *         enum tcp;
+ *         enum udp;
+ *         enum icmp;
+ *       }
+ *       default tcp;
+ *     }
+ *     leaf port-range-min {
+ *       must ". <= ../port-range-max";
+ *       type uint16;
+ *       default 0;
+ *     }
+ *     leaf port-range-max {
+ *       must ". >= ../port-range-min";
+ *       type uint16;
+ *       default 65535;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/security-group-rule + * + */ +public interface SecurityGroupRule + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("security-group-rule"); + + @Override + Class implementedInterface(); + + /** + * Defines security group rules to be used by the VNF. + * + * + * + * @return java.util.Map securityGroupRule, or null if not present + */ + @Nullable Map getSecurityGroupRule(); + + /** + * @return java.util.Map securityGroupRule, or an empty list if it is not present + */ + default @NonNull Map nonnullSecurityGroupRule() { + return CodeHelpers.nonnull(getSecurityGroupRule()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java new file mode 100644 index 0000000000000000000000000000000000000000..eb41f0b0fd01d28efdfe3e6b1b4459c1c87836b5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SecurityParameters.java @@ -0,0 +1,71 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping security-parameters {
+ *   leaf signature {
+ *     type string;
+ *   }
+ *   leaf algorithm {
+ *     type string;
+ *   }
+ *   leaf certificate {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/security-parameters + * + */ +public interface SecurityParameters + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("security-parameters"); + + @Override + Class implementedInterface(); + + /** + * Provides the signature of the signed part of the descriptor. + * + * + * + * @return java.lang.String signature, or null if not present + */ + @Nullable String getSignature(); + + /** + * Identifies the algorithm used to compute the signature. + * + * + * + * @return java.lang.String algorithm, or null if not present + */ + @Nullable String getAlgorithm(); + + /** + * Provides a certificate or a reference to a certificate to validate the + * signature. + * + * + * + * @return java.lang.String certificate, or null if not present + */ + @Nullable String getCertificate(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java new file mode 100644 index 0000000000000000000000000000000000000000..772f35253f70f5ef4878de5b8f7ffa1de7f6a59d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha224.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-224. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-224 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-224 + * + */ +public interface Sha224 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-224"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java new file mode 100644 index 0000000000000000000000000000000000000000..4448189636aa23a60ff2c30d9335c75fc69c7a94 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha256.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-256. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-256 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-256 + * + */ +public interface Sha256 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-256"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java new file mode 100644 index 0000000000000000000000000000000000000000..b23be7adca21f05d33471cfa5795509797f42d1a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha384.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-384. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-384 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-384 + * + */ +public interface Sha384 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-384"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java new file mode 100644 index 0000000000000000000000000000000000000000..d467b05ac50d355709843360c09c50c24aba57b0 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Sha512.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * SHA-512. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity sha-512 {
+ *   base checksum-algorithm;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/sha-512 + * + */ +public interface Sha512 + extends + ChecksumAlgorithm +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sha-512"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java new file mode 100644 index 0000000000000000000000000000000000000000..84f87240511c3ff03fe192110c31cf80d37ee51c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/StorageType.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Base type of storage that identities can derive from. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity storage-type {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/storage-type + * + */ +public interface StorageType + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("storage-type"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java new file mode 100644 index 0000000000000000000000000000000000000000..47bdf88e3485069dae0d46fc227a9b3cb397a283 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SupportedOperation.java @@ -0,0 +1,31 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Indicates which operations are available for this DF via the VNF LCM interface. + * Instantiate VNF, Query VNF and Terminate VNF are supported in all DF and + * therefore need not be included in this list. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity supported-operation {
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/supported-operation + * + */ +public interface SupportedOperation + extends + BaseIdentity +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("supported-operation"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java new file mode 100644 index 0000000000000000000000000000000000000000..9c1be42cd9ad1efea71b26e11b024c21cbe9bbc9 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/SwapStorage.java @@ -0,0 +1,29 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Swap type of storage. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity swap-storage {
+ *   base storage-type;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/swap-storage + * + */ +public interface SwapStorage + extends + StorageType +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("swap-storage"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java new file mode 100644 index 0000000000000000000000000000000000000000..2919578b5993feba05c8ddac78df37de55165c21 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/TerminateVnf.java @@ -0,0 +1,35 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * This operation terminates a VNF. A VNF can be terminated gracefully or + * forcefully. Graceful termination means that the VNFM arranges to take the VNF + * out of service, e.g. by asking the VNF's EM to take the VNF out of service, and + * only after that shuts down the VNF and releases the resources. Forceful + * termination means that the VNFM immediately shuts down the VNF and releases the + * resources. A time interval can be specified for taking the VNF out of service, + * after which the VNF is shut down if taking it out of service has not completed. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * identity terminate-vnf {
+ *   base supported-operation;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/terminate-vnf + * + */ +public interface TerminateVnf + extends + SupportedOperation +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("terminate-vnf"); + + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java new file mode 100644 index 0000000000000000000000000000000000000000..fa3bbb353220ce8d80b91c0a0d783defb4e57f10 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/VirtualNetworkInterfaceRequirements.java @@ -0,0 +1,78 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirement; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.virtual.network._interface.requirements.VirtualNetworkInterfaceRequirementKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping virtual-network-interface-requirements {
+ *   list virtual-network-interface-requirement {
+ *     key name;
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf support-mandatory {
+ *       default false;
+ *       type boolean;
+ *     }
+ *     list network-interface-requirements {
+ *       key key;
+ *       min-elements 1;
+ *       max-elements 1;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/virtual-network-interface-requirements + * + */ +public interface VirtualNetworkInterfaceRequirements + extends + DataObject +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-network-interface-requirements"); + + @Override + Class implementedInterface(); + + /** + * Specifies requirements on a virtual network interface realising the CPs + * instantiated from this CPD. + * + * + * + * @return java.util.Map virtualNetworkInterfaceRequirement, or null if not present + */ + @Nullable Map getVirtualNetworkInterfaceRequirement(); + + /** + * @return java.util.Map virtualNetworkInterfaceRequirement, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualNetworkInterfaceRequirement() { + return CodeHelpers.nonnull(getVirtualNetworkInterfaceRequirement()); + } + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java new file mode 100644 index 0000000000000000000000000000000000000000..27db5c08c80446e628e7c0af6bc26057c6f67057 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/Vnfd.java @@ -0,0 +1,1328 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder.VnfdImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * grouping vnfd {
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf provider {
+ *     type string;
+ *   }
+ *   leaf product-name {
+ *     type string;
+ *   }
+ *   leaf software-version {
+ *     type string;
+ *   }
+ *   leaf version {
+ *     type string;
+ *   }
+ *   leaf product-info-name {
+ *     type string;
+ *   }
+ *   leaf product-info-description {
+ *     type string;
+ *   }
+ *   leaf-list vnfm-info {
+ *     type string;
+ *     min-elements 1;
+ *   }
+ *   leaf localization-language {
+ *     type string;
+ *   }
+ *   leaf default-localization-language {
+ *     when ../localization-language;
+ *     type string;
+ *   }
+ *   list vdu {
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list int-cpd {
+ *       key id;
+ *       min-elements 1;
+ *       leaf int-virtual-link-desc {
+ *         type leafref {
+ *           path ../../../int-virtual-link-desc/id;
+ *         }
+ *       }
+ *       leaf bitrate-requirement {
+ *         type uint64;
+ *         units Mbps;
+ *       }
+ *       uses virtual-network-interface-requirements;
+ *       leaf nicio-requirements {
+ *         type leafref {
+ *           path ../../../virtual-compute-desc/id;
+ *         }
+ *       }
+ *       leaf-list order {
+ *         type uint32;
+ *       }
+ *       uses cpd;
+ *       leaf security-group-rule-id {
+ *         type leafref {
+ *           path ../../../security-group-rule/id;
+ *         }
+ *       }
+ *     }
+ *     leaf virtual-compute-desc {
+ *       type leafref {
+ *         path ../../virtual-compute-desc/id;
+ *       }
+ *       must "../../virtual-compute-desc[id=current()]/virtual-memory/size >=../../sw-image-desc[id=current()/../sw-image-desc]/min-ram";
+ *     }
+ *     leaf-list virtual-storage-desc {
+ *       type leafref {
+ *         path ../../virtual-storage-desc/id;
+ *       }
+ *     }
+ *     list boot-order {
+ *       ordered-by user;
+ *       key key;
+ *       leaf key {
+ *         type uint32;
+ *       }
+ *       leaf value {
+ *         type leafref {
+ *           path ../../virtual-storage-desc;
+ *         }
+ *       }
+ *     }
+ *     leaf sw-image-desc {
+ *       type leafref {
+ *         path ../../sw-image-desc/id;
+ *       }
+ *     }
+ *     leaf-list nfvi-constraint {
+ *       type string;
+ *     }
+ *     list monitoring-parameter {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       uses monitoring-parameter;
+ *     }
+ *     list configurable-properties {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf boot-data {
+ *       type string;
+ *     }
+ *   }
+ *   list virtual-compute-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list logical-node {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       list requirement-detail {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     list request-additional-capability {
+ *       key name;
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf support-mandatory {
+ *         type boolean;
+ *       }
+ *       leaf min-version {
+ *         type string;
+ *       }
+ *       leaf preferred-version {
+ *         type string;
+ *       }
+ *       list target-performance-parameters {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     leaf compute-requirements {
+ *       type string;
+ *     }
+ *     container virtual-memory {
+ *       leaf size {
+ *         type decimal64 {
+ *           fraction-digits 1;
+ *           range 0..max;
+ *         }
+ *         units GB;
+ *         default 1;
+ *       }
+ *       leaf over-subscription-policy {
+ *         type string;
+ *       }
+ *       list vdu-mem-requirements {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       leaf numa-enabled {
+ *         type boolean;
+ *       }
+ *     }
+ *     container virtual-cpu {
+ *       leaf cpu-architecture {
+ *         type string;
+ *       }
+ *       leaf num-virtual-cpu {
+ *         type uint16 {
+ *           range 1..max;
+ *         }
+ *         default 1;
+ *       }
+ *       leaf clock {
+ *         type uint32;
+ *         units MHz;
+ *       }
+ *       leaf oversubscription-policy {
+ *         type string;
+ *       }
+ *       list vdu-cpu-requirements {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *       container pinning {
+ *         presence "Set to specify CPU pinning.";
+ *         leaf policy {
+ *           default dynamic;
+ *           type enumeration {
+ *             enum static;
+ *             enum dynamic;
+ *           }
+ *         }
+ *         list rule {
+ *           when "../policy = 'static'";
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-storage-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf type-of-storage {
+ *       default root-storage;
+ *       type identityref {
+ *         base storage-type;
+ *       }
+ *     }
+ *     leaf size-of-storage {
+ *       type uint64;
+ *       units GB;
+ *       default 0;
+ *     }
+ *     list vdu-storage-requirements {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *     leaf rdma-enabled {
+ *       type boolean;
+ *     }
+ *     leaf sw-image-desc {
+ *       type leafref {
+ *         path ../../sw-image-desc/id;
+ *       }
+ *       must "../size-of-storage >=../../sw-image-desc[id=current()]/min-disk";
+ *     }
+ *   }
+ *   list sw-image-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf version {
+ *       type string;
+ *     }
+ *     container checksum {
+ *       leaf algorithm {
+ *         type identityref {
+ *           base checksum-algorithm;
+ *         }
+ *       }
+ *       leaf hash {
+ *         type string;
+ *       }
+ *     }
+ *     leaf container-format {
+ *       default bare;
+ *       type enumeration {
+ *         enum aki {
+ *         }
+ *         enum ami {
+ *         }
+ *         enum ari {
+ *         }
+ *         enum bare {
+ *         }
+ *         enum docker {
+ *         }
+ *         enum ova {
+ *         }
+ *         enum ovf {
+ *         }
+ *       }
+ *     }
+ *     leaf disk-format {
+ *       default qcow2;
+ *       type enumeration {
+ *         enum aki {
+ *         }
+ *         enum ami {
+ *         }
+ *         enum ari {
+ *         }
+ *         enum iso {
+ *         }
+ *         enum qcow2 {
+ *         }
+ *         enum raw {
+ *         }
+ *         enum vdi {
+ *         }
+ *         enum vhd {
+ *         }
+ *         enum vhdx {
+ *         }
+ *         enum vmdk {
+ *         }
+ *       }
+ *     }
+ *     leaf min-disk {
+ *       type uint64;
+ *       units GB;
+ *     }
+ *     leaf min-ram {
+ *       type decimal64 {
+ *         fraction-digits 1;
+ *         range 0..max;
+ *       }
+ *       units GB;
+ *       default 0;
+ *     }
+ *     leaf size {
+ *       type uint64;
+ *       units GB;
+ *     }
+ *     leaf image {
+ *       default .;
+ *       type inet:uri;
+ *     }
+ *     leaf operating-system {
+ *       type string;
+ *     }
+ *     leaf-list supported-virtualization-environment {
+ *       type string;
+ *     }
+ *   }
+ *   list int-virtual-link-desc {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     list flavour {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       container qos {
+ *         presence "VL QoS parameters";
+ *         leaf latency {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-delay-variation {
+ *           type uint32;
+ *           units ms;
+ *         }
+ *         leaf packet-loss-ratio {
+ *           type decimal64 {
+ *             fraction-digits 2;
+ *             range 0..1.00;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     uses connectivity-type;
+ *     leaf-list test-access {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list monitoring-parameters {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       uses monitoring-parameter;
+ *     }
+ *   }
+ *   uses security-group-rule;
+ *   list ext-cpd {
+ *     key id;
+ *     min-elements 1;
+ *     choice cp-connection {
+ *       case int-virtual-link-desc {
+ *         leaf int-virtual-link-desc {
+ *           type leafref {
+ *             path ../../int-virtual-link-desc/id;
+ *           }
+ *         }
+ *       }
+ *       case int-cpd {
+ *         container int-cpd {
+ *           leaf vdu-id {
+ *             type leafref {
+ *               path ../../../vdu/id;
+ *             }
+ *           }
+ *           leaf cpd {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       case k8s-cluster-net {
+ *         leaf k8s-cluster-net {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     uses virtual-network-interface-requirements;
+ *     leaf nicio-requirements {
+ *       type leafref {
+ *         path ../../virtual-compute-desc/id;
+ *       }
+ *     }
+ *     uses cpd;
+ *     leaf security-group-rule-id {
+ *       type leafref {
+ *         path ../../security-group-rule/id;
+ *       }
+ *     }
+ *   }
+ *   list df {
+ *     must "default-instantiation-level or count(instantiation-level) = 1";
+ *     key id;
+ *     min-elements 1;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list vdu-profile {
+ *       key id;
+ *       min-elements 1;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../vdu/id;
+ *         }
+ *       }
+ *       leaf min-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *       }
+ *       leaf max-number-of-instances {
+ *         type uint16;
+ *         default 1;
+ *         must ". >= ../min-number-of-instances";
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-profile {
+ *       key "id flavour";
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../int-virtual-link-desc/id;
+ *         }
+ *       }
+ *       leaf flavour {
+ *         type leafref {
+ *           path ../../../flavour/id;
+ *         }
+ *       }
+ *       uses local-affinity-or-anti-affinity-rule;
+ *       list affinity-or-anti-affinity-group {
+ *         key id;
+ *         leaf id {
+ *           type leafref {
+ *             path ../../../affinity-or-anti-affinity-group/id;
+ *           }
+ *         }
+ *       }
+ *       container max-bit-rate-requirements {
+ *         leaf root {
+ *           type uint32;
+ *         }
+ *         leaf leaf {
+ *           type uint32;
+ *         }
+ *       }
+ *       container min-bit-rate-requirements {
+ *         leaf root {
+ *           type uint32;
+ *         }
+ *         leaf leaf {
+ *           type uint32;
+ *         }
+ *       }
+ *       container virtual-link-protocol-data {
+ *         leaf associated-layer-protocol {
+ *           type identityref {
+ *             base layer-protocol;
+ *           }
+ *         }
+ *         container l2-protocol-data {
+ *           when "(../associated-layer-protocol = 'Ethernet') or (../associated-layer-protocol = 'MPLS') or (../associated-layer-protocol = 'ODU2') or (../associated-layer-protocol = 'Pseudo-Wire')";
+ *           leaf name {
+ *             type string;
+ *           }
+ *           leaf network-type {
+ *             type enumeration {
+ *               enum flat;
+ *               enum vlan;
+ *               enum vxlan;
+ *               enum gre;
+ *             }
+ *           }
+ *           leaf vlan-transparent {
+ *             type boolean;
+ *           }
+ *           leaf mtu {
+ *             type uint16;
+ *           }
+ *         }
+ *         container l3-protocol-data {
+ *           when "(../associated-layer-protocol = 'IPv4') or (../associated-layer-protocol = 'IPv6')";
+ *           leaf name {
+ *             type string;
+ *           }
+ *           leaf ip-version {
+ *             type enumeration {
+ *               enum ipv4;
+ *               enum ipv6;
+ *             }
+ *             default ipv4;
+ *           }
+ *           leaf cidr {
+ *             type string;
+ *           }
+ *           leaf-list ip-allocation-pools {
+ *             type string;
+ *           }
+ *           leaf gateway-ip {
+ *             type inet:ip-address;
+ *           }
+ *           leaf dhcp-enabled {
+ *             type boolean;
+ *             default true;
+ *           }
+ *           leaf ipv6-address-mode {
+ *             when "../ip-version = 'ipv6'";
+ *             type enumeration {
+ *               enum slaac;
+ *               enum dhcpv6-stateful;
+ *               enum dhcpv6-stateless;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list instantiation-level {
+ *       key id;
+ *       min-elements 1;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       list vdu-level {
+ *         key vdu-id;
+ *         min-elements 1;
+ *         leaf vdu-id {
+ *           type leafref {
+ *             path ../../../../vdu/id;
+ *           }
+ *         }
+ *         leaf number-of-instances {
+ *           type uint16;
+ *           must ". <= ../../../../df/vdu-profile[id=current()/../vdu-id]/max-number-of-instances";
+ *           must ". >= ../../../../df/vdu-profile[id=current()/../vdu-id]/min-number-of-instances";
+ *           default 1;
+ *         }
+ *       }
+ *       list scaling-info {
+ *         key scaling-aspect-id;
+ *         leaf scaling-aspect-id {
+ *           type leafref {
+ *             path ../../../scaling-aspect/id;
+ *           }
+ *         }
+ *         leaf scale-level {
+ *           type uint32;
+ *         }
+ *       }
+ *     }
+ *     leaf default-instantiation-level {
+ *       type leafref {
+ *         path ../instantiation-level/id;
+ *       }
+ *     }
+ *     leaf-list supported-operation {
+ *       type identityref {
+ *         base supported-operation;
+ *       }
+ *     }
+ *     container lcm-operations-configuration {
+ *       container instantiate-vnf-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container scale-vnf-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *         leaf scaling-by-more-than-one-step-supported {
+ *           type boolean;
+ *           default false;
+ *         }
+ *       }
+ *       container scale-vnf-to-level-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *         leaf arbitrary-target-levels-supported {
+ *           type boolean;
+ *           default false;
+ *         }
+ *       }
+ *       container heal-vnf-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *         leaf-list cause {
+ *           type string;
+ *         }
+ *       }
+ *       container terminate-vnf-op-config {
+ *         leaf min-graceful-termination {
+ *           type yang:timeticks;
+ *           default 1;
+ *         }
+ *         leaf max-recommended-graceful-termination {
+ *           type yang:timeticks;
+ *         }
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container operate-vnf-op-config {
+ *         leaf min-graceful-stop-timeout {
+ *           type yang:timeticks;
+ *           default 1;
+ *         }
+ *         leaf max-recommended-graceful-stop-timeout {
+ *           type yang:timeticks;
+ *         }
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container change-vnf-flavour-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *       container change-ext-vnf-connectivity-op-config {
+ *         list parameter {
+ *           key key;
+ *           leaf key {
+ *             type string;
+ *           }
+ *           leaf value {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf type {
+ *         type affinity-type;
+ *       }
+ *       leaf scope {
+ *         type affinity-scope;
+ *       }
+ *     }
+ *     list indicator {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf indicator-value {
+ *         type string;
+ *       }
+ *       leaf source {
+ *         type enumeration {
+ *           enum vnf;
+ *           enum em;
+ *           enum both;
+ *         }
+ *       }
+ *     }
+ *     list supported-vnf-interfaces {
+ *       key name;
+ *       leaf name {
+ *         type enumeration {
+ *           enum vnf-configuration;
+ *           enum vnf-indicator;
+ *         }
+ *       }
+ *       leaf-list cpd-id {
+ *         type leafref {
+ *           path ../../../ext-cpd/id;
+ *         }
+ *       }
+ *       list interface-details {
+ *         key key;
+ *         leaf key {
+ *           type string;
+ *         }
+ *         leaf value {
+ *           type string;
+ *         }
+ *       }
+ *     }
+ *     list monitoring-parameter {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       uses monitoring-parameter;
+ *     }
+ *     list scaling-aspect {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf description {
+ *         type string;
+ *       }
+ *       leaf max-scale-level {
+ *         type uint32 {
+ *           range 1..max;
+ *         }
+ *       }
+ *       container aspect-delta-details {
+ *         list deltas {
+ *           key id;
+ *           min-elements 1;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           list vdu-delta {
+ *             key id;
+ *             leaf id {
+ *               type leafref {
+ *                 path ../../../../../../vdu/id;
+ *               }
+ *             }
+ *             leaf number-of-instances {
+ *               type uint32 {
+ *                 range 0..max;
+ *               }
+ *             }
+ *           }
+ *           list virtual-link-bit-rate-delta {
+ *             key id;
+ *             leaf id {
+ *               type string;
+ *             }
+ *             container bit-rate-requirements {
+ *               leaf root {
+ *                 type uint32;
+ *                 units bits/sec;
+ *               }
+ *               leaf leaf {
+ *                 type uint32;
+ *                 units bits/sec;
+ *               }
+ *             }
+ *           }
+ *         }
+ *         leaf step-deltas {
+ *           type leafref {
+ *             path ../deltas/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   container configurable-properties {
+ *     leaf is-auto-scalable-enabled {
+ *       type boolean;
+ *     }
+ *     leaf is-auto-heal-enabled {
+ *       type boolean;
+ *     }
+ *     list additional-configurable-property {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   container modifiable-attributes {
+ *     leaf-list extension {
+ *       type string;
+ *     }
+ *     leaf-list metadata {
+ *       type string;
+ *     }
+ *   }
+ *   list lifecycle-management-script {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf-list event {
+ *       type internal-lifecycle-management-script-event;
+ *     }
+ *     leaf-list lcm-transition-event {
+ *       type string;
+ *     }
+ *     leaf script {
+ *       type string;
+ *     }
+ *     leaf script-dsl {
+ *       type string;
+ *     }
+ *     list script-input {
+ *       key key;
+ *       leaf key {
+ *         type string;
+ *       }
+ *       leaf value {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ *   list element-group {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf-list vdu {
+ *       type leafref {
+ *         path ../../vdu/id;
+ *       }
+ *     }
+ *     leaf-list virtual-link-desc {
+ *       type leafref {
+ *         path ../../int-virtual-link-desc/id;
+ *       }
+ *     }
+ *   }
+ *   list indicator {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf-list indicator-value {
+ *       type string;
+ *     }
+ *     leaf source {
+ *       type enumeration {
+ *         enum vnf;
+ *         enum em;
+ *         enum both;
+ *       }
+ *     }
+ *   }
+ *   leaf-list auto-scale {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/vnfd + * + */ +@JsonDeserialize(as = VnfdImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface Vnfd + extends + DataObject, + SecurityGroupRule +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfd"); + + @Override + Class implementedInterface(); + + /** + * Identifier of this VNFD information element. This attribute shall be globally + * unique. The format will be defined in the data model specification phase. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Provider of the VNF and of the VNFD + * + * + * + * @return java.lang.String provider, or null if not present + */ + @Nullable String getProvider(); + + /** + * Name to identify the VNF Product. Invariant for the VNF Product lifetime. + * + * + * + * @return java.lang.String productName, or null if not present + */ + @Nullable String getProductName(); + + /** + * Software version of the VNF. This is changed when there is any change to the + * software that is included in the VNF Package + * + * + * + * @return java.lang.String softwareVersion, or null if not present + */ + @Nullable String getSoftwareVersion(); + + /** + * Identifies the version of the VNFD + * + * + * + * @return java.lang.String version, or null if not present + */ + @Nullable String getVersion(); + + /** + * Human readable name of the VNFD. Can change during the VNF Product lifetime. + * + * + * + * @return java.lang.String productInfoName, or null if not present + */ + @Nullable String getProductInfoName(); + + /** + * Human readable description of the VNFD. Can change during the VNF Product + * lifetime. + * + * + * + * @return java.lang.String productInfoDescription, or null if not present + */ + @Nullable String getProductInfoDescription(); + + /** + * Identifies VNFM(s) compatible with the VNF described in this version of the + * VNFD. + * + * + * + * @return java.util.List vnfmInfo, or null if not present + */ + @Nullable List getVnfmInfo(); + + /** + * Information about the language of the VNF. + * + * + * + * @return java.lang.String localizationLanguage, or null if not present + */ + @Nullable String getLocalizationLanguage(); + + /** + * Default localization language that is instantiated if no information about + * selected localization language is available. Shall be present if + * 'localization-language' is present and shall be absent otherwise. + * + * + * + * @return java.lang.String defaultLocalizationLanguage, or null if not present + */ + @Nullable String getDefaultLocalizationLanguage(); + + /** + * The Virtualisation Deployment Unit (VDU) is a construct supporting the + * description of the deployment and operational behaviour of a VNF component, or + * the entire VNF if it was not componentized in components. + * + * + * + * @return java.util.Map vdu, or null if not present + */ + @Nullable Map getVdu(); + + /** + * @return java.util.Map vdu, or an empty list if it is not present + */ + default @NonNull Map nonnullVdu() { + return CodeHelpers.nonnull(getVdu()); + } + + /** + * Defines descriptors of virtual compute resources to be used by the VNF. + * + * + * + * @return java.util.Map virtualComputeDesc, or null if not present + */ + @Nullable Map getVirtualComputeDesc(); + + /** + * @return java.util.Map virtualComputeDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualComputeDesc() { + return CodeHelpers.nonnull(getVirtualComputeDesc()); + } + + /** + * Storage requirements for a Virtual Storage instance attached to the VNFC created + * from this VDU + * + * + * + * @return java.util.Map virtualStorageDesc, or null if not present + */ + @Nullable Map getVirtualStorageDesc(); + + /** + * @return java.util.Map virtualStorageDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualStorageDesc() { + return CodeHelpers.nonnull(getVirtualStorageDesc()); + } + + /** + * Defines descriptors of software images to be used by the VNF. + * + * + * + * @return java.util.Map swImageDesc, or null if not present + */ + @Nullable Map getSwImageDesc(); + + /** + * @return java.util.Map swImageDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullSwImageDesc() { + return CodeHelpers.nonnull(getSwImageDesc()); + } + + /** + * Represents the type of network connectivity mandated by the VNF provider between + * two or more CPs which includes at least one internal CP. + * + * + * + * @return java.util.Map intVirtualLinkDesc, or null if not present + */ + @Nullable Map getIntVirtualLinkDesc(); + + /** + * @return java.util.Map intVirtualLinkDesc, or an empty list if it is not present + */ + default @NonNull Map nonnullIntVirtualLinkDesc() { + return CodeHelpers.nonnull(getIntVirtualLinkDesc()); + } + + /** + * Describes an external interface exposed by this VNF enabling connection with a + * Virual Link + * + * + * + * @return java.util.Map extCpd, or null if not present + */ + @Nullable Map getExtCpd(); + + /** + * @return java.util.Map extCpd, or an empty list if it is not present + */ + default @NonNull Map nonnullExtCpd() { + return CodeHelpers.nonnull(getExtCpd()); + } + + /** + * Describes a specific Deployment Flavour (DF) of a VNF with specific requirements + * for capacity and performance. + * + * + * + * @return java.util.Map df, or null if not present + */ + @Nullable Map getDf(); + + /** + * @return java.util.Map df, or an empty list if it is not present + */ + default @NonNull Map nonnullDf() { + return CodeHelpers.nonnull(getDf()); + } + + /** + * Describes the configurable properties of the VNF (e.g. related to auto scaling + * and auto healing). + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties configurableProperties, or null if not present + */ + @Nullable ConfigurableProperties getConfigurableProperties(); + + /** + * Describes the modifiable attributes of the VNF. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes modifiableAttributes, or null if not present + */ + @Nullable ModifiableAttributes getModifiableAttributes(); + + /** + * Includes a list of events and corresponding management scripts performed for the + * VNF. + * + * + * + * @return java.util.Map lifecycleManagementScript, or null if not present + */ + @Nullable Map getLifecycleManagementScript(); + + /** + * @return java.util.Map lifecycleManagementScript, or an empty list if it is not present + */ + default @NonNull Map nonnullLifecycleManagementScript() { + return CodeHelpers.nonnull(getLifecycleManagementScript()); + } + + /** + * Describes the associated elements of a VNFD for a certain purpose during VNF + * lifecycle management. + * + * + * + * @return java.util.Map elementGroup, or null if not present + */ + @Nullable Map getElementGroup(); + + /** + * @return java.util.Map elementGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullElementGroup() { + return CodeHelpers.nonnull(getElementGroup()); + } + + /** + * Declares the VNF indicators that are supported by this VNF. + * + * + * + * @return java.util.Map indicator, or null if not present + */ + @Nullable Map getIndicator(); + + /** + * @return java.util.Map indicator, or an empty list if it is not present + */ + default @NonNull Map nonnullIndicator() { + return CodeHelpers.nonnull(getIndicator()); + } + + /** + * Rule that determines when a scaling action needs to be triggered on a VNF + * instance e.g. based on certain VNF indicator values or VNF indicator value + * changes or a combination of VNF indicator value(s) and monitoring parameter(s). + * + * + * + * @return java.util.List autoScale, or null if not present + */ + @Nullable List getAutoScale(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java new file mode 100644 index 0000000000000000000000000000000000000000..6c04aa7807c48b7bd13200c77275e2502f58463c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityType.java @@ -0,0 +1,73 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type; +import java.lang.Class; +import java.lang.Override; +import java.util.List; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.FlowPattern; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container connectivity-type {
+ *   leaf-list layer-protocol {
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   leaf flow-pattern {
+ *     type flow-pattern;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/connectivity-type/connectivity-type + * + *

To create instances of this class use {@link ConnectivityTypeBuilder}. + * @see ConnectivityTypeBuilder + * + */ +public interface ConnectivityType + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("connectivity-type"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType.class; + } + + /** + * Identifies the protocols that the VL uses (Ethernet, MPLS, ODU2, IPV4, IPV6, + * Pseudo-Wire). The top layer protocol of the VL protocol stack shall always be + * provided. The lower layer protocols may be included when there are specific + * requirements on these layers. + * + * + * + * @return java.util.List layerProtocol, or null if not present + */ + @Nullable List> getLayerProtocol(); + + /** + * Identifies the flow pattern of the connectivity (Line, Tree, Mesh). + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.FlowPattern flowPattern, or null if not present + */ + @Nullable FlowPattern getFlowPattern(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..56e6d61653d194ab19a3d5dac178cb900d0950d7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/connectivity/type/ConnectivityTypeBuilder.java @@ -0,0 +1,253 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.FlowPattern; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ConnectivityTypeBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ConnectivityTypeBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ConnectivityTypeBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ConnectivityTypeBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ConnectivityTypeBuilder + * @see Builder + * + */ +public class ConnectivityTypeBuilder implements Builder { + + private FlowPattern _flowPattern; + private List> _layerProtocol; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ConnectivityTypeBuilder() { + } + + public ConnectivityTypeBuilder(ConnectivityType base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._flowPattern = base.getFlowPattern(); + this._layerProtocol = base.getLayerProtocol(); + } + + + public FlowPattern getFlowPattern() { + return _flowPattern; + } + + public List> getLayerProtocol() { + return _layerProtocol; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public ConnectivityTypeBuilder setFlowPattern(final FlowPattern value) { + this._flowPattern = value; + return this; + } + public ConnectivityTypeBuilder setLayerProtocol(final List> values) { + this._layerProtocol = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ConnectivityTypeBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ConnectivityTypeBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ConnectivityTypeBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ConnectivityTypeBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public ConnectivityType build() { + return new ConnectivityTypeImpl(this); + } + + private static final class ConnectivityTypeImpl + extends AbstractAugmentable + implements ConnectivityType { + + private final FlowPattern _flowPattern; + private final List> _layerProtocol; + + ConnectivityTypeImpl(ConnectivityTypeBuilder base) { + super(base.augmentation); + this._flowPattern = base.getFlowPattern(); + this._layerProtocol = base.getLayerProtocol(); + } + + @Override + public FlowPattern getFlowPattern() { + return _flowPattern; + } + + @Override + public List> getLayerProtocol() { + return _layerProtocol; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_flowPattern); + result = prime * result + Objects.hashCode(_layerProtocol); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!ConnectivityType.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + ConnectivityType other = (ConnectivityType)obj; + if (!Objects.equals(_flowPattern, other.getFlowPattern())) { + return false; + } + if (!Objects.equals(_layerProtocol, other.getLayerProtocol())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ConnectivityTypeImpl otherImpl = (ConnectivityTypeImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("ConnectivityType"); + CodeHelpers.appendValue(helper, "_flowPattern", _flowPattern); + CodeHelpers.appendValue(helper, "_layerProtocol", _layerProtocol); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java new file mode 100644 index 0000000000000000000000000000000000000000..a0e01e30d5a4a1896a59ca89aa3e6c1939f822dc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/Protocol.java @@ -0,0 +1,122 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd; +import java.lang.Class; +import java.lang.Override; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Cpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressDataKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Identifies the protocol layering information the CP uses for connectivity + * purposes and associated information. There shall be one cpProtocol for each + * layer protocol as indicated by the attribute layerProtocol. When a PnfExtCpd as + * defined in ETSI GS NFV-IFA 014 [i.8] is inherited from this Cpd, the + * is set to 0. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list protocol {
+ *   key associated-layer-protocol;
+ *   leaf associated-layer-protocol {
+ *     type identityref {
+ *       base layer-protocol;
+ *     }
+ *   }
+ *   list address-data {
+ *     key type;
+ *     leaf type {
+ *       type identityref {
+ *         base address-type;
+ *       }
+ *     }
+ *     container l2-address-data {
+ *       when "../type='mac-address'";
+ *       leaf mac-address-assignment {
+ *         type boolean;
+ *       }
+ *     }
+ *     container l3-address-data {
+ *       when "../type='ip-address'";
+ *       leaf ip-address-assignment {
+ *         type boolean;
+ *       }
+ *       leaf floating-ip-activated {
+ *         type boolean;
+ *       }
+ *       leaf ip-address-type {
+ *         type enumeration {
+ *           enum ipv4;
+ *           enum ipv6;
+ *         }
+ *       }
+ *       leaf number-of-ip-addresses {
+ *         type uint32;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol + * + *

To create instances of this class use {@link ProtocolBuilder}. + * @see ProtocolBuilder + * @see ProtocolKey + * + */ +public interface Protocol + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("protocol"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol.class; + } + + /** + * One of the values of the attribute layerProtocol of the Cpd IE. + * + * + * + * @return java.lang.Class associatedLayerProtocol, or null if not present + */ + @Nullable Class getAssociatedLayerProtocol(); + + /** + * Provides information on the addresses to be assigned to the CP(s) instantiated + * from the CPD. + * + * + * + * @return java.util.Map addressData, or null if not present + */ + @Nullable Map getAddressData(); + + /** + * @return java.util.Map addressData, or an empty list if it is not present + */ + default @NonNull Map nonnullAddressData() { + return CodeHelpers.nonnull(getAddressData()); + } + + @Override + ProtocolKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..3f666224891b31da8eee51c5ea1a940f27544c41 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolBuilder.java @@ -0,0 +1,292 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressDataKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ProtocolBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ProtocolBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ProtocolBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of ProtocolBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see ProtocolBuilder + * @see Builder + * + */ +public class ProtocolBuilder implements Builder { + + private Map _addressData; + private Class _associatedLayerProtocol; + private ProtocolKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public ProtocolBuilder() { + } + + public ProtocolBuilder(Protocol base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._associatedLayerProtocol = base.getAssociatedLayerProtocol(); + this._addressData = base.getAddressData(); + } + + + public ProtocolKey key() { + return key; + } + + public Map getAddressData() { + return _addressData; + } + + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public ProtocolBuilder withKey(final ProtocolKey key) { + this.key = key; + return this; + } + public ProtocolBuilder setAddressData(final Map values) { + this._addressData = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAddressData(Map)} instead. + */ + @Deprecated(forRemoval = true) + public ProtocolBuilder setAddressData(final List values) { + return setAddressData(CodeHelpers.compatMap(values)); + } + + public ProtocolBuilder setAssociatedLayerProtocol(final Class value) { + this._associatedLayerProtocol = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public ProtocolBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public ProtocolBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public ProtocolBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private ProtocolBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Protocol build() { + return new ProtocolImpl(this); + } + + private static final class ProtocolImpl + extends AbstractAugmentable + implements Protocol { + + private final Map _addressData; + private final Class _associatedLayerProtocol; + private final ProtocolKey key; + + ProtocolImpl(ProtocolBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new ProtocolKey(base.getAssociatedLayerProtocol()); + } + this._associatedLayerProtocol = key.getAssociatedLayerProtocol(); + this._addressData = CodeHelpers.emptyToNull(base.getAddressData()); + } + + @Override + public ProtocolKey key() { + return key; + } + + @Override + public Map getAddressData() { + return _addressData; + } + + @Override + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_addressData); + result = prime * result + Objects.hashCode(_associatedLayerProtocol); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Protocol.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Protocol other = (Protocol)obj; + if (!Objects.equals(_addressData, other.getAddressData())) { + return false; + } + if (!Objects.equals(_associatedLayerProtocol, other.getAssociatedLayerProtocol())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + ProtocolImpl otherImpl = (ProtocolImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Protocol"); + CodeHelpers.appendValue(helper, "_addressData", _addressData); + CodeHelpers.appendValue(helper, "_associatedLayerProtocol", _associatedLayerProtocol); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java new file mode 100644 index 0000000000000000000000000000000000000000..649a55fe586370a33c21cf9c68867fa904bbfc2f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/ProtocolKey.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.LayerProtocol; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class ProtocolKey + implements Identifier { + private static final long serialVersionUID = -7029882376556824581L; + private final Class _associatedLayerProtocol; + + + public ProtocolKey(Class _associatedLayerProtocol) { + + this._associatedLayerProtocol = _associatedLayerProtocol; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public ProtocolKey(ProtocolKey source) { + this._associatedLayerProtocol = source._associatedLayerProtocol; + } + + + public Class getAssociatedLayerProtocol() { + return _associatedLayerProtocol; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_associatedLayerProtocol); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof ProtocolKey)) { + return false; + } + final ProtocolKey other = (ProtocolKey) obj; + if (!Objects.equals(_associatedLayerProtocol, other._associatedLayerProtocol)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(ProtocolKey.class); + CodeHelpers.appendValue(helper, "_associatedLayerProtocol", _associatedLayerProtocol); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java new file mode 100644 index 0000000000000000000000000000000000000000..004e339974b964d22abbc04605b6d6770c09c678 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressData.java @@ -0,0 +1,111 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AddressType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.Protocol; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides information on the addresses to be assigned to the CP(s) instantiated + * from the CPD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list address-data {
+ *   key type;
+ *   leaf type {
+ *     type identityref {
+ *       base address-type;
+ *     }
+ *   }
+ *   container l2-address-data {
+ *     when "../type='mac-address'";
+ *     leaf mac-address-assignment {
+ *       type boolean;
+ *     }
+ *   }
+ *   container l3-address-data {
+ *     when "../type='ip-address'";
+ *     leaf ip-address-assignment {
+ *       type boolean;
+ *     }
+ *     leaf floating-ip-activated {
+ *       type boolean;
+ *     }
+ *     leaf ip-address-type {
+ *       type enumeration {
+ *         enum ipv4;
+ *         enum ipv6;
+ *       }
+ *     }
+ *     leaf number-of-ip-addresses {
+ *       type uint32;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol/address-data + * + *

To create instances of this class use {@link AddressDataBuilder}. + * @see AddressDataBuilder + * @see AddressDataKey + * + */ +public interface AddressData + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("address-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData.class; + } + + /** + * Describes the type of the address to be assigned to the CP instantiated from the + * parent CPD. Value: • MAC address. • IP address. • Etc. The content type shall be + * aligned with the address type supported by the layerProtocol attribute of the + * parent CPD. + * + * + * + * @return java.lang.Class type, or null if not present + */ + @Nullable Class getType(); + + /** + * Provides the information on the MAC addresses to be assigned to the CP(s) + * instantiated from the parent CPD. Shall be present when the addressType is MAC + * address. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData l2AddressData, or null if not present + */ + @Nullable L2AddressData getL2AddressData(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData l3AddressData, or null if not present + */ + @Nullable L3AddressData getL3AddressData(); + + @Override + AddressDataKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..82d5805b396e9fdd67a74c6047d92c4132ae6dc6 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataBuilder.java @@ -0,0 +1,297 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AddressType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AddressDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AddressDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AddressDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AddressDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AddressDataBuilder + * @see Builder + * + */ +public class AddressDataBuilder implements Builder { + + private L2AddressData _l2AddressData; + private L3AddressData _l3AddressData; + private Class _type; + private AddressDataKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AddressDataBuilder() { + } + + public AddressDataBuilder(AddressData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._type = base.getType(); + this._l2AddressData = base.getL2AddressData(); + this._l3AddressData = base.getL3AddressData(); + } + + + public AddressDataKey key() { + return key; + } + + public L2AddressData getL2AddressData() { + return _l2AddressData; + } + + public L3AddressData getL3AddressData() { + return _l3AddressData; + } + + public Class getType() { + return _type; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AddressDataBuilder withKey(final AddressDataKey key) { + this.key = key; + return this; + } + + public AddressDataBuilder setL2AddressData(final L2AddressData value) { + this._l2AddressData = value; + return this; + } + + public AddressDataBuilder setL3AddressData(final L3AddressData value) { + this._l3AddressData = value; + return this; + } + + public AddressDataBuilder setType(final Class value) { + this._type = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AddressDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AddressDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AddressDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AddressDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AddressData build() { + return new AddressDataImpl(this); + } + + private static final class AddressDataImpl + extends AbstractAugmentable + implements AddressData { + + private final L2AddressData _l2AddressData; + private final L3AddressData _l3AddressData; + private final Class _type; + private final AddressDataKey key; + + AddressDataImpl(AddressDataBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AddressDataKey(base.getType()); + } + this._type = key.getType(); + this._l2AddressData = base.getL2AddressData(); + this._l3AddressData = base.getL3AddressData(); + } + + @Override + public AddressDataKey key() { + return key; + } + + @Override + public L2AddressData getL2AddressData() { + return _l2AddressData; + } + + @Override + public L3AddressData getL3AddressData() { + return _l3AddressData; + } + + @Override + public Class getType() { + return _type; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_l2AddressData); + result = prime * result + Objects.hashCode(_l3AddressData); + result = prime * result + Objects.hashCode(_type); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AddressData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AddressData other = (AddressData)obj; + if (!Objects.equals(_l2AddressData, other.getL2AddressData())) { + return false; + } + if (!Objects.equals(_l3AddressData, other.getL3AddressData())) { + return false; + } + if (!Objects.equals(_type, other.getType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AddressDataImpl otherImpl = (AddressDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AddressData"); + CodeHelpers.appendValue(helper, "_l2AddressData", _l2AddressData); + CodeHelpers.appendValue(helper, "_l3AddressData", _l3AddressData); + CodeHelpers.appendValue(helper, "_type", _type); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java new file mode 100644 index 0000000000000000000000000000000000000000..67327afade9994ca562a18fcbf8a8e949ab390b3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/AddressDataKey.java @@ -0,0 +1,64 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AddressType; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AddressDataKey + implements Identifier { + private static final long serialVersionUID = 8153895744830229393L; + private final Class _type; + + + public AddressDataKey(Class _type) { + + this._type = _type; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AddressDataKey(AddressDataKey source) { + this._type = source._type; + } + + + public Class getType() { + return _type; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_type); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AddressDataKey)) { + return false; + } + final AddressDataKey other = (AddressDataKey) obj; + if (!Objects.equals(_type, other._type)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AddressDataKey.class); + CodeHelpers.appendValue(helper, "_type", _type); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java new file mode 100644 index 0000000000000000000000000000000000000000..d74bde367450f3b88adf13e774a0a5543c9097b2 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressData.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the information on the MAC addresses to be assigned to the CP(s) + * instantiated from the parent CPD. Shall be present when the addressType is MAC + * address. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container l2-address-data {
+ *   when "../type='mac-address'";
+ *   leaf mac-address-assignment {
+ *     type boolean;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol/address-data/l2-address-data + * + *

To create instances of this class use {@link L2AddressDataBuilder}. + * @see L2AddressDataBuilder + * + */ +public interface L2AddressData + extends + ChildOf, + Augmentable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l2-address-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L2AddressData.class; + } + + /** + * Specify if the MAC address assignment is the responsibility of management and + * orchestration function or not. If it is set to True, it is the management and + * orchestration function responsibility. If it is set to False, it will be + * provided by an external entity, e.g. OSS/BSS. + * + * + * + * @return java.lang.Boolean macAddressAssignment, or null if not present + */ + @Nullable Boolean isMacAddressAssignment(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..be279146fd45e848b489879ad89aea0cd4318887 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L2AddressDataBuilder.java @@ -0,0 +1,228 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link L2AddressDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L2AddressDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L2AddressDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L2AddressDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L2AddressDataBuilder + * @see Builder + * + */ +public class L2AddressDataBuilder implements Builder { + + private Boolean _macAddressAssignment; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L2AddressDataBuilder() { + } + + public L2AddressDataBuilder(L2AddressData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._macAddressAssignment = base.isMacAddressAssignment(); + } + + + public Boolean isMacAddressAssignment() { + return _macAddressAssignment; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L2AddressDataBuilder setMacAddressAssignment(final Boolean value) { + this._macAddressAssignment = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L2AddressDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L2AddressDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L2AddressDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L2AddressDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L2AddressData build() { + return new L2AddressDataImpl(this); + } + + private static final class L2AddressDataImpl + extends AbstractAugmentable + implements L2AddressData { + + private final Boolean _macAddressAssignment; + + L2AddressDataImpl(L2AddressDataBuilder base) { + super(base.augmentation); + this._macAddressAssignment = base.isMacAddressAssignment(); + } + + @Override + public Boolean isMacAddressAssignment() { + return _macAddressAssignment; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_macAddressAssignment); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L2AddressData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L2AddressData other = (L2AddressData)obj; + if (!Objects.equals(_macAddressAssignment, other.isMacAddressAssignment())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L2AddressDataImpl otherImpl = (L2AddressDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L2AddressData"); + CodeHelpers.appendValue(helper, "_macAddressAssignment", _macAddressAssignment); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java new file mode 100644 index 0000000000000000000000000000000000000000..64cf61e6508eb4bd504cb206479ba2fb6304aeae --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressData.java @@ -0,0 +1,168 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.AddressData; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * container l3-address-data {
+ *   when "../type='ip-address'";
+ *   leaf ip-address-assignment {
+ *     type boolean;
+ *   }
+ *   leaf floating-ip-activated {
+ *     type boolean;
+ *   }
+ *   leaf ip-address-type {
+ *     type enumeration {
+ *       enum ipv4;
+ *       enum ipv6;
+ *     }
+ *   }
+ *   leaf number-of-ip-addresses {
+ *     type uint32;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/cpd/protocol/address-data/l3-address-data + * + *

To create instances of this class use {@link L3AddressDataBuilder}. + * @see L3AddressDataBuilder + * + */ +public interface L3AddressData + extends + ChildOf, + Augmentable +{ + + + public enum IpAddressType implements Enumeration { + Ipv4(0, "ipv4"), + + Ipv6(1, "ipv6") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (IpAddressType enumItem : IpAddressType.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private IpAddressType(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding IpAddressType item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding IpAddressType item, or null if no such item exists + */ + public static IpAddressType forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("l3-address-data"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData.class; + } + + /** + * Specify if the address assignment is the responsibility of management and + * orchestration function or not. If it is set to True, it is the management and + * orchestration function responsibility. + * + * + * + * @return java.lang.Boolean ipAddressAssignment, or null if not present + */ + @Nullable Boolean isIpAddressAssignment(); + + /** + * Specify if the floating IP scheme is activated on the CP or not. + * + * + * + * @return java.lang.Boolean floatingIpActivated, or null if not present + */ + @Nullable Boolean isFloatingIpActivated(); + + /** + * Define address type. The address type should be aligned with the address type + * supported by the layerProtocol attribute of the parent VnfExtCpd. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data.L3AddressData.IpAddressType ipAddressType, or null if not present + */ + @Nullable IpAddressType getIpAddressType(); + + /** + * Minimum number of IP addresses to be assigned based on this L3AddressData + * information element. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint32 numberOfIpAddresses, or null if not present + */ + @Nullable Uint32 getNumberOfIpAddresses(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..cad02438713756f27c435586569385ff513646bf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/cpd/protocol/address/data/L3AddressDataBuilder.java @@ -0,0 +1,311 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.cpd.protocol.address.data; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Long; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint32; + +/** + * Class that builds {@link L3AddressDataBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     L3AddressDataBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new L3AddressDataBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of L3AddressDataBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see L3AddressDataBuilder + * @see Builder + * + */ +public class L3AddressDataBuilder implements Builder { + + private L3AddressData.IpAddressType _ipAddressType; + private Uint32 _numberOfIpAddresses; + private Boolean _floatingIpActivated; + private Boolean _ipAddressAssignment; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public L3AddressDataBuilder() { + } + + public L3AddressDataBuilder(L3AddressData base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this._ipAddressType = base.getIpAddressType(); + this._numberOfIpAddresses = base.getNumberOfIpAddresses(); + this._floatingIpActivated = base.isFloatingIpActivated(); + this._ipAddressAssignment = base.isIpAddressAssignment(); + } + + + public L3AddressData.IpAddressType getIpAddressType() { + return _ipAddressType; + } + + public Uint32 getNumberOfIpAddresses() { + return _numberOfIpAddresses; + } + + public Boolean isFloatingIpActivated() { + return _floatingIpActivated; + } + + public Boolean isIpAddressAssignment() { + return _ipAddressAssignment; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + + public L3AddressDataBuilder setIpAddressType(final L3AddressData.IpAddressType value) { + this._ipAddressType = value; + return this; + } + + public L3AddressDataBuilder setNumberOfIpAddresses(final Uint32 value) { + this._numberOfIpAddresses = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setNumberOfIpAddresses(Uint32)} instead. + */ + @Deprecated(forRemoval = true) + public L3AddressDataBuilder setNumberOfIpAddresses(final Long value) { + return setNumberOfIpAddresses(CodeHelpers.compatUint(value)); + } + + public L3AddressDataBuilder setFloatingIpActivated(final Boolean value) { + this._floatingIpActivated = value; + return this; + } + + public L3AddressDataBuilder setIpAddressAssignment(final Boolean value) { + this._ipAddressAssignment = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public L3AddressDataBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public L3AddressDataBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public L3AddressDataBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private L3AddressDataBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public L3AddressData build() { + return new L3AddressDataImpl(this); + } + + private static final class L3AddressDataImpl + extends AbstractAugmentable + implements L3AddressData { + + private final L3AddressData.IpAddressType _ipAddressType; + private final Uint32 _numberOfIpAddresses; + private final Boolean _floatingIpActivated; + private final Boolean _ipAddressAssignment; + + L3AddressDataImpl(L3AddressDataBuilder base) { + super(base.augmentation); + this._ipAddressType = base.getIpAddressType(); + this._numberOfIpAddresses = base.getNumberOfIpAddresses(); + this._floatingIpActivated = base.isFloatingIpActivated(); + this._ipAddressAssignment = base.isIpAddressAssignment(); + } + + @Override + public L3AddressData.IpAddressType getIpAddressType() { + return _ipAddressType; + } + + @Override + public Uint32 getNumberOfIpAddresses() { + return _numberOfIpAddresses; + } + + @Override + public Boolean isFloatingIpActivated() { + return _floatingIpActivated; + } + + @Override + public Boolean isIpAddressAssignment() { + return _ipAddressAssignment; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_ipAddressType); + result = prime * result + Objects.hashCode(_numberOfIpAddresses); + result = prime * result + Objects.hashCode(_floatingIpActivated); + result = prime * result + Objects.hashCode(_ipAddressAssignment); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!L3AddressData.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + L3AddressData other = (L3AddressData)obj; + if (!Objects.equals(_ipAddressType, other.getIpAddressType())) { + return false; + } + if (!Objects.equals(_numberOfIpAddresses, other.getNumberOfIpAddresses())) { + return false; + } + if (!Objects.equals(_floatingIpActivated, other.isFloatingIpActivated())) { + return false; + } + if (!Objects.equals(_ipAddressAssignment, other.isIpAddressAssignment())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + L3AddressDataImpl otherImpl = (L3AddressDataImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("L3AddressData"); + CodeHelpers.appendValue(helper, "_ipAddressType", _ipAddressType); + CodeHelpers.appendValue(helper, "_numberOfIpAddresses", _numberOfIpAddresses); + CodeHelpers.appendValue(helper, "_floatingIpActivated", _floatingIpActivated); + CodeHelpers.appendValue(helper, "_ipAddressAssignment", _ipAddressAssignment); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java new file mode 100644 index 0000000000000000000000000000000000000000..a2f27c7c6ca37bd4f03c007afe61a3835f5cbcaa --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRule.java @@ -0,0 +1,75 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list local-affinity-or-anti-affinity-rule {
+ *   key "affinity-type affinity-scope";
+ *   leaf affinity-type {
+ *     type affinity-type;
+ *   }
+ *   leaf affinity-scope {
+ *     type affinity-scope;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/local-affinity-or-anti-affinity-rule/local-affinity-or-anti-affinity-rule + * + *

To create instances of this class use {@link LocalAffinityOrAntiAffinityRuleBuilder}. + * @see LocalAffinityOrAntiAffinityRuleBuilder + * @see LocalAffinityOrAntiAffinityRuleKey + * + */ +public interface LocalAffinityOrAntiAffinityRule + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("local-affinity-or-anti-affinity-rule"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule.LocalAffinityOrAntiAffinityRule.class; + } + + /** + * Specifies whether the rule is an affinity rule or an anti-affinity rule. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType affinityType, or null if not present + */ + @Nullable AffinityType getAffinityType(); + + /** + * Specifies the scope of the rule, possible values are 'NFVI-PoP', 'Zone', + * 'ZoneGroup', 'NFVI-node'. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope affinityScope, or null if not present + */ + @Nullable AffinityScope getAffinityScope(); + + @Override + LocalAffinityOrAntiAffinityRuleKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..66b71c1f66379405e9c7a32880d481574cb0a9bc --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleBuilder.java @@ -0,0 +1,276 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LocalAffinityOrAntiAffinityRuleBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LocalAffinityOrAntiAffinityRuleBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LocalAffinityOrAntiAffinityRuleBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LocalAffinityOrAntiAffinityRuleBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LocalAffinityOrAntiAffinityRuleBuilder + * @see Builder + * + */ +public class LocalAffinityOrAntiAffinityRuleBuilder implements Builder { + + private AffinityScope _affinityScope; + private AffinityType _affinityType; + private LocalAffinityOrAntiAffinityRuleKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LocalAffinityOrAntiAffinityRuleBuilder() { + } + + public LocalAffinityOrAntiAffinityRuleBuilder(LocalAffinityOrAntiAffinityRule base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._affinityScope = base.getAffinityScope(); + this._affinityType = base.getAffinityType(); + } + + + public LocalAffinityOrAntiAffinityRuleKey key() { + return key; + } + + public AffinityScope getAffinityScope() { + return _affinityScope; + } + + public AffinityType getAffinityType() { + return _affinityType; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public LocalAffinityOrAntiAffinityRuleBuilder withKey(final LocalAffinityOrAntiAffinityRuleKey key) { + this.key = key; + return this; + } + + public LocalAffinityOrAntiAffinityRuleBuilder setAffinityScope(final AffinityScope value) { + this._affinityScope = value; + return this; + } + + public LocalAffinityOrAntiAffinityRuleBuilder setAffinityType(final AffinityType value) { + this._affinityType = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LocalAffinityOrAntiAffinityRuleBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LocalAffinityOrAntiAffinityRuleBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LocalAffinityOrAntiAffinityRuleBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LocalAffinityOrAntiAffinityRuleBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LocalAffinityOrAntiAffinityRule build() { + return new LocalAffinityOrAntiAffinityRuleImpl(this); + } + + private static final class LocalAffinityOrAntiAffinityRuleImpl + extends AbstractAugmentable + implements LocalAffinityOrAntiAffinityRule { + + private final AffinityScope _affinityScope; + private final AffinityType _affinityType; + private final LocalAffinityOrAntiAffinityRuleKey key; + + LocalAffinityOrAntiAffinityRuleImpl(LocalAffinityOrAntiAffinityRuleBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new LocalAffinityOrAntiAffinityRuleKey(base.getAffinityScope(), base.getAffinityType()); + } + this._affinityScope = key.getAffinityScope(); + this._affinityType = key.getAffinityType(); + } + + public LocalAffinityOrAntiAffinityRuleImpl() { + this( new LocalAffinityOrAntiAffinityRuleBuilder()); + } + @Override + public LocalAffinityOrAntiAffinityRuleKey key() { + return key; + } + + @Override + public AffinityScope getAffinityScope() { + return _affinityScope; + } + + @Override + public AffinityType getAffinityType() { + return _affinityType; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityScope); + result = prime * result + Objects.hashCode(_affinityType); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LocalAffinityOrAntiAffinityRule.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LocalAffinityOrAntiAffinityRule other = (LocalAffinityOrAntiAffinityRule)obj; + if (!Objects.equals(_affinityScope, other.getAffinityScope())) { + return false; + } + if (!Objects.equals(_affinityType, other.getAffinityType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LocalAffinityOrAntiAffinityRuleImpl otherImpl = (LocalAffinityOrAntiAffinityRuleImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LocalAffinityOrAntiAffinityRule"); + CodeHelpers.appendValue(helper, "_affinityScope", _affinityScope); + CodeHelpers.appendValue(helper, "_affinityType", _affinityType); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java new file mode 100644 index 0000000000000000000000000000000000000000..a61afd7906f38b9ea03f5999c01c7256e7537f42 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/local/affinity/or/anti/affinity/rule/LocalAffinityOrAntiAffinityRuleKey.java @@ -0,0 +1,94 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.local.affinity.or.anti.affinity.rule; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.KeyDeserializer; +import com.google.common.base.MoreObjects; + +import java.io.IOException; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class LocalAffinityOrAntiAffinityRuleKey extends KeyDeserializer + implements Identifier { + private static final long serialVersionUID = -2457432228320345751L; + private final AffinityType _affinityType; + private final AffinityScope _affinityScope; + + + public LocalAffinityOrAntiAffinityRuleKey() { + this._affinityType = null; + this._affinityScope = null; + } + + public LocalAffinityOrAntiAffinityRuleKey(AffinityScope _affinityScope, AffinityType _affinityType) { + + this._affinityType = _affinityType; + this._affinityScope = _affinityScope; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public LocalAffinityOrAntiAffinityRuleKey(LocalAffinityOrAntiAffinityRuleKey source) { + this._affinityType = source._affinityType; + this._affinityScope = source._affinityScope; + } + + + public AffinityType getAffinityType() { + return _affinityType; + } + + public AffinityScope getAffinityScope() { + return _affinityScope; + } + + + @Override + public int hashCode() { + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityType); + result = prime * result + Objects.hashCode(_affinityScope); + return result; + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LocalAffinityOrAntiAffinityRuleKey)) { + return false; + } + final LocalAffinityOrAntiAffinityRuleKey other = (LocalAffinityOrAntiAffinityRuleKey) obj; + if (!Objects.equals(_affinityType, other._affinityType)) { + return false; + } + if (!Objects.equals(_affinityScope, other._affinityScope)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(LocalAffinityOrAntiAffinityRuleKey.class); + CodeHelpers.appendValue(helper, "_affinityType", _affinityType); + CodeHelpers.appendValue(helper, "_affinityScope", _affinityScope); + return helper.toString(); + } + + @Override + public Object deserializeKey(String key, DeserializationContext ctxt) throws IOException { + // TODO Auto-generated method stub + return this.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java new file mode 100644 index 0000000000000000000000000000000000000000..215f675498d4186e04700732706c2518ce2187eb --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Nsd.java @@ -0,0 +1,52 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The NSD information element is a deployment template whose instances are used + * the NFVO for the lifecycle management of NSs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list nsd {
+ *   key id;
+ *   uses nsd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv/nsd + * + *

To create instances of this class use {@link NsdBuilder}. + * @see NsdBuilder + * @see NsdKey + * + */ +public interface Nsd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("nsd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Nsd.class; + } + + @Override + NsdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..82b08f0712326be7148c3923bbe911ff3c0ba844 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdBuilder.java @@ -0,0 +1,790 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.SapdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VnffgdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsdBuilder + * @see Builder + * + */ +public class NsdBuilder implements Builder { + + private String _algorithm; + private List _autoscaleRule; + private String _certificate; + private String _designer; + private Map _df; + private String _id; + private String _invariantId; + private Map _lifecycleManagementScript; + private String _name; + private List _nestedNsdId; + private List _pnfdId; + private Map _sapd; + private String _signature; + private String _version; + private Map _virtualLinkDesc; + private List _vnfdId; + private Map _vnffgd; + private NsdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsdBuilder() { + } + public NsdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd arg) { + this._id = arg.getId(); + this._designer = arg.getDesigner(); + this._version = arg.getVersion(); + this._name = arg.getName(); + this._invariantId = arg.getInvariantId(); + this._nestedNsdId = arg.getNestedNsdId(); + this._vnfdId = arg.getVnfdId(); + this._pnfdId = arg.getPnfdId(); + this._sapd = arg.getSapd(); + this._virtualLinkDesc = arg.getVirtualLinkDesc(); + this._vnffgd = arg.getVnffgd(); + this._autoscaleRule = arg.getAutoscaleRule(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._df = arg.getDf(); + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + public NsdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters arg) { + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + + public NsdBuilder(Nsd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._algorithm = base.getAlgorithm(); + this._autoscaleRule = base.getAutoscaleRule(); + this._certificate = base.getCertificate(); + this._designer = base.getDesigner(); + this._df = base.getDf(); + this._invariantId = base.getInvariantId(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._name = base.getName(); + this._nestedNsdId = base.getNestedNsdId(); + this._pnfdId = base.getPnfdId(); + this._sapd = base.getSapd(); + this._signature = base.getSignature(); + this._version = base.getVersion(); + this._virtualLinkDesc = base.getVirtualLinkDesc(); + this._vnfdId = base.getVnfdId(); + this._vnffgd = base.getVnffgd(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getId(); + this._designer = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getDesigner(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVersion(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getName(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getInvariantId(); + this._nestedNsdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getNestedNsdId(); + this._vnfdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVnfdId(); + this._pnfdId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getPnfdId(); + this._sapd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getSapd(); + this._virtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVirtualLinkDesc(); + this._vnffgd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getVnffgd(); + this._autoscaleRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getAutoscaleRule(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getLifecycleManagementScript(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd)arg).getDf(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters) { + this._signature = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getSignature(); + this._algorithm = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getAlgorithm(); + this._certificate = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getCertificate(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters]"); + } + + public NsdKey key() { + return key; + } + + public String getAlgorithm() { + return _algorithm; + } + + public List getAutoscaleRule() { + return _autoscaleRule; + } + + public String getCertificate() { + return _certificate; + } + + public String getDesigner() { + return _designer; + } + + public Map getDf() { + return _df; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getName() { + return _name; + } + + public List getNestedNsdId() { + return _nestedNsdId; + } + + public List getPnfdId() { + return _pnfdId; + } + + public Map getSapd() { + return _sapd; + } + + public String getSignature() { + return _signature; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + public List getVnfdId() { + return _vnfdId; + } + + public Map getVnffgd() { + return _vnffgd; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsdBuilder withKey(final NsdKey key) { + this.key = key; + return this; + } + + public NsdBuilder setAlgorithm(final String value) { + this._algorithm = value; + return this; + } + public NsdBuilder setAutoscaleRule(final List values) { + this._autoscaleRule = values; + return this; + } + + + public NsdBuilder setCertificate(final String value) { + this._certificate = value; + return this; + } + + public NsdBuilder setDesigner(final String value) { + this._designer = value; + return this; + } + public NsdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public NsdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setId(final String value) { + this._id = value; + return this; + } + + public NsdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + public NsdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public NsdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setName(final String value) { + this._name = value; + return this; + } + public NsdBuilder setNestedNsdId(final List values) { + this._nestedNsdId = values; + return this; + } + + public NsdBuilder setPnfdId(final List values) { + this._pnfdId = values; + return this; + } + + public NsdBuilder setSapd(final Map values) { + this._sapd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSapd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setSapd(final List values) { + return setSapd(CodeHelpers.compatMap(values)); + } + + public NsdBuilder setSignature(final String value) { + this._signature = value; + return this; + } + + public NsdBuilder setVersion(final String value) { + this._version = value; + return this; + } + public NsdBuilder setVirtualLinkDesc(final Map values) { + this._virtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVirtualLinkDesc(final List values) { + return setVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public NsdBuilder setVnfdId(final List values) { + this._vnfdId = values; + return this; + } + + public NsdBuilder setVnffgd(final Map values) { + this._vnffgd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnffgd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder setVnffgd(final List values) { + return setVnffgd(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Nsd build() { + return new NsdImpl(this); + } + + public static final class NsdImpl + extends AbstractAugmentable + implements Nsd { + + private final String _algorithm; + private final List _autoscaleRule; + private final String _certificate; + private final String _designer; + private Map _df; + @JsonProperty("id") + private final String _id; + @JsonProperty("_id") + private final String _invariantId; + private final Map _lifecycleManagementScript; + @JsonProperty("name") + private final String _name; + private final List _nestedNsdId; + private final List _pnfdId; + private final Map _sapd; + private final String _signature; + @JsonProperty("version") + private final String _version; + private final Map _virtualLinkDesc; + @JsonProperty("vnfd-id") + private final List _vnfdId; + private final Map _vnffgd; + private final NsdKey key; + + NsdImpl(NsdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsdKey(base.getId()); + } + this._id = key.getId(); + this._algorithm = base.getAlgorithm(); + this._autoscaleRule = base.getAutoscaleRule(); + this._certificate = base.getCertificate(); + this._designer = base.getDesigner(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._invariantId = base.getInvariantId(); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._name = base.getName(); + this._nestedNsdId = base.getNestedNsdId(); + this._pnfdId = base.getPnfdId(); + this._sapd = CodeHelpers.emptyToNull(base.getSapd()); + this._signature = base.getSignature(); + this._version = base.getVersion(); + this._virtualLinkDesc = CodeHelpers.emptyToNull(base.getVirtualLinkDesc()); + this._vnfdId = base.getVnfdId(); + this._vnffgd = CodeHelpers.emptyToNull(base.getVnffgd()); + } + + public NsdImpl(){ + this( new NsdBuilder() ); + } + + @Override + public NsdKey key() { + return key; + } + + @Override + public String getAlgorithm() { + return _algorithm; + } + + @Override + public List getAutoscaleRule() { + return _autoscaleRule; + } + + @Override + public String getCertificate() { + return _certificate; + } + + @Override + public String getDesigner() { + return _designer; + } + + public Map setDf(final List values) { + return _df = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getName() { + return _name; + } + + @Override + public List getNestedNsdId() { + return _nestedNsdId; + } + + @Override + public List getPnfdId() { + return _pnfdId; + } + + @Override + public Map getSapd() { + return _sapd; + } + + @Override + public String getSignature() { + return _signature; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualLinkDesc() { + return _virtualLinkDesc; + } + + @Override + public List getVnfdId() { + return _vnfdId; + } + + @Override + public Map getVnffgd() { + return _vnffgd; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_autoscaleRule); + result = prime * result + Objects.hashCode(_certificate); + result = prime * result + Objects.hashCode(_designer); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_nestedNsdId); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(_sapd); + result = prime * result + Objects.hashCode(_signature); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualLinkDesc); + result = prime * result + Objects.hashCode(_vnfdId); + result = prime * result + Objects.hashCode(_vnffgd); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Nsd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Nsd other = (Nsd)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_autoscaleRule, other.getAutoscaleRule())) { + return false; + } + if (!Objects.equals(_certificate, other.getCertificate())) { + return false; + } + if (!Objects.equals(_designer, other.getDesigner())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_nestedNsdId, other.getNestedNsdId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (!Objects.equals(_sapd, other.getSapd())) { + return false; + } + if (!Objects.equals(_signature, other.getSignature())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualLinkDesc, other.getVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_vnfdId, other.getVnfdId())) { + return false; + } + if (!Objects.equals(_vnffgd, other.getVnffgd())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsdImpl otherImpl = (NsdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Nsd"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_autoscaleRule", _autoscaleRule); + CodeHelpers.appendValue(helper, "_certificate", _certificate); + CodeHelpers.appendValue(helper, "_designer", _designer); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_nestedNsdId", _nestedNsdId); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "_sapd", _sapd); + CodeHelpers.appendValue(helper, "_signature", _signature); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualLinkDesc", _virtualLinkDesc); + CodeHelpers.appendValue(helper, "_vnfdId", _vnfdId); + CodeHelpers.appendValue(helper, "_vnffgd", _vnffgd); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java new file mode 100644 index 0000000000000000000000000000000000000000..06a1f066ceb03506a4e349228f5ed7db30ade045 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/NsdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsdKey + implements Identifier { + private static final long serialVersionUID = 8060294317279421094L; + private final String _id; + + + public NsdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsdKey(NsdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsdKey)) { + return false; + } + final NsdKey other = (NsdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java new file mode 100644 index 0000000000000000000000000000000000000000..9cb3d8a7d756cb01b3a34ed7e3907a66314ff03e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Pnfd.java @@ -0,0 +1,52 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The Pnfd information element is a deployment template enabling on-boarding PNFs + * and referencing them from an NSD. It focuses on connectivity aspects only. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list pnfd {
+ *   key id;
+ *   uses pnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv/pnfd + * + *

To create instances of this class use {@link PnfdBuilder}. + * @see PnfdBuilder + * @see PnfdKey + * + */ +public interface Pnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Pnfd.class; + } + + @Override + PnfdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..ed925be5a9e70489d220b915c40941893911f135 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdBuilder.java @@ -0,0 +1,561 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.Security; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.pnfd.SecurityKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfdBuilder + * @see Builder + * + */ +public class PnfdBuilder implements Builder { + + private Map _extCpd; + private String _functionDescription; + private String _geographicalLocationInfo; + private String _id; + private String _invariantId; + private String _name; + private String _provider; + private Map _security; + private Map _securityGroupRule; + private String _version; + private PnfdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfdBuilder() { + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd arg) { + this._id = arg.getId(); + this._functionDescription = arg.getFunctionDescription(); + this._provider = arg.getProvider(); + this._version = arg.getVersion(); + this._invariantId = arg.getInvariantId(); + this._name = arg.getName(); + this._extCpd = arg.getExtCpd(); + this._security = arg.getSecurity(); + this._geographicalLocationInfo = arg.getGeographicalLocationInfo(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public PnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public PnfdBuilder(Pnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._extCpd = base.getExtCpd(); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = base.getSecurity(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._version = base.getVersion(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getId(); + this._functionDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getFunctionDescription(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getProvider(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getVersion(); + this._invariantId = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getInvariantId(); + this._name = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getName(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getExtCpd(); + this._security = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getSecurity(); + this._geographicalLocationInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd)arg).getGeographicalLocationInfo(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Pnfd]"); + } + + public PnfdKey key() { + return key; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getFunctionDescription() { + return _functionDescription; + } + + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + public String getId() { + return _id; + } + + public String getInvariantId() { + return _invariantId; + } + + public String getName() { + return _name; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurity() { + return _security; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getVersion() { + return _version; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PnfdBuilder withKey(final PnfdKey key) { + this.key = key; + return this; + } + public PnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public PnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setFunctionDescription(final String value) { + this._functionDescription = value; + return this; + } + + public PnfdBuilder setGeographicalLocationInfo(final String value) { + this._geographicalLocationInfo = value; + return this; + } + + public PnfdBuilder setId(final String value) { + this._id = value; + return this; + } + + public PnfdBuilder setInvariantId(final String value) { + this._invariantId = value; + return this; + } + + public PnfdBuilder setName(final String value) { + this._name = value; + return this; + } + + public PnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public PnfdBuilder setSecurity(final Map values) { + this._security = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder setSecurity(final List values) { + return setSecurity(CodeHelpers.compatMap(values)); + } + public PnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public PnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public PnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Pnfd build() { + return new PnfdImpl(this); + } + + private static final class PnfdImpl + extends AbstractAugmentable + implements Pnfd { + + private final Map _extCpd; + private final String _functionDescription; + private final String _geographicalLocationInfo; + private final String _id; + private final String _invariantId; + private final String _name; + private final String _provider; + private final Map _security; + private final Map _securityGroupRule; + private final String _version; + private final PnfdKey key; + + PnfdImpl(PnfdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PnfdKey(base.getId()); + } + this._id = key.getId(); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._functionDescription = base.getFunctionDescription(); + this._geographicalLocationInfo = base.getGeographicalLocationInfo(); + this._invariantId = base.getInvariantId(); + this._name = base.getName(); + this._provider = base.getProvider(); + this._security = CodeHelpers.emptyToNull(base.getSecurity()); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._version = base.getVersion(); + } + + @Override + public PnfdKey key() { + return key; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getFunctionDescription() { + return _functionDescription; + } + + @Override + public String getGeographicalLocationInfo() { + return _geographicalLocationInfo; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInvariantId() { + return _invariantId; + } + + @Override + public String getName() { + return _name; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurity() { + return _security; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getVersion() { + return _version; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_functionDescription); + result = prime * result + Objects.hashCode(_geographicalLocationInfo); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_invariantId); + result = prime * result + Objects.hashCode(_name); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_security); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Pnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Pnfd other = (Pnfd)obj; + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_functionDescription, other.getFunctionDescription())) { + return false; + } + if (!Objects.equals(_geographicalLocationInfo, other.getGeographicalLocationInfo())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_invariantId, other.getInvariantId())) { + return false; + } + if (!Objects.equals(_name, other.getName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_security, other.getSecurity())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfdImpl otherImpl = (PnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Pnfd"); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_functionDescription", _functionDescription); + CodeHelpers.appendValue(helper, "_geographicalLocationInfo", _geographicalLocationInfo); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_invariantId", _invariantId); + CodeHelpers.appendValue(helper, "_name", _name); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_security", _security); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java new file mode 100644 index 0000000000000000000000000000000000000000..14e61d34a7fd9e795678b4113d649c5e7681fc42 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/PnfdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class PnfdKey + implements Identifier { + private static final long serialVersionUID = -6839690951618085740L; + private final String _id; + + + public PnfdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PnfdKey(PnfdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PnfdKey)) { + return false; + } + final PnfdKey other = (PnfdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PnfdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java new file mode 100644 index 0000000000000000000000000000000000000000..61359990673cf5989998170bddd54da59901b777 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/Vnfd.java @@ -0,0 +1,57 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import java.lang.Class; +import java.lang.Override; +import org.eclipse.jdt.annotation.NonNull; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nfv; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.VnfdBuilder.VnfdImpl; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * A VNF Descriptor (VNFD) is a deployment template which describes a VNF in terms + * of deployment and operational behaviour requirements. It also contains + * connectivity, interface and virtualised resource requirements + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vnfd {
+ *   key id;
+ *   uses vnfd;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nfv/vnfd + * + *

To create instances of this class use {@link VnfdBuilder}. + * @see VnfdBuilder + * @see VnfdKey + * + */ +public interface Vnfd + extends + ChildOf, + Augmentable, + org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnfd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv.Vnfd.class; + } + + @Override + VnfdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..d173c365b2cf2bcf914fe8775865c006f6b02cd4 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdBuilder.java @@ -0,0 +1,1096 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRule; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.security.group.rule.SecurityGroupRuleKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ConfigurableProperties; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.DfKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ElementGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ExtCpdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Indicator; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IndicatorKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.IntVirtualLinkDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScript; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.LifecycleManagementScriptKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.ModifiableAttributes; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.SwImageDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.Vdu; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VduKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualComputeDescKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDesc; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.vnfd.VirtualStorageDescKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnfdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnfdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnfdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnfdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnfdBuilder + * @see Builder + * + */ +public class VnfdBuilder implements Builder { + + private List _autoScale; + private ConfigurableProperties _configurableProperties; + private String _defaultLocalizationLanguage; + private Map _df; + private Map _elementGroup; + private Map _extCpd; + private String _id; + private Map _indicator; + private Map _intVirtualLinkDesc; + private Map _lifecycleManagementScript; + private String _localizationLanguage; + private ModifiableAttributes _modifiableAttributes; + private String _productInfoDescription; + private String _productInfoName; + private String _productName; + private String _provider; + private Map _securityGroupRule; + private String _softwareVersion; + private Map _swImageDesc; + private Map _vdu; + private String _version; + private Map _virtualComputeDesc; + private Map _virtualStorageDesc; + private List _vnfmInfo; + private VnfdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnfdBuilder() { + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd arg) { + this._id = arg.getId(); + this._provider = arg.getProvider(); + this._productName = arg.getProductName(); + this._softwareVersion = arg.getSoftwareVersion(); + this._version = arg.getVersion(); + this._productInfoName = arg.getProductInfoName(); + this._productInfoDescription = arg.getProductInfoDescription(); + this._vnfmInfo = arg.getVnfmInfo(); + this._localizationLanguage = arg.getLocalizationLanguage(); + this._defaultLocalizationLanguage = arg.getDefaultLocalizationLanguage(); + this._vdu = arg.getVdu(); + this._virtualComputeDesc = arg.getVirtualComputeDesc(); + this._virtualStorageDesc = arg.getVirtualStorageDesc(); + this._swImageDesc = arg.getSwImageDesc(); + this._intVirtualLinkDesc = arg.getIntVirtualLinkDesc(); + this._extCpd = arg.getExtCpd(); + this._df = arg.getDf(); + this._configurableProperties = arg.getConfigurableProperties(); + this._modifiableAttributes = arg.getModifiableAttributes(); + this._lifecycleManagementScript = arg.getLifecycleManagementScript(); + this._elementGroup = arg.getElementGroup(); + this._indicator = arg.getIndicator(); + this._autoScale = arg.getAutoScale(); + this._securityGroupRule = arg.getSecurityGroupRule(); + } + public VnfdBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule arg) { + this._securityGroupRule = arg.getSecurityGroupRule(); + } + + public VnfdBuilder(Vnfd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = base.getDf(); + this._elementGroup = base.getElementGroup(); + this._extCpd = base.getExtCpd(); + this._indicator = base.getIndicator(); + this._intVirtualLinkDesc = base.getIntVirtualLinkDesc(); + this._lifecycleManagementScript = base.getLifecycleManagementScript(); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = base.getSecurityGroupRule(); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = base.getSwImageDesc(); + this._vdu = base.getVdu(); + this._version = base.getVersion(); + this._virtualComputeDesc = base.getVirtualComputeDesc(); + this._virtualStorageDesc = base.getVirtualStorageDesc(); + this._vnfmInfo = base.getVnfmInfo(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule) { + this._securityGroupRule = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule)arg).getSecurityGroupRule(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd) { + this._id = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getId(); + this._provider = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProvider(); + this._productName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductName(); + this._softwareVersion = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSoftwareVersion(); + this._version = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVersion(); + this._productInfoName = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoName(); + this._productInfoDescription = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getProductInfoDescription(); + this._vnfmInfo = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVnfmInfo(); + this._localizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLocalizationLanguage(); + this._defaultLocalizationLanguage = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDefaultLocalizationLanguage(); + this._vdu = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVdu(); + this._virtualComputeDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualComputeDesc(); + this._virtualStorageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getVirtualStorageDesc(); + this._swImageDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getSwImageDesc(); + this._intVirtualLinkDesc = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIntVirtualLinkDesc(); + this._extCpd = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getExtCpd(); + this._df = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getDf(); + this._configurableProperties = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getConfigurableProperties(); + this._modifiableAttributes = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getModifiableAttributes(); + this._lifecycleManagementScript = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getLifecycleManagementScript(); + this._elementGroup = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getElementGroup(); + this._indicator = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getIndicator(); + this._autoScale = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd)arg).getAutoScale(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityGroupRule, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Vnfd]"); + } + + public VnfdKey key() { + return key; + } + + public List getAutoScale() { + return _autoScale; + } + + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + public Map getDf() { + return _df; + } + + public Map getElementGroup() { + return _elementGroup; + } + + public Map getExtCpd() { + return _extCpd; + } + + public String getId() { + return _id; + } + + public Map getIndicator() { + return _indicator; + } + + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + public String getProductInfoDescription() { + return _productInfoDescription; + } + + public String getProductInfoName() { + return _productInfoName; + } + + public String getProductName() { + return _productName; + } + + public String getProvider() { + return _provider; + } + + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + public String getSoftwareVersion() { + return _softwareVersion; + } + + public Map getSwImageDesc() { + return _swImageDesc; + } + + public Map getVdu() { + return _vdu; + } + + public String getVersion() { + return _version; + } + + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + public List getVnfmInfo() { + return _vnfmInfo; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnfdBuilder withKey(final VnfdKey key) { + this.key = key; + return this; + } + public VnfdBuilder setAutoScale(final List values) { + this._autoScale = values; + return this; + } + + + public VnfdBuilder setConfigurableProperties(final ConfigurableProperties value) { + this._configurableProperties = value; + return this; + } + + public VnfdBuilder setDefaultLocalizationLanguage(final String value) { + this._defaultLocalizationLanguage = value; + return this; + } + public VnfdBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setElementGroup(final Map values) { + this._elementGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setElementGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setElementGroup(final List values) { + return setElementGroup(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setExtCpd(final Map values) { + this._extCpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setExtCpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setExtCpd(final List values) { + return setExtCpd(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setIndicator(final Map values) { + this._indicator = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIndicator(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIndicator(final List values) { + return setIndicator(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setIntVirtualLinkDesc(final Map values) { + this._intVirtualLinkDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setIntVirtualLinkDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setIntVirtualLinkDesc(final List values) { + return setIntVirtualLinkDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setLifecycleManagementScript(final Map values) { + this._lifecycleManagementScript = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setLifecycleManagementScript(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setLifecycleManagementScript(final List values) { + return setLifecycleManagementScript(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setLocalizationLanguage(final String value) { + this._localizationLanguage = value; + return this; + } + + public VnfdBuilder setModifiableAttributes(final ModifiableAttributes value) { + this._modifiableAttributes = value; + return this; + } + + public VnfdBuilder setProductInfoDescription(final String value) { + this._productInfoDescription = value; + return this; + } + + public VnfdBuilder setProductInfoName(final String value) { + this._productInfoName = value; + return this; + } + + public VnfdBuilder setProductName(final String value) { + this._productName = value; + return this; + } + + public VnfdBuilder setProvider(final String value) { + this._provider = value; + return this; + } + public VnfdBuilder setSecurityGroupRule(final Map values) { + this._securityGroupRule = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSecurityGroupRule(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSecurityGroupRule(final List values) { + return setSecurityGroupRule(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setSoftwareVersion(final String value) { + this._softwareVersion = value; + return this; + } + public VnfdBuilder setSwImageDesc(final Map values) { + this._swImageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setSwImageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setSwImageDesc(final List values) { + return setSwImageDesc(CodeHelpers.compatMap(values)); + } + @JsonSetter("vdu") + public VnfdBuilder setVdu(final Map values) { + this._vdu = values; + return this; + } + + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVdu(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVdu(final List values) { + return setVdu(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setVersion(final String value) { + this._version = value; + return this; + } + + @JsonSetter("virtual-compute-desc") + public VnfdBuilder setVirtualComputeDesc(final Map values) { + this._virtualComputeDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualComputeDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualComputeDesc(final List values) { + return setVirtualComputeDesc(CodeHelpers.compatMap(values)); + } + + public VnfdBuilder setVirtualStorageDesc(final Map values) { + this._virtualStorageDesc = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualStorageDesc(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder setVirtualStorageDesc(final List values) { + return setVirtualStorageDesc(CodeHelpers.compatMap(values)); + } + public VnfdBuilder setVnfmInfo(final List values) { + this._vnfmInfo = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnfdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnfdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnfdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnfdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnfd build() { + return new VnfdImpl(this); + } + + public static final class VnfdImpl + extends AbstractAugmentable + implements Vnfd { + + private final List _autoScale; + private final ConfigurableProperties _configurableProperties; + private final String _defaultLocalizationLanguage; + private Map _df; + private final Map _elementGroup; + private final Map _extCpd; + @JsonProperty("_id") + private final String _id; + private final Map _indicator; + private final Map _intVirtualLinkDesc; + private final Map _lifecycleManagementScript; + private final String _localizationLanguage; + private final ModifiableAttributes _modifiableAttributes; + @JsonProperty("product-info-description") + private final String _productInfoDescription; + private final String _productInfoName; + @JsonProperty("product-name") + private final String _productName; + @JsonProperty("provider") + private final String _provider; + private final Map _securityGroupRule; + private final String _softwareVersion; + private final Map _swImageDesc; + @JsonProperty("vdu") + private Map _vdu; + @JsonProperty("version") + private final String _version; + @JsonProperty("virtual-compute-desc") + private Map _virtualComputeDesc; + @JsonProperty("virtual-storage-desc") + private Map _virtualStorageDesc; + private final List _vnfmInfo; + private final VnfdKey key; + + VnfdImpl(VnfdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnfdKey(base.getId()); + } + this._id = key.getId(); + this._autoScale = base.getAutoScale(); + this._configurableProperties = base.getConfigurableProperties(); + this._defaultLocalizationLanguage = base.getDefaultLocalizationLanguage(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._elementGroup = CodeHelpers.emptyToNull(base.getElementGroup()); + this._extCpd = CodeHelpers.emptyToNull(base.getExtCpd()); + this._indicator = CodeHelpers.emptyToNull(base.getIndicator()); + this._intVirtualLinkDesc = CodeHelpers.emptyToNull(base.getIntVirtualLinkDesc()); + this._lifecycleManagementScript = CodeHelpers.emptyToNull(base.getLifecycleManagementScript()); + this._localizationLanguage = base.getLocalizationLanguage(); + this._modifiableAttributes = base.getModifiableAttributes(); + this._productInfoDescription = base.getProductInfoDescription(); + this._productInfoName = base.getProductInfoName(); + this._productName = base.getProductName(); + this._provider = base.getProvider(); + this._securityGroupRule = CodeHelpers.emptyToNull(base.getSecurityGroupRule()); + this._softwareVersion = base.getSoftwareVersion(); + this._swImageDesc = CodeHelpers.emptyToNull(base.getSwImageDesc()); + this._vdu = CodeHelpers.emptyToNull(base.getVdu()); + this._version = base.getVersion(); + this._virtualComputeDesc = CodeHelpers.emptyToNull(base.getVirtualComputeDesc()); + this._virtualStorageDesc = CodeHelpers.emptyToNull(base.getVirtualStorageDesc()); + this._vnfmInfo = base.getVnfmInfo(); + } + + public VnfdImpl(){ + this( new VnfdBuilder() ); + } + + @Override + public VnfdKey key() { + return key; + } + + @Override + public List getAutoScale() { + return _autoScale; + } + + @Override + public ConfigurableProperties getConfigurableProperties() { + return _configurableProperties; + } + + @Override + public String getDefaultLocalizationLanguage() { + return _defaultLocalizationLanguage; + } + + public Map setDf(final List values) { + return _df = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public Map getElementGroup() { + return _elementGroup; + } + + @Override + public Map getExtCpd() { + return _extCpd; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getIndicator() { + return _indicator; + } + + @Override + public Map getIntVirtualLinkDesc() { + return _intVirtualLinkDesc; + } + + @Override + public Map getLifecycleManagementScript() { + return _lifecycleManagementScript; + } + + @Override + public String getLocalizationLanguage() { + return _localizationLanguage; + } + + @Override + public ModifiableAttributes getModifiableAttributes() { + return _modifiableAttributes; + } + + @Override + public String getProductInfoDescription() { + return _productInfoDescription; + } + + @Override + public String getProductInfoName() { + return _productInfoName; + } + + @Override + public String getProductName() { + return _productName; + } + + @Override + public String getProvider() { + return _provider; + } + + @Override + public Map getSecurityGroupRule() { + return _securityGroupRule; + } + + @Override + public String getSoftwareVersion() { + return _softwareVersion; + } + + @Override + public Map getSwImageDesc() { + return _swImageDesc; + } + + public Map setVdu(final List values) { + return _vdu = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getVdu() { + return _vdu; + } + + @Override + public String getVersion() { + return _version; + } + + @Override + public Map getVirtualComputeDesc() { + return _virtualComputeDesc; + } + + @JsonSetter("virtual-compute-desc") + public Map setVirtualComputeDesc(final List values) { + return _virtualComputeDesc = CodeHelpers.compatMap(values) ; + } + + @Override + public Map getVirtualStorageDesc() { + return _virtualStorageDesc; + } + + @JsonSetter("virtual-storage-desc") + public Map setVirtualStorageDesc(final List values) { + return _virtualStorageDesc = CodeHelpers.compatMap(values) ; + } + + @Override + public List getVnfmInfo() { + return _vnfmInfo; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_autoScale); + result = prime * result + Objects.hashCode(_configurableProperties); + result = prime * result + Objects.hashCode(_defaultLocalizationLanguage); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_elementGroup); + result = prime * result + Objects.hashCode(_extCpd); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_indicator); + result = prime * result + Objects.hashCode(_intVirtualLinkDesc); + result = prime * result + Objects.hashCode(_lifecycleManagementScript); + result = prime * result + Objects.hashCode(_localizationLanguage); + result = prime * result + Objects.hashCode(_modifiableAttributes); + result = prime * result + Objects.hashCode(_productInfoDescription); + result = prime * result + Objects.hashCode(_productInfoName); + result = prime * result + Objects.hashCode(_productName); + result = prime * result + Objects.hashCode(_provider); + result = prime * result + Objects.hashCode(_securityGroupRule); + result = prime * result + Objects.hashCode(_softwareVersion); + result = prime * result + Objects.hashCode(_swImageDesc); + result = prime * result + Objects.hashCode(_vdu); + result = prime * result + Objects.hashCode(_version); + result = prime * result + Objects.hashCode(_virtualComputeDesc); + result = prime * result + Objects.hashCode(_virtualStorageDesc); + result = prime * result + Objects.hashCode(_vnfmInfo); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnfd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnfd other = (Vnfd)obj; + if (!Objects.equals(_autoScale, other.getAutoScale())) { + return false; + } + if (!Objects.equals(_configurableProperties, other.getConfigurableProperties())) { + return false; + } + if (!Objects.equals(_defaultLocalizationLanguage, other.getDefaultLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_elementGroup, other.getElementGroup())) { + return false; + } + if (!Objects.equals(_extCpd, other.getExtCpd())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_indicator, other.getIndicator())) { + return false; + } + if (!Objects.equals(_intVirtualLinkDesc, other.getIntVirtualLinkDesc())) { + return false; + } + if (!Objects.equals(_lifecycleManagementScript, other.getLifecycleManagementScript())) { + return false; + } + if (!Objects.equals(_localizationLanguage, other.getLocalizationLanguage())) { + return false; + } + if (!Objects.equals(_modifiableAttributes, other.getModifiableAttributes())) { + return false; + } + if (!Objects.equals(_productInfoDescription, other.getProductInfoDescription())) { + return false; + } + if (!Objects.equals(_productInfoName, other.getProductInfoName())) { + return false; + } + if (!Objects.equals(_productName, other.getProductName())) { + return false; + } + if (!Objects.equals(_provider, other.getProvider())) { + return false; + } + if (!Objects.equals(_securityGroupRule, other.getSecurityGroupRule())) { + return false; + } + if (!Objects.equals(_softwareVersion, other.getSoftwareVersion())) { + return false; + } + if (!Objects.equals(_swImageDesc, other.getSwImageDesc())) { + return false; + } + if (!Objects.equals(_vdu, other.getVdu())) { + return false; + } + if (!Objects.equals(_version, other.getVersion())) { + return false; + } + if (!Objects.equals(_virtualComputeDesc, other.getVirtualComputeDesc())) { + return false; + } + if (!Objects.equals(_virtualStorageDesc, other.getVirtualStorageDesc())) { + return false; + } + if (!Objects.equals(_vnfmInfo, other.getVnfmInfo())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnfdImpl otherImpl = (VnfdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnfd"); + CodeHelpers.appendValue(helper, "_autoScale", _autoScale); + CodeHelpers.appendValue(helper, "_configurableProperties", _configurableProperties); + CodeHelpers.appendValue(helper, "_defaultLocalizationLanguage", _defaultLocalizationLanguage); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_elementGroup", _elementGroup); + CodeHelpers.appendValue(helper, "_extCpd", _extCpd); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_indicator", _indicator); + CodeHelpers.appendValue(helper, "_intVirtualLinkDesc", _intVirtualLinkDesc); + CodeHelpers.appendValue(helper, "_lifecycleManagementScript", _lifecycleManagementScript); + CodeHelpers.appendValue(helper, "_localizationLanguage", _localizationLanguage); + CodeHelpers.appendValue(helper, "_modifiableAttributes", _modifiableAttributes); + CodeHelpers.appendValue(helper, "_productInfoDescription", _productInfoDescription); + CodeHelpers.appendValue(helper, "_productInfoName", _productInfoName); + CodeHelpers.appendValue(helper, "_productName", _productName); + CodeHelpers.appendValue(helper, "_provider", _provider); + CodeHelpers.appendValue(helper, "_securityGroupRule", _securityGroupRule); + CodeHelpers.appendValue(helper, "_softwareVersion", _softwareVersion); + CodeHelpers.appendValue(helper, "_swImageDesc", _swImageDesc); + CodeHelpers.appendValue(helper, "_vdu", _vdu); + CodeHelpers.appendValue(helper, "_version", _version); + CodeHelpers.appendValue(helper, "_virtualComputeDesc", _virtualComputeDesc); + CodeHelpers.appendValue(helper, "_virtualStorageDesc", _virtualStorageDesc); + CodeHelpers.appendValue(helper, "_vnfmInfo", _vnfmInfo); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java new file mode 100644 index 0000000000000000000000000000000000000000..9f16c3a2ea028064c59f722918863b81106c2712 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nfv/VnfdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nfv; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnfdKey + implements Identifier { + private static final long serialVersionUID = -7003982558180291733L; + private final String _id; + + + public VnfdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnfdKey(VnfdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnfdKey)) { + return false; + } + final VnfdKey other = (VnfdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnfdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java new file mode 100644 index 0000000000000000000000000000000000000000..cecbb56bebb3dcd0d4927d976b9a3de8fc59935f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Df.java @@ -0,0 +1,610 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.DfBuilder.DfImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.DependenciesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfoKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevelKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspectKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; + +/** + * Identifies a DF within the scope of an NSD. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list df {
+ *   min-elements 1;
+ *   must "default-instantiation-level or count(ns-instantiation-level) = 1" {
+ *     error-message
+ *       "default-instantiation-level must be present if there multiple instantion-level";
+ *   }
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf flavour-key {
+ *     type leafref {
+ *       path ../monitored-info/id;
+ *     }
+ *   }
+ *   list vnf-profile {
+ *     must "min-number-of-instances <= max-number-of-instances";
+ *     must boolean(../../vnfd-id[.=current()/vnfd-id]) {
+ *       error-message
+ *         "VNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *     }
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf vnfd-id {
+ *       type leafref {
+ *         path ../../../../vnfd/id;
+ *       }
+ *     }
+ *     leaf flavour-id {
+ *       type leafref {
+ *         path deref(../vnfd-id)/../df/id;
+ *       }
+ *     }
+ *     leaf instantiation-level {
+ *       type leafref {
+ *         path deref(../flavour-id)/../instantiation-level/id;
+ *       }
+ *     }
+ *     leaf min-number-of-instances {
+ *       default 1;
+ *       type uint16;
+ *     }
+ *     leaf max-number-of-instances {
+ *       default 1;
+ *       type uint16;
+ *     }
+ *     uses local-affinity-or-anti-affinity-rule;
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-connectivity {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       list constituent-cpd-id {
+ *         key constituent-base-element-id;
+ *         leaf constituent-base-element-id {
+ *           type leafref {
+ *             path ../../../id;
+ *           }
+ *         }
+ *         leaf constituent-cpd-id {
+ *           type leafref {
+ *             path deref(../../../vnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list pnf-profile {
+ *     key id;
+ *     must boolean(../../pnfd-id[.=current()/pnfd-id]) {
+ *       error-message
+ *         "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *     }
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf pnfd-id {
+ *       type leafref {
+ *         path ../../../../pnfd/id;
+ *       }
+ *     }
+ *     list virtual-link-connectivity {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       list constituent-cpd-id {
+ *         key constituent-base-element-id;
+ *         leaf constituent-base-element-id {
+ *           type leafref {
+ *             path ../../../id;
+ *           }
+ *         }
+ *         leaf constituent-cpd-id {
+ *           type leafref {
+ *             path deref(../../../pnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-profile {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf virtual-link-desc-id {
+ *       type leafref {
+ *         path ../../../virtual-link-desc/id;
+ *       }
+ *     }
+ *     leaf flavour-id {
+ *       type leafref {
+ *         path deref(../virtual-link-desc-id)/../df/id;
+ *       }
+ *     }
+ *     uses local-affinity-or-anti-affinity-rule;
+ *     list affinity-or-anti-affinity-group {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     container max-bitrate-requirements {
+ *       uses link-bitrate-requirements;
+ *     }
+ *     container min-bitrate-requirements {
+ *       uses link-bitrate-requirements;
+ *     }
+ *   }
+ *   list scaling-aspect {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     leaf scaling-level {
+ *       type leafref {
+ *         path ../../ns-instantiation-level/id;
+ *       }
+ *     }
+ *   }
+ *   list affinity-or-anti-affinity-group {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf type {
+ *       type affinity-type;
+ *     }
+ *     leaf scope {
+ *       type affinity-scope;
+ *     }
+ *   }
+ *   list ns-instantiation-level {
+ *     min-elements 1;
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf description {
+ *       type string;
+ *     }
+ *     list vnf-to-level-mapping {
+ *       key vnf-profile-id;
+ *       leaf vnf-profile-id {
+ *         type leafref {
+ *           path ../../../vnf-profile/id;
+ *         }
+ *       }
+ *       leaf number-of-instances {
+ *         default 1;
+ *         type uint32;
+ *       }
+ *     }
+ *     list virtual-link-to-level-mapping {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       uses link-bitrate-requirements;
+ *     }
+ *     list ns-to-level-mapping {
+ *       key ns-profile-id;
+ *       leaf ns-profile-id {
+ *         type leafref {
+ *           path ../../../ns-profile/id;
+ *         }
+ *       }
+ *       leaf number-of-instances {
+ *         default 1;
+ *         type uint32;
+ *       }
+ *     }
+ *     must "(count(vnf-to-level-mapping) + count(virtual-link-to-level-mapping) + count(ns-to-level-mapping)) > 0" {
+ *       error-message
+ *         "At least one attribute between vnf-to-level-mapping, virtual-link-to-level-mapping and ns-to-level-mapping shall be present.";
+ *     }
+ *   }
+ *   leaf default-instantiation-level {
+ *     type leafref {
+ *       path ../ns-instantiation-level/id;
+ *     }
+ *   }
+ *   list ns-profile {
+ *     must "min-number-of-instances <= max-number-of-instances" {
+ *       error-message
+ *         "min-number-of-instances has to be less than or equalmax-number-of-instances.";
+ *     }
+ *     must boolean(../../nested-nsd-id[.=current()/nsd-id]) {
+ *       error-message
+ *         "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *     }
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf nsd-id {
+ *       type leafref {
+ *         path ../../../../nsd/id;
+ *       }
+ *     }
+ *     leaf ns-df-id {
+ *       type leafref {
+ *         path deref(../nsd-id)/../df/id;
+ *       }
+ *     }
+ *     leaf instantiation-level-id {
+ *       type leafref {
+ *         path deref(../ns-df-id)/../ns-instantiation-level/id;
+ *       }
+ *     }
+ *     leaf min-number-of-instances {
+ *       type uint16;
+ *       default 1;
+ *     }
+ *     leaf max-number-of-instances {
+ *       type uint16;
+ *       default 1;
+ *     }
+ *     list affinity-or-anti-affinity-group-id {
+ *       key id;
+ *       leaf id {
+ *         type leafref {
+ *           path ../../../affinity-or-anti-affinity-group/id;
+ *         }
+ *       }
+ *     }
+ *     list virtual-link-connectivity {
+ *       key virtual-link-profile-id;
+ *       leaf virtual-link-profile-id {
+ *         type leafref {
+ *           path ../../../virtual-link-profile/id;
+ *         }
+ *       }
+ *       list constituent-cpd-id {
+ *         key constituent-base-element-id;
+ *         leaf constituent-base-element-id {
+ *           type leafref {
+ *             path ../../../id;
+ *           }
+ *         }
+ *         leaf constituent-cpd-id {
+ *           type leafref {
+ *             path deref(../../../nsd-id)/../sapd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list dependencies {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     choice primary-id {
+ *       case primary-vnf-profile {
+ *         leaf primary-vnf-profile {
+ *           type leafref {
+ *             path ../../vnf-profile/vnfd-id;
+ *           }
+ *         }
+ *       }
+ *       case primary-ns-profile {
+ *         leaf primary-ns-profile {
+ *           type leafref {
+ *             path ../../ns-profile/nsd-id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     choice secondary-id {
+ *       case secondary-vnf-profile {
+ *         leaf secondary-vnf-profile {
+ *           type leafref {
+ *             path ../../vnf-profile/vnfd-id;
+ *           }
+ *         }
+ *       }
+ *       case secondary-ns-profile {
+ *         leaf secondary-ns-profile {
+ *           type leafref {
+ *             path ../../ns-profile/nsd-id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list monitored-info {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     container vnf-indicator-info {
+ *       leaf vnfd-id {
+ *         type leafref {
+ *           path ../../../../../vnfd/id;
+ *         }
+ *       }
+ *       leaf vnf-indicator {
+ *         type leafref {
+ *           path deref(../vnfd-id)/../indicator/id;
+ *         }
+ *       }
+ *     }
+ *     container monitoring-parameter {
+ *       leaf id {
+ *         type string;
+ *       }
+ *       leaf name {
+ *         type string;
+ *       }
+ *       leaf performance-metric {
+ *         type string;
+ *       }
+ *       leaf collection-period {
+ *         type string;
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df + * + *

To create instances of this class use {@link DfBuilder}. + * @see DfBuilder + * @see DfKey + * + */ +@JsonDeserialize(as = DfImpl.class) +@JsonIgnoreProperties(ignoreUnknown = true) +public interface Df + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("df"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df.class; + } + + /** + * Identifies this NsDf information element. It identifies a NS DF within the NSD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Assurance parameter against which this flavour is being described. The key can + * be a combination of multiple assurance parameters with a logical relationship + * between them. The parameters should be present as a monitoredInfo attribute in + * the NSD. + * + * + * + * @return java.lang.String flavourKey, or null if not present + */ + @Nullable String getFlavourKey(); + + /** + * VNF profile to be used for the NS flavour. + * + * + * + * @return java.util.Map vnfProfile, or null if not present + */ + @Nullable Map getVnfProfile(); + + /** + * @return java.util.Map vnfProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfProfile() { + return CodeHelpers.nonnull(getVnfProfile()); + } + + /** + * @return java.util.Map pnfProfile, or null if not present + */ + @Nullable Map getPnfProfile(); + + /** + * @return java.util.Map pnfProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullPnfProfile() { + return CodeHelpers.nonnull(getPnfProfile()); + } + + /** + * VL profile to be used for the NS flavour. + * + * + * + * @return java.util.Map virtualLinkProfile, or null if not present + */ + @Nullable Map getVirtualLinkProfile(); + + /** + * @return java.util.Map virtualLinkProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkProfile() { + return CodeHelpers.nonnull(getVirtualLinkProfile()); + } + + /** + * The scaling aspects supported by this DF of the NS. + * + * + * + * @return java.util.Map scalingAspect, or null if not present + */ + @Nullable Map getScalingAspect(); + + /** + * @return java.util.Map scalingAspect, or an empty list if it is not present + */ + default @NonNull Map nonnullScalingAspect() { + return CodeHelpers.nonnull(getScalingAspect()); + } + + /** + * Specifies affinity or anti-affinity relationship applicable between the VNF + * instances created using different VNFDs, the Virtual Link instances created + * using different NsVirtualLinkDescs or the nested NS instances created using + * different NSDs in the same affinity or anti-affinity group. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroup, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroup(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroup, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroup() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroup()); + } + + /** + * Describes the details of an NS level. + * + * + * + * @return java.util.Map nsInstantiationLevel, or null if not present + */ + @Nullable Map getNsInstantiationLevel(); + + /** + * @return java.util.Map nsInstantiationLevel, or an empty list if it is not present + */ + default @NonNull Map nonnullNsInstantiationLevel() { + return CodeHelpers.nonnull(getNsInstantiationLevel()); + } + + /** + * Identifies the NS level which represents the default NS instantiation level for + * this DF. It shall be present if there are multiple 'nsIinstantiationLevel' + * entries. + * + * + * + * @return java.lang.String defaultInstantiationLevel, or null if not present + */ + @Nullable String getDefaultInstantiationLevel(); + + /** + * Specifies a NS Profile supported by this NS DF. + * + * + * + * @return java.util.Map nsProfile, or null if not present + */ + @Nullable Map getNsProfile(); + + /** + * @return java.util.Map nsProfile, or an empty list if it is not present + */ + default @NonNull Map nonnullNsProfile() { + return CodeHelpers.nonnull(getNsProfile()); + } + + /** + * Specifies the order in which instances of the VNFs and/or nested NSs have to be + * created. + * + * + * + * @return java.util.Map dependencies, or null if not present + */ + @Nullable Map getDependencies(); + + /** + * @return java.util.Map dependencies, or an empty list if it is not present + */ + default @NonNull Map nonnullDependencies() { + return CodeHelpers.nonnull(getDependencies()); + } + + /** + * @return java.util.Map monitoredInfo, or null if not present + */ + @Nullable Map getMonitoredInfo(); + + /** + * @return java.util.Map monitoredInfo, or an empty list if it is not present + */ + default @NonNull Map nonnullMonitoredInfo() { + return CodeHelpers.nonnull(getMonitoredInfo()); + } + + @Override + DfKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..5997986c2d5726f5e56e12c96d8038faea0d1a6e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfBuilder.java @@ -0,0 +1,705 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonSetter; +import com.fasterxml.jackson.databind.annotation.JsonDeserialize; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroup; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroupKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.DependenciesKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfoKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevelKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspect; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspectKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VirtualLinkProfileKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfile; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileBuilder.VnfProfileImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.VnfProfileKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DfBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DfBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DfBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DfBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DfBuilder + * @see Builder + * + */ +public class DfBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroup; + private String _defaultInstantiationLevel; + private Map _dependencies; + private String _flavourKey; + private String _id; + private Map _monitoredInfo; + private Map _nsInstantiationLevel; + private Map _nsProfile; + private Map _pnfProfile; + private Map _scalingAspect; + private Map _virtualLinkProfile; + private Map _vnfProfile; + private DfKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DfBuilder() { + } + + public DfBuilder(Df base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroup = base.getAffinityOrAntiAffinityGroup(); + this._defaultInstantiationLevel = base.getDefaultInstantiationLevel(); + this._dependencies = base.getDependencies(); + this._flavourKey = base.getFlavourKey(); + this._monitoredInfo = base.getMonitoredInfo(); + this._nsInstantiationLevel = base.getNsInstantiationLevel(); + this._nsProfile = base.getNsProfile(); + this._pnfProfile = base.getPnfProfile(); + this._scalingAspect = base.getScalingAspect(); + this._virtualLinkProfile = base.getVirtualLinkProfile(); + this._vnfProfile = base.getVnfProfile(); + } + + + public DfKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + public String getDefaultInstantiationLevel() { + return _defaultInstantiationLevel; + } + + public Map getDependencies() { + return _dependencies; + } + + public String getFlavourKey() { + return _flavourKey; + } + + public String getId() { + return _id; + } + + public Map getMonitoredInfo() { + return _monitoredInfo; + } + + public Map getNsInstantiationLevel() { + return _nsInstantiationLevel; + } + + public Map getNsProfile() { + return _nsProfile; + } + + public Map getPnfProfile() { + return _pnfProfile; + } + + public Map getScalingAspect() { + return _scalingAspect; + } + + public Map getVirtualLinkProfile() { + return _virtualLinkProfile; + } + + public Map getVnfProfile() { + return _vnfProfile; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DfBuilder withKey(final DfKey key) { + this.key = key; + return this; + } + public DfBuilder setAffinityOrAntiAffinityGroup(final Map values) { + this._affinityOrAntiAffinityGroup = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroup(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setAffinityOrAntiAffinityGroup(final List values) { + return setAffinityOrAntiAffinityGroup(CodeHelpers.compatMap(values)); + } + + public DfBuilder setDefaultInstantiationLevel(final String value) { + this._defaultInstantiationLevel = value; + return this; + } + public DfBuilder setDependencies(final Map values) { + this._dependencies = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDependencies(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setDependencies(final List values) { + return setDependencies(CodeHelpers.compatMap(values)); + } + + public DfBuilder setFlavourKey(final String value) { + this._flavourKey = value; + return this; + } + + public DfBuilder setId(final String value) { + this._id = value; + return this; + } + public DfBuilder setMonitoredInfo(final Map values) { + this._monitoredInfo = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setMonitoredInfo(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setMonitoredInfo(final List values) { + return setMonitoredInfo(CodeHelpers.compatMap(values)); + } + public DfBuilder setNsInstantiationLevel(final Map values) { + this._nsInstantiationLevel = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsInstantiationLevel(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setNsInstantiationLevel(final List values) { + return setNsInstantiationLevel(CodeHelpers.compatMap(values)); + } + public DfBuilder setNsProfile(final Map values) { + this._nsProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setNsProfile(final List values) { + return setNsProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setPnfProfile(final Map values) { + this._pnfProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setPnfProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setPnfProfile(final List values) { + return setPnfProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setScalingAspect(final Map values) { + this._scalingAspect = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setScalingAspect(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setScalingAspect(final List values) { + return setScalingAspect(CodeHelpers.compatMap(values)); + } + public DfBuilder setVirtualLinkProfile(final Map values) { + this._virtualLinkProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkProfile(Map)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder setVirtualLinkProfile(final List values) { + return setVirtualLinkProfile(CodeHelpers.compatMap(values)); + } + public DfBuilder setVnfProfile(final Map values) { + this._vnfProfile = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfProfile(Map)} instead. + */ + + @Deprecated(forRemoval = true) + public DfBuilder setVnfProfile(final List values) { + return setVnfProfile(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DfBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DfBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DfBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DfBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Df build() { + return new DfImpl(this); + } + + public static final class DfImpl + extends AbstractAugmentable + implements Df { + + private final Map _affinityOrAntiAffinityGroup; + private final String _defaultInstantiationLevel; + private final Map _dependencies; + private final String _flavourKey; + @JsonProperty("id") + private final String _id; + private final Map _monitoredInfo; + private final Map _nsInstantiationLevel; + private final Map _nsProfile; + private final Map _pnfProfile; + private final Map _scalingAspect; + private final Map _virtualLinkProfile; + private Map _vnfProfile; + private final DfKey key; + + DfImpl(DfBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DfKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroup = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroup()); + this._defaultInstantiationLevel = base.getDefaultInstantiationLevel(); + this._dependencies = CodeHelpers.emptyToNull(base.getDependencies()); + this._flavourKey = base.getFlavourKey(); + this._monitoredInfo = CodeHelpers.emptyToNull(base.getMonitoredInfo()); + this._nsInstantiationLevel = CodeHelpers.emptyToNull(base.getNsInstantiationLevel()); + this._nsProfile = CodeHelpers.emptyToNull(base.getNsProfile()); + this._pnfProfile = CodeHelpers.emptyToNull(base.getPnfProfile()); + this._scalingAspect = CodeHelpers.emptyToNull(base.getScalingAspect()); + this._virtualLinkProfile = CodeHelpers.emptyToNull(base.getVirtualLinkProfile()); + this._vnfProfile = CodeHelpers.emptyToNull(base.getVnfProfile()); + } + + public DfImpl() { + this( new DfBuilder()); + } + +// public Map setVnfProfile(final List values) { +// return _vnfProfile = CodeHelpers.compatMap(values) ; +// } + + @JsonSetter("vnf-profile") + public Map setVnfProfile(final List values) { + if(values==null) + return null; + if(values.isEmpty()) + return null; + else + { + Map result = new HashMap<>(); + for(VnfProfile value:values) { + result.put(new VnfProfileKey(value.getId()),value); + } + this._vnfProfile=result; + return result; + } + } + + @Override + public DfKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroup() { + return _affinityOrAntiAffinityGroup; + } + + @Override + public String getDefaultInstantiationLevel() { + return _defaultInstantiationLevel; + } + + @Override + public Map getDependencies() { + return _dependencies; + } + + @Override + public String getFlavourKey() { + return _flavourKey; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getMonitoredInfo() { + return _monitoredInfo; + } + + @Override + public Map getNsInstantiationLevel() { + return _nsInstantiationLevel; + } + + @Override + public Map getNsProfile() { + return _nsProfile; + } + + @Override + public Map getPnfProfile() { + return _pnfProfile; + } + + @Override + public Map getScalingAspect() { + return _scalingAspect; + } + + @Override + public Map getVirtualLinkProfile() { + return _virtualLinkProfile; + } + + @Override + public Map getVnfProfile() { + return _vnfProfile; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroup); + result = prime * result + Objects.hashCode(_defaultInstantiationLevel); + result = prime * result + Objects.hashCode(_dependencies); + result = prime * result + Objects.hashCode(_flavourKey); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_monitoredInfo); + result = prime * result + Objects.hashCode(_nsInstantiationLevel); + result = prime * result + Objects.hashCode(_nsProfile); + result = prime * result + Objects.hashCode(_pnfProfile); + result = prime * result + Objects.hashCode(_scalingAspect); + result = prime * result + Objects.hashCode(_virtualLinkProfile); + result = prime * result + Objects.hashCode(_vnfProfile); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Df.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Df other = (Df)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroup, other.getAffinityOrAntiAffinityGroup())) { + return false; + } + if (!Objects.equals(_defaultInstantiationLevel, other.getDefaultInstantiationLevel())) { + return false; + } + if (!Objects.equals(_dependencies, other.getDependencies())) { + return false; + } + if (!Objects.equals(_flavourKey, other.getFlavourKey())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_monitoredInfo, other.getMonitoredInfo())) { + return false; + } + if (!Objects.equals(_nsInstantiationLevel, other.getNsInstantiationLevel())) { + return false; + } + if (!Objects.equals(_nsProfile, other.getNsProfile())) { + return false; + } + if (!Objects.equals(_pnfProfile, other.getPnfProfile())) { + return false; + } + if (!Objects.equals(_scalingAspect, other.getScalingAspect())) { + return false; + } + if (!Objects.equals(_virtualLinkProfile, other.getVirtualLinkProfile())) { + return false; + } + if (!Objects.equals(_vnfProfile, other.getVnfProfile())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DfImpl otherImpl = (DfImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Df"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroup", _affinityOrAntiAffinityGroup); + CodeHelpers.appendValue(helper, "_defaultInstantiationLevel", _defaultInstantiationLevel); + CodeHelpers.appendValue(helper, "_dependencies", _dependencies); + CodeHelpers.appendValue(helper, "_flavourKey", _flavourKey); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_monitoredInfo", _monitoredInfo); + CodeHelpers.appendValue(helper, "_nsInstantiationLevel", _nsInstantiationLevel); + CodeHelpers.appendValue(helper, "_nsProfile", _nsProfile); + CodeHelpers.appendValue(helper, "_pnfProfile", _pnfProfile); + CodeHelpers.appendValue(helper, "_scalingAspect", _scalingAspect); + CodeHelpers.appendValue(helper, "_virtualLinkProfile", _virtualLinkProfile); + CodeHelpers.appendValue(helper, "_vnfProfile", _vnfProfile); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java new file mode 100644 index 0000000000000000000000000000000000000000..598abf2f798e2fe0d8a63cef07ede0acb0d56904 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/DfKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DfKey + implements Identifier { + private static final long serialVersionUID = 4083286612161956839L; + private final String _id; + + + public DfKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DfKey(DfKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DfKey)) { + return false; + } + final DfKey other = (DfKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DfKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java new file mode 100644 index 0000000000000000000000000000000000000000..02d7935f3d3ebada069318c6fb47e740c8728903 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScript.java @@ -0,0 +1,66 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list lifecycle-management-script {
+ *   key event;
+ *   leaf event {
+ *     type string;
+ *   }
+ *   leaf script {
+ *     type string;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/lifecycle-management-script + * + *

To create instances of this class use {@link LifecycleManagementScriptBuilder}. + * @see LifecycleManagementScriptBuilder + * @see LifecycleManagementScriptKey + * + */ +public interface LifecycleManagementScript + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("lifecycle-management-script"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.LifecycleManagementScript.class; + } + + /** + * @return java.lang.String event, or null if not present + */ + @Nullable String getEvent(); + + /** + * @return java.lang.String script, or null if not present + */ + @Nullable String getScript(); + + @Override + LifecycleManagementScriptKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..d34e6b984b81f37d5a6033ce257206c349f9b52a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptBuilder.java @@ -0,0 +1,271 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link LifecycleManagementScriptBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     LifecycleManagementScriptBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new LifecycleManagementScriptBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of LifecycleManagementScriptBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see LifecycleManagementScriptBuilder + * @see Builder + * + */ +public class LifecycleManagementScriptBuilder implements Builder { + + private String _event; + private String _script; + private LifecycleManagementScriptKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public LifecycleManagementScriptBuilder() { + } + + public LifecycleManagementScriptBuilder(LifecycleManagementScript base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._event = base.getEvent(); + this._script = base.getScript(); + } + + + public LifecycleManagementScriptKey key() { + return key; + } + + public String getEvent() { + return _event; + } + + public String getScript() { + return _script; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public LifecycleManagementScriptBuilder withKey(final LifecycleManagementScriptKey key) { + this.key = key; + return this; + } + + public LifecycleManagementScriptBuilder setEvent(final String value) { + this._event = value; + return this; + } + + public LifecycleManagementScriptBuilder setScript(final String value) { + this._script = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public LifecycleManagementScriptBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public LifecycleManagementScriptBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public LifecycleManagementScriptBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private LifecycleManagementScriptBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public LifecycleManagementScript build() { + return new LifecycleManagementScriptImpl(this); + } + + private static final class LifecycleManagementScriptImpl + extends AbstractAugmentable + implements LifecycleManagementScript { + + private final String _event; + private final String _script; + private final LifecycleManagementScriptKey key; + + LifecycleManagementScriptImpl(LifecycleManagementScriptBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new LifecycleManagementScriptKey(base.getEvent()); + } + this._event = key.getEvent(); + this._script = base.getScript(); + } + + @Override + public LifecycleManagementScriptKey key() { + return key; + } + + @Override + public String getEvent() { + return _event; + } + + @Override + public String getScript() { + return _script; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_event); + result = prime * result + Objects.hashCode(_script); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!LifecycleManagementScript.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + LifecycleManagementScript other = (LifecycleManagementScript)obj; + if (!Objects.equals(_event, other.getEvent())) { + return false; + } + if (!Objects.equals(_script, other.getScript())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + LifecycleManagementScriptImpl otherImpl = (LifecycleManagementScriptImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("LifecycleManagementScript"); + CodeHelpers.appendValue(helper, "_event", _event); + CodeHelpers.appendValue(helper, "_script", _script); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java new file mode 100644 index 0000000000000000000000000000000000000000..db00eee939f4bd70d77a8065add29da7a7e69e2f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/LifecycleManagementScriptKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class LifecycleManagementScriptKey + implements Identifier { + private static final long serialVersionUID = -7557130487871185497L; + private final String _event; + + + public LifecycleManagementScriptKey(String _event) { + + this._event = _event; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public LifecycleManagementScriptKey(LifecycleManagementScriptKey source) { + this._event = source._event; + } + + + public String getEvent() { + return _event; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_event); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof LifecycleManagementScriptKey)) { + return false; + } + final LifecycleManagementScriptKey other = (LifecycleManagementScriptKey) obj; + if (!Objects.equals(_event, other._event)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(LifecycleManagementScriptKey.class); + CodeHelpers.appendValue(helper, "_event", _event); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java new file mode 100644 index 0000000000000000000000000000000000000000..3a1bd290b52830b3ed35a1705cd915fad2352adf --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Sapd.java @@ -0,0 +1,139 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the descriptor of a service access point of the network service. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list sapd {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf address-assignment {
+ *     type boolean;
+ *   }
+ *   choice cpd-or-virtual-link {
+ *     case virtual-link-desc {
+ *       leaf virtual-link-desc {
+ *         type leafref {
+ *           path ../../virtual-link-desc/id;
+ *         }
+ *       }
+ *     }
+ *     case vnf {
+ *       container vnf {
+ *         leaf vnfd-id {
+ *           type leafref {
+ *             path ../../../../vnfd/id;
+ *           }
+ *           must boolean(../../../vnfd-id[.=current()]);
+ *         }
+ *         leaf ext-cpd-id {
+ *           type leafref {
+ *             path deref(../vnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case pnf {
+ *       container pnf {
+ *         leaf pnfd-id {
+ *           type leafref {
+ *             path ../../../../pnfd/id;
+ *           }
+ *           must boolean(../pnfd-id[.=current()]);
+ *         }
+ *         leaf ext-cpd-id {
+ *           type leafref {
+ *             path deref(../pnfd-id)/../ext-cpd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *     case ns {
+ *       container ns {
+ *         leaf nsd-id {
+ *           type leafref {
+ *             path ../../../../nsd/id;
+ *           }
+ *           must boolean(../nsd-id[.=current()]);
+ *         }
+ *         leaf ext-cpd-id {
+ *           type leafref {
+ *             path deref(../nsd-id)/../sapd/id;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/sapd + * + *

To create instances of this class use {@link SapdBuilder}. + * @see SapdBuilder + * @see SapdKey + * + */ +public interface Sapd + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("sapd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Sapd.class; + } + + /** + * Identifier of this Cpd information element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Specify whether the SAP address assignment is under the responsibility of + * management and orchestration functions or not. If it is set to True, management + * and orchestration functions are responsible for assigning addresses to the + * access points instantiated from this SAPD. + * + * + * + * @return java.lang.Boolean addressAssignment, or null if not present + */ + @Nullable Boolean isAddressAssignment(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink cpdOrVirtualLink, or null if not present + */ + @Nullable CpdOrVirtualLink getCpdOrVirtualLink(); + + @Override + SapdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..7b130747ea747e740b1421d5d6c33fa975f1c96d --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Boolean; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.sapd.CpdOrVirtualLink; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link SapdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     SapdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new SapdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of SapdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see SapdBuilder + * @see Builder + * + */ +public class SapdBuilder implements Builder { + + private CpdOrVirtualLink _cpdOrVirtualLink; + private String _id; + private Boolean _addressAssignment; + private SapdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public SapdBuilder() { + } + + public SapdBuilder(Sapd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpdOrVirtualLink = base.getCpdOrVirtualLink(); + this._addressAssignment = base.isAddressAssignment(); + } + + + public SapdKey key() { + return key; + } + + public CpdOrVirtualLink getCpdOrVirtualLink() { + return _cpdOrVirtualLink; + } + + public String getId() { + return _id; + } + + public Boolean isAddressAssignment() { + return _addressAssignment; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public SapdBuilder withKey(final SapdKey key) { + this.key = key; + return this; + } + + public SapdBuilder setCpdOrVirtualLink(final CpdOrVirtualLink value) { + this._cpdOrVirtualLink = value; + return this; + } + + public SapdBuilder setId(final String value) { + this._id = value; + return this; + } + + public SapdBuilder setAddressAssignment(final Boolean value) { + this._addressAssignment = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public SapdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public SapdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public SapdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private SapdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Sapd build() { + return new SapdImpl(this); + } + + private static final class SapdImpl + extends AbstractAugmentable + implements Sapd { + + private final CpdOrVirtualLink _cpdOrVirtualLink; + private final String _id; + private final Boolean _addressAssignment; + private final SapdKey key; + + SapdImpl(SapdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new SapdKey(base.getId()); + } + this._id = key.getId(); + this._cpdOrVirtualLink = base.getCpdOrVirtualLink(); + this._addressAssignment = base.isAddressAssignment(); + } + + @Override + public SapdKey key() { + return key; + } + + @Override + public CpdOrVirtualLink getCpdOrVirtualLink() { + return _cpdOrVirtualLink; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Boolean isAddressAssignment() { + return _addressAssignment; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdOrVirtualLink); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_addressAssignment); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Sapd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Sapd other = (Sapd)obj; + if (!Objects.equals(_cpdOrVirtualLink, other.getCpdOrVirtualLink())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_addressAssignment, other.isAddressAssignment())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + SapdImpl otherImpl = (SapdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Sapd"); + CodeHelpers.appendValue(helper, "_cpdOrVirtualLink", _cpdOrVirtualLink); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_addressAssignment", _addressAssignment); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java new file mode 100644 index 0000000000000000000000000000000000000000..2fcbbca21368c24a0af4978b07531b5842bd8fc8 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/SapdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class SapdKey + implements Identifier { + private static final long serialVersionUID = 7153644156739384387L; + private final String _id; + + + public SapdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public SapdKey(SapdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof SapdKey)) { + return false; + } + final SapdKey other = (SapdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(SapdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java new file mode 100644 index 0000000000000000000000000000000000000000..710edcd49ef64816e7c3b18666b97857de9afe50 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDesc.java @@ -0,0 +1,221 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.collect.ImmutableMap; +import com.google.common.collect.ImmutableMap.Builder; +import java.lang.Class; +import java.lang.Integer; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import java.util.Objects; +import java.util.Optional; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.DfKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Enumeration; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the constituent VLDs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list virtual-link-desc {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   uses connectivity-type;
+ *   list df {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     container qos {
+ *       presence "VL QoS parameters";
+ *       leaf latency {
+ *         type uint32;
+ *         units ms;
+ *       }
+ *       leaf packet-delay-variation {
+ *         type uint32;
+ *         units ms;
+ *       }
+ *       leaf packet-loss-ratio {
+ *         type decimal64 {
+ *           fraction-digits 2;
+ *           range 0..1.00;
+ *         }
+ *       }
+ *       leaf priority {
+ *         type uint32;
+ *       }
+ *     }
+ *     leaf service-availability-level {
+ *       type enumeration {
+ *         enum level-1;
+ *         enum level-2;
+ *         enum level-3;
+ *       }
+ *     }
+ *   }
+ *   leaf test-access {
+ *     type enumeration {
+ *       enum none;
+ *       enum passive-monitoring;
+ *       enum active;
+ *     }
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   uses security-parameters;
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/virtual-link-desc + * + *

To create instances of this class use {@link VirtualLinkDescBuilder}. + * @see VirtualLinkDescBuilder + * @see VirtualLinkDescKey + * + */ +public interface VirtualLinkDesc + extends + ChildOf, + Augmentable, + ConnectivityType, + SecurityParameters, + Identifiable +{ + + + public enum TestAccess implements Enumeration { + None(0, "none"), + + PassiveMonitoring(1, "passive-monitoring"), + + Active(2, "active") + ; + + private static final Map NAME_MAP; + private static final Map VALUE_MAP; + + static { + final Builder nb = ImmutableMap.builder(); + final Builder vb = ImmutableMap.builder(); + for (TestAccess enumItem : TestAccess.values()) { + vb.put(enumItem.value, enumItem); + nb.put(enumItem.name, enumItem); + } + + NAME_MAP = nb.build(); + VALUE_MAP = vb.build(); + } + + private final String name; + private final int value; + + private TestAccess(int value, String name) { + this.value = value; + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Override + public int getIntValue() { + return value; + } + + /** + * Return the enumeration member whose {@link #getName()} matches specified value. + * + * @param name YANG assigned name + * @return corresponding TestAccess item, if present + * @throws NullPointerException if name is null + */ + public static Optional forName(String name) { + return Optional.ofNullable(NAME_MAP.get(Objects.requireNonNull(name))); + } + + /** + * Return the enumeration member whose {@link #getIntValue()} matches specified value. + * + * @param intValue integer value + * @return corresponding TestAccess item, or null if no such item exists + */ + public static TestAccess forValue(int intValue) { + return VALUE_MAP.get(intValue); + } + } + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("virtual-link-desc"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc.class; + } + + /** + * Identifier of the NsVirtualLinkDesc information element. It uniquely identifies + * a VLD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * The VirtualLinkDf information element specifies properties for instantiating a + * VL according to a specific flavour. + * + * + * + * @return java.util.Map df, or null if not present + */ + @Nullable Map getDf(); + + /** + * @return java.util.Map df, or an empty list if it is not present + */ + default @NonNull Map nonnullDf() { + return CodeHelpers.nonnull(getDf()); + } + + /** + * Specifies test access facilities expected on the VL. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.VirtualLinkDesc.TestAccess testAccess, or null if not present + */ + @Nullable TestAccess getTestAccess(); + + /** + * Provides human-readable information on the purpose of the virtual link (e.g. VL + * for control plane traffic). + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + @Override + VirtualLinkDescKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..fe1e74699c588c762dd6aa6be6d1bd6b1dc26b75 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescBuilder.java @@ -0,0 +1,464 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.fasterxml.jackson.annotation.JsonIgnore; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.connectivity.type.ConnectivityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.virtual.link.desc.DfKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VirtualLinkDescBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VirtualLinkDescBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VirtualLinkDescBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VirtualLinkDescBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VirtualLinkDescBuilder + * @see Builder + * + */ +public class VirtualLinkDescBuilder implements Builder { + + private String _algorithm; + private String _certificate; + private ConnectivityType _connectivityType; + private String _description; + private Map _df; + private String _id; + private String _signature; + private VirtualLinkDesc.TestAccess _testAccess; + private VirtualLinkDescKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VirtualLinkDescBuilder() { + } + public VirtualLinkDescBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType arg) { + this._connectivityType = arg.getConnectivityType(); + } + public VirtualLinkDescBuilder(org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters arg) { + this._signature = arg.getSignature(); + this._algorithm = arg.getAlgorithm(); + this._certificate = arg.getCertificate(); + } + + public VirtualLinkDescBuilder(VirtualLinkDesc base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._algorithm = base.getAlgorithm(); + this._certificate = base.getCertificate(); + this._connectivityType = base.getConnectivityType(); + this._description = base.getDescription(); + this._df = base.getDf(); + this._signature = base.getSignature(); + this._testAccess = base.getTestAccess(); + } + + /** + * Set fields from given grouping argument. Valid argument is instance of one of following types: + *
    + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType
  • + *
  • org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters
  • + *
+ * + * @param arg grouping object + * @throws IllegalArgumentException if given argument is none of valid types + */ + public void fieldsFrom(DataObject arg) { + boolean isValidArg = false; + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType) { + this._connectivityType = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType)arg).getConnectivityType(); + isValidArg = true; + } + if (arg instanceof org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters) { + this._signature = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getSignature(); + this._algorithm = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getAlgorithm(); + this._certificate = ((org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters)arg).getCertificate(); + isValidArg = true; + } + CodeHelpers.validValue(isValidArg, arg, "[org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.ConnectivityType, org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.SecurityParameters]"); + } + + public VirtualLinkDescKey key() { + return key; + } + + public String getAlgorithm() { + return _algorithm; + } + + public String getCertificate() { + return _certificate; + } + + public ConnectivityType getConnectivityType() { + return _connectivityType; + } + + public String getDescription() { + return _description; + } + + public Map getDf() { + return _df; + } + + public String getId() { + return _id; + } + + public String getSignature() { + return _signature; + } + + public VirtualLinkDesc.TestAccess getTestAccess() { + return _testAccess; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VirtualLinkDescBuilder withKey(final VirtualLinkDescKey key) { + this.key = key; + return this; + } + + public VirtualLinkDescBuilder setAlgorithm(final String value) { + this._algorithm = value; + return this; + } + + public VirtualLinkDescBuilder setCertificate(final String value) { + this._certificate = value; + return this; + } + + public VirtualLinkDescBuilder setConnectivityType(final ConnectivityType value) { + this._connectivityType = value; + return this; + } + + public VirtualLinkDescBuilder setDescription(final String value) { + this._description = value; + return this; + } + public VirtualLinkDescBuilder setDf(final Map values) { + this._df = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setDf(Map)} instead. + */ + @Deprecated(forRemoval = true) + @JsonIgnore + public VirtualLinkDescBuilder setDf(final List values) { + return setDf(CodeHelpers.compatMap(values)); + } + + public VirtualLinkDescBuilder setId(final String value) { + this._id = value; + return this; + } + + public VirtualLinkDescBuilder setSignature(final String value) { + this._signature = value; + return this; + } + + public VirtualLinkDescBuilder setTestAccess(final VirtualLinkDesc.TestAccess value) { + this._testAccess = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VirtualLinkDescBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VirtualLinkDescBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VirtualLinkDescBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VirtualLinkDescBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public VirtualLinkDesc build() { + return new VirtualLinkDescImpl(this); + } + + private static final class VirtualLinkDescImpl + extends AbstractAugmentable + implements VirtualLinkDesc { + + private final String _algorithm; + private final String _certificate; + private final ConnectivityType _connectivityType; + private final String _description; + private final Map _df; + private final String _id; + private final String _signature; + private final VirtualLinkDesc.TestAccess _testAccess; + private final VirtualLinkDescKey key; + + VirtualLinkDescImpl(VirtualLinkDescBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VirtualLinkDescKey(base.getId()); + } + this._id = key.getId(); + this._algorithm = base.getAlgorithm(); + this._certificate = base.getCertificate(); + this._connectivityType = base.getConnectivityType(); + this._description = base.getDescription(); + this._df = CodeHelpers.emptyToNull(base.getDf()); + this._signature = base.getSignature(); + this._testAccess = base.getTestAccess(); + } + + @Override + public VirtualLinkDescKey key() { + return key; + } + + @Override + public String getAlgorithm() { + return _algorithm; + } + + @Override + public String getCertificate() { + return _certificate; + } + + @Override + public ConnectivityType getConnectivityType() { + return _connectivityType; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public Map getDf() { + return _df; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getSignature() { + return _signature; + } + + @Override + public VirtualLinkDesc.TestAccess getTestAccess() { + return _testAccess; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_algorithm); + result = prime * result + Objects.hashCode(_certificate); + result = prime * result + Objects.hashCode(_connectivityType); + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_df); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_signature); + result = prime * result + Objects.hashCode(_testAccess); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!VirtualLinkDesc.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + VirtualLinkDesc other = (VirtualLinkDesc)obj; + if (!Objects.equals(_algorithm, other.getAlgorithm())) { + return false; + } + if (!Objects.equals(_certificate, other.getCertificate())) { + return false; + } + if (!Objects.equals(_connectivityType, other.getConnectivityType())) { + return false; + } + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_df, other.getDf())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_signature, other.getSignature())) { + return false; + } + if (!Objects.equals(_testAccess, other.getTestAccess())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VirtualLinkDescImpl otherImpl = (VirtualLinkDescImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("VirtualLinkDesc"); + CodeHelpers.appendValue(helper, "_algorithm", _algorithm); + CodeHelpers.appendValue(helper, "_certificate", _certificate); + CodeHelpers.appendValue(helper, "_connectivityType", _connectivityType); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_df", _df); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_signature", _signature); + CodeHelpers.appendValue(helper, "_testAccess", _testAccess); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java new file mode 100644 index 0000000000000000000000000000000000000000..c6d324d4e42406c454098431e284fc087ca5641c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VirtualLinkDescKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VirtualLinkDescKey + implements Identifier { + private static final long serialVersionUID = 6490584508262845370L; + private final String _id; + + + public VirtualLinkDescKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VirtualLinkDescKey(VirtualLinkDescKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VirtualLinkDescKey)) { + return false; + } + final VirtualLinkDescKey other = (VirtualLinkDescKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VirtualLinkDescKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java new file mode 100644 index 0000000000000000000000000000000000000000..0995e82a0f58c1cc7b84773a6cb25170faf52fed --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/Vnffgd.java @@ -0,0 +1,269 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.List; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.Nsd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPoolKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.Nfpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.NfpdKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Provides the descriptors of the applicable forwarding graphs. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list vnffgd {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf-list vnf-profile-id {
+ *     type leafref {
+ *       path ../../df/vnf-profile/id;
+ *     }
+ *   }
+ *   leaf-list pnf-profile-id {
+ *     type leafref {
+ *       path ../../df/pnf-profile/id;
+ *     }
+ *   }
+ *   leaf-list nested-ns-profile-id {
+ *     type leafref {
+ *       path ../../df/ns-profile/id;
+ *     }
+ *   }
+ *   leaf virtual-link-profile-id {
+ *     type leafref {
+ *       path ../../df/virtual-link-profile/id;
+ *     }
+ *   }
+ *   list cpd-pool {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     choice constituent-base-element-id {
+ *       case vnf-profile {
+ *         container vnf-profile {
+ *           leaf vnf-profile-id {
+ *             type leafref {
+ *               path ../../../../../nsd/df/vnf-profile/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case pnf-profile {
+ *         container pnf-profile {
+ *           leaf pnf-profile-id {
+ *             type leafref {
+ *               path ../../../../../nsd/df/pnf-profile/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case ns-profile {
+ *         container ns-profile {
+ *           leaf ns-profile-id {
+ *             type leafref {
+ *               path ../../../../../nsd/df/ns-profile/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *     choice constituent-cpd-id {
+ *       case vnf {
+ *         container vnf {
+ *           leaf vnfd-id {
+ *             type leafref {
+ *               path ../../../../../vnfd/id;
+ *             }
+ *           }
+ *           leaf cpd-id {
+ *             type leafref {
+ *               path deref(../vnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case pnf {
+ *         container pnf {
+ *           leaf pnfd-id {
+ *             type leafref {
+ *               path ../../../../../pnfd/id;
+ *             }
+ *           }
+ *           leaf pnf-cpd-id {
+ *             type leafref {
+ *               path deref(../pnfd-id)/../ext-cpd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *       case ns {
+ *         container ns {
+ *           leaf nsd-id {
+ *             type leafref {
+ *               path ../../../../../nsd/id;
+ *             }
+ *           }
+ *           leaf sap-cpd-id {
+ *             type leafref {
+ *               path deref(../nsd-id)/../sapd/id;
+ *             }
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ *   list nfpd {
+ *     key id;
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf rule {
+ *       type string;
+ *     }
+ *     list position-desc-id {
+ *       key id;
+ *       leaf id {
+ *         type string;
+ *       }
+ *       list cp-profile-id {
+ *         key id;
+ *         leaf id {
+ *           type string;
+ *         }
+ *         list constituent-profile-elements {
+ *           key id;
+ *           leaf id {
+ *             type string;
+ *           }
+ *           leaf cpd-id {
+ *             type string;
+ *           }
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/vnffgd + * + *

To create instances of this class use {@link VnffgdBuilder}. + * @see VnffgdBuilder + * @see VnffgdKey + * + */ +public interface Vnffgd + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("vnffgd"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Vnffgd.class; + } + + /** + * Identifier of this Vnffgd information element. It uniquely identifies a VNFFGD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References the VnfProfile of a constituent VNF. + * + * + * + * @return java.util.List vnfProfileId, or null if not present + */ + @Nullable List getVnfProfileId(); + + /** + * References the PnfProfile of a constituent PNF. + * + * + * + * @return java.util.List pnfProfileId, or null if not present + */ + @Nullable List getPnfProfileId(); + + /** + * References the NsProfile of a nestedNS. + * + * + * + * @return java.util.List nestedNsProfileId, or null if not present + */ + @Nullable List getNestedNsProfileId(); + + /** + * References the Virtual Link Profile of a constituent VL. + * + * + * + * @return java.lang.String virtualLinkProfileId, or null if not present + */ + @Nullable String getVirtualLinkProfileId(); + + /** + * Describes a pool of descriptors of connection points attached to one of the + * constituent VNFs and PNFs and/or one of the SAPs of the parent NS or of a nested + * NS. + * + * + * + * @return java.util.Map cpdPool, or null if not present + */ + @Nullable Map getCpdPool(); + + /** + * @return java.util.Map cpdPool, or an empty list if it is not present + */ + default @NonNull Map nonnullCpdPool() { + return CodeHelpers.nonnull(getCpdPool()); + } + + /** + * The network forwarding path associated to the VNFFG. + * + * + * + * @return java.util.Map nfpd, or null if not present + */ + @Nullable Map getNfpd(); + + /** + * @return java.util.Map nfpd, or an empty list if it is not present + */ + default @NonNull Map nonnullNfpd() { + return CodeHelpers.nonnull(getNfpd()); + } + + @Override + VnffgdKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..86c40243249a8ccb3e8a8098df62a7328a6d6757 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdBuilder.java @@ -0,0 +1,425 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPool; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.CpdPoolKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.Nfpd; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.vnffgd.NfpdKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link VnffgdBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     VnffgdBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new VnffgdBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of VnffgdBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see VnffgdBuilder + * @see Builder + * + */ +public class VnffgdBuilder implements Builder { + + private Map _cpdPool; + private String _id; + private List _nestedNsProfileId; + private Map _nfpd; + private List _pnfProfileId; + private String _virtualLinkProfileId; + private List _vnfProfileId; + private VnffgdKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public VnffgdBuilder() { + } + + public VnffgdBuilder(Vnffgd base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._cpdPool = base.getCpdPool(); + this._nestedNsProfileId = base.getNestedNsProfileId(); + this._nfpd = base.getNfpd(); + this._pnfProfileId = base.getPnfProfileId(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._vnfProfileId = base.getVnfProfileId(); + } + + + public VnffgdKey key() { + return key; + } + + public Map getCpdPool() { + return _cpdPool; + } + + public String getId() { + return _id; + } + + public List getNestedNsProfileId() { + return _nestedNsProfileId; + } + + public Map getNfpd() { + return _nfpd; + } + + public List getPnfProfileId() { + return _pnfProfileId; + } + + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + public List getVnfProfileId() { + return _vnfProfileId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public VnffgdBuilder withKey(final VnffgdKey key) { + this.key = key; + return this; + } + public VnffgdBuilder setCpdPool(final Map values) { + this._cpdPool = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setCpdPool(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnffgdBuilder setCpdPool(final List values) { + return setCpdPool(CodeHelpers.compatMap(values)); + } + + public VnffgdBuilder setId(final String value) { + this._id = value; + return this; + } + public VnffgdBuilder setNestedNsProfileId(final List values) { + this._nestedNsProfileId = values; + return this; + } + + public VnffgdBuilder setNfpd(final Map values) { + this._nfpd = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNfpd(Map)} instead. + */ + @Deprecated(forRemoval = true) + public VnffgdBuilder setNfpd(final List values) { + return setNfpd(CodeHelpers.compatMap(values)); + } + public VnffgdBuilder setPnfProfileId(final List values) { + this._pnfProfileId = values; + return this; + } + + + public VnffgdBuilder setVirtualLinkProfileId(final String value) { + this._virtualLinkProfileId = value; + return this; + } + public VnffgdBuilder setVnfProfileId(final List values) { + this._vnfProfileId = values; + return this; + } + + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public VnffgdBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public VnffgdBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public VnffgdBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private VnffgdBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Vnffgd build() { + return new VnffgdImpl(this); + } + + private static final class VnffgdImpl + extends AbstractAugmentable + implements Vnffgd { + + private final Map _cpdPool; + private final String _id; + private final List _nestedNsProfileId; + private final Map _nfpd; + private final List _pnfProfileId; + private final String _virtualLinkProfileId; + private final List _vnfProfileId; + private final VnffgdKey key; + + VnffgdImpl(VnffgdBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new VnffgdKey(base.getId()); + } + this._id = key.getId(); + this._cpdPool = CodeHelpers.emptyToNull(base.getCpdPool()); + this._nestedNsProfileId = base.getNestedNsProfileId(); + this._nfpd = CodeHelpers.emptyToNull(base.getNfpd()); + this._pnfProfileId = base.getPnfProfileId(); + this._virtualLinkProfileId = base.getVirtualLinkProfileId(); + this._vnfProfileId = base.getVnfProfileId(); + } + + @Override + public VnffgdKey key() { + return key; + } + + @Override + public Map getCpdPool() { + return _cpdPool; + } + + @Override + public String getId() { + return _id; + } + + @Override + public List getNestedNsProfileId() { + return _nestedNsProfileId; + } + + @Override + public Map getNfpd() { + return _nfpd; + } + + @Override + public List getPnfProfileId() { + return _pnfProfileId; + } + + @Override + public String getVirtualLinkProfileId() { + return _virtualLinkProfileId; + } + + @Override + public List getVnfProfileId() { + return _vnfProfileId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_cpdPool); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_nestedNsProfileId); + result = prime * result + Objects.hashCode(_nfpd); + result = prime * result + Objects.hashCode(_pnfProfileId); + result = prime * result + Objects.hashCode(_virtualLinkProfileId); + result = prime * result + Objects.hashCode(_vnfProfileId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Vnffgd.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Vnffgd other = (Vnffgd)obj; + if (!Objects.equals(_cpdPool, other.getCpdPool())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_nestedNsProfileId, other.getNestedNsProfileId())) { + return false; + } + if (!Objects.equals(_nfpd, other.getNfpd())) { + return false; + } + if (!Objects.equals(_pnfProfileId, other.getPnfProfileId())) { + return false; + } + if (!Objects.equals(_virtualLinkProfileId, other.getVirtualLinkProfileId())) { + return false; + } + if (!Objects.equals(_vnfProfileId, other.getVnfProfileId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + VnffgdImpl otherImpl = (VnffgdImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Vnffgd"); + CodeHelpers.appendValue(helper, "_cpdPool", _cpdPool); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_nestedNsProfileId", _nestedNsProfileId); + CodeHelpers.appendValue(helper, "_nfpd", _nfpd); + CodeHelpers.appendValue(helper, "_pnfProfileId", _pnfProfileId); + CodeHelpers.appendValue(helper, "_virtualLinkProfileId", _virtualLinkProfileId); + CodeHelpers.appendValue(helper, "_vnfProfileId", _vnfProfileId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java new file mode 100644 index 0000000000000000000000000000000000000000..c41f4d3034dd2006c412794f5437d071aecc71c7 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/VnffgdKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class VnffgdKey + implements Identifier { + private static final long serialVersionUID = -1143939609367754999L; + private final String _id; + + + public VnffgdKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public VnffgdKey(VnffgdKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof VnffgdKey)) { + return false; + } + final VnffgdKey other = (VnffgdKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(VnffgdKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java new file mode 100644 index 0000000000000000000000000000000000000000..35b8b33e047ebb1ee3b162c0daa66f69f5f8cf24 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroup.java @@ -0,0 +1,95 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies affinity or anti-affinity relationship applicable between the VNF + * instances created using different VNFDs, the Virtual Link instances created + * using different NsVirtualLinkDescs or the nested NS instances created using + * different NSDs in the same affinity or anti-affinity group. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list affinity-or-anti-affinity-group {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf type {
+ *     type affinity-type;
+ *   }
+ *   leaf scope {
+ *     type affinity-scope;
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/affinity-or-anti-affinity-group + * + *

To create instances of this class use {@link AffinityOrAntiAffinityGroupBuilder}. + * @see AffinityOrAntiAffinityGroupBuilder + * @see AffinityOrAntiAffinityGroupKey + * + */ +public interface AffinityOrAntiAffinityGroup + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("affinity-or-anti-affinity-group"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.AffinityOrAntiAffinityGroup.class; + } + + /** + * Identifier of Identifier of this AffinityOrAntiAffinityGroup information + * element. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Specifies the type of relationship that the members of the group have: + * 'affinity' or 'anti-affinity.' + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType type, or null if not present + */ + @Nullable AffinityType getType(); + + /** + * Specifies the scope of the affinity or anti-affinity relationship e.g. a NFVI + * node, an NFVI PoP, etc. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope scope, or null if not present + */ + @Nullable AffinityScope getScope(); + + @Override + AffinityOrAntiAffinityGroupKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..3df383ca0b8e46bd5e06c946075284ad577afe14 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityScope; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.AffinityType; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link AffinityOrAntiAffinityGroupBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     AffinityOrAntiAffinityGroupBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new AffinityOrAntiAffinityGroupBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of AffinityOrAntiAffinityGroupBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see AffinityOrAntiAffinityGroupBuilder + * @see Builder + * + */ +public class AffinityOrAntiAffinityGroupBuilder implements Builder { + + private String _id; + private AffinityScope _scope; + private AffinityType _type; + private AffinityOrAntiAffinityGroupKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public AffinityOrAntiAffinityGroupBuilder() { + } + + public AffinityOrAntiAffinityGroupBuilder(AffinityOrAntiAffinityGroup base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._scope = base.getScope(); + this._type = base.getType(); + } + + + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + public String getId() { + return _id; + } + + public AffinityScope getScope() { + return _scope; + } + + public AffinityType getType() { + return _type; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public AffinityOrAntiAffinityGroupBuilder withKey(final AffinityOrAntiAffinityGroupKey key) { + this.key = key; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setId(final String value) { + this._id = value; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setScope(final AffinityScope value) { + this._scope = value; + return this; + } + + public AffinityOrAntiAffinityGroupBuilder setType(final AffinityType value) { + this._type = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public AffinityOrAntiAffinityGroupBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public AffinityOrAntiAffinityGroupBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private AffinityOrAntiAffinityGroupBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public AffinityOrAntiAffinityGroup build() { + return new AffinityOrAntiAffinityGroupImpl(this); + } + + private static final class AffinityOrAntiAffinityGroupImpl + extends AbstractAugmentable + implements AffinityOrAntiAffinityGroup { + + private final String _id; + private final AffinityScope _scope; + private final AffinityType _type; + private final AffinityOrAntiAffinityGroupKey key; + + AffinityOrAntiAffinityGroupImpl(AffinityOrAntiAffinityGroupBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new AffinityOrAntiAffinityGroupKey(base.getId()); + } + this._id = key.getId(); + this._scope = base.getScope(); + this._type = base.getType(); + } + + @Override + public AffinityOrAntiAffinityGroupKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public AffinityScope getScope() { + return _scope; + } + + @Override + public AffinityType getType() { + return _type; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_scope); + result = prime * result + Objects.hashCode(_type); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!AffinityOrAntiAffinityGroup.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + AffinityOrAntiAffinityGroup other = (AffinityOrAntiAffinityGroup)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_scope, other.getScope())) { + return false; + } + if (!Objects.equals(_type, other.getType())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + AffinityOrAntiAffinityGroupImpl otherImpl = (AffinityOrAntiAffinityGroupImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("AffinityOrAntiAffinityGroup"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_scope", _scope); + CodeHelpers.appendValue(helper, "_type", _type); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java new file mode 100644 index 0000000000000000000000000000000000000000..392a584d3fe5308a1ec217a2a3d5c37304a53d4c --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/AffinityOrAntiAffinityGroupKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class AffinityOrAntiAffinityGroupKey + implements Identifier { + private static final long serialVersionUID = -4909084403753675647L; + private final String _id; + + + public AffinityOrAntiAffinityGroupKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public AffinityOrAntiAffinityGroupKey(AffinityOrAntiAffinityGroupKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof AffinityOrAntiAffinityGroupKey)) { + return false; + } + final AffinityOrAntiAffinityGroupKey other = (AffinityOrAntiAffinityGroupKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(AffinityOrAntiAffinityGroupKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java new file mode 100644 index 0000000000000000000000000000000000000000..3cb48702eae50974b6c20fd05ec867619f093e2f --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/Dependencies.java @@ -0,0 +1,112 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Specifies the order in which instances of the VNFs and/or nested NSs have to be + * created. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list dependencies {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   choice primary-id {
+ *     case primary-vnf-profile {
+ *       leaf primary-vnf-profile {
+ *         type leafref {
+ *           path ../../vnf-profile/vnfd-id;
+ *         }
+ *       }
+ *     }
+ *     case primary-ns-profile {
+ *       leaf primary-ns-profile {
+ *         type leafref {
+ *           path ../../ns-profile/nsd-id;
+ *         }
+ *       }
+ *     }
+ *   }
+ *   choice secondary-id {
+ *     case secondary-vnf-profile {
+ *       leaf secondary-vnf-profile {
+ *         type leafref {
+ *           path ../../vnf-profile/vnfd-id;
+ *         }
+ *       }
+ *     }
+ *     case secondary-ns-profile {
+ *       leaf secondary-ns-profile {
+ *         type leafref {
+ *           path ../../ns-profile/nsd-id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/dependencies + * + *

To create instances of this class use {@link DependenciesBuilder}. + * @see DependenciesBuilder + * @see DependenciesKey + * + */ +public interface Dependencies + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("dependencies"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.Dependencies.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References a VnfProfile or NsProfile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId primaryId, or null if not present + */ + @Nullable PrimaryId getPrimaryId(); + + /** + * References a VnfProfile or NsProfile. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId secondaryId, or null if not present + */ + @Nullable SecondaryId getSecondaryId(); + + @Override + DependenciesKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..1b96db5be6a2888c7fa11ab52d93e7df515a1e57 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.PrimaryId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.dependencies.SecondaryId; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link DependenciesBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     DependenciesBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new DependenciesBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of DependenciesBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see DependenciesBuilder + * @see Builder + * + */ +public class DependenciesBuilder implements Builder { + + private String _id; + private PrimaryId _primaryId; + private SecondaryId _secondaryId; + private DependenciesKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public DependenciesBuilder() { + } + + public DependenciesBuilder(Dependencies base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._primaryId = base.getPrimaryId(); + this._secondaryId = base.getSecondaryId(); + } + + + public DependenciesKey key() { + return key; + } + + public String getId() { + return _id; + } + + public PrimaryId getPrimaryId() { + return _primaryId; + } + + public SecondaryId getSecondaryId() { + return _secondaryId; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public DependenciesBuilder withKey(final DependenciesKey key) { + this.key = key; + return this; + } + + public DependenciesBuilder setId(final String value) { + this._id = value; + return this; + } + + public DependenciesBuilder setPrimaryId(final PrimaryId value) { + this._primaryId = value; + return this; + } + + public DependenciesBuilder setSecondaryId(final SecondaryId value) { + this._secondaryId = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public DependenciesBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public DependenciesBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public DependenciesBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private DependenciesBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public Dependencies build() { + return new DependenciesImpl(this); + } + + private static final class DependenciesImpl + extends AbstractAugmentable + implements Dependencies { + + private final String _id; + private final PrimaryId _primaryId; + private final SecondaryId _secondaryId; + private final DependenciesKey key; + + DependenciesImpl(DependenciesBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new DependenciesKey(base.getId()); + } + this._id = key.getId(); + this._primaryId = base.getPrimaryId(); + this._secondaryId = base.getSecondaryId(); + } + + @Override + public DependenciesKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public PrimaryId getPrimaryId() { + return _primaryId; + } + + @Override + public SecondaryId getSecondaryId() { + return _secondaryId; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_primaryId); + result = prime * result + Objects.hashCode(_secondaryId); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!Dependencies.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + Dependencies other = (Dependencies)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_primaryId, other.getPrimaryId())) { + return false; + } + if (!Objects.equals(_secondaryId, other.getSecondaryId())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + DependenciesImpl otherImpl = (DependenciesImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("Dependencies"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_primaryId", _primaryId); + CodeHelpers.appendValue(helper, "_secondaryId", _secondaryId); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java new file mode 100644 index 0000000000000000000000000000000000000000..cd0980f65fd7619a79cb6c00f70caae0a0ec52ad --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/DependenciesKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class DependenciesKey + implements Identifier { + private static final long serialVersionUID = -3074614359735867865L; + private final String _id; + + + public DependenciesKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public DependenciesKey(DependenciesKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DependenciesKey)) { + return false; + } + final DependenciesKey other = (DependenciesKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(DependenciesKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java new file mode 100644 index 0000000000000000000000000000000000000000..4624b0c4130b47a35a9cdcefa852e00a06f743f5 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfo.java @@ -0,0 +1,100 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list monitored-info {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   container vnf-indicator-info {
+ *     leaf vnfd-id {
+ *       type leafref {
+ *         path ../../../../../vnfd/id;
+ *       }
+ *     }
+ *     leaf vnf-indicator {
+ *       type leafref {
+ *         path deref(../vnfd-id)/../indicator/id;
+ *       }
+ *     }
+ *   }
+ *   container monitoring-parameter {
+ *     leaf id {
+ *       type string;
+ *     }
+ *     leaf name {
+ *       type string;
+ *     }
+ *     leaf performance-metric {
+ *       type string;
+ *     }
+ *     leaf collection-period {
+ *       type string;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/monitored-info + * + *

To create instances of this class use {@link MonitoredInfoBuilder}. + * @see MonitoredInfoBuilder + * @see MonitoredInfoKey + * + */ +public interface MonitoredInfo + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("monitored-info"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.MonitoredInfo.class; + } + + /** + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Uniquely identifies this VNF Indicator information element. + * + * + * + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo vnfIndicatorInfo, or null if not present + */ + @Nullable VnfIndicatorInfo getVnfIndicatorInfo(); + + /** + * @return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter monitoringParameter, or null if not present + */ + @Nullable MonitoringParameter getMonitoringParameter(); + + @Override + MonitoredInfoKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..62b2f8ecb41b2b7cf9d52a7a578508bf28926476 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoBuilder.java @@ -0,0 +1,296 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.MonitoringParameter; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.monitored.info.VnfIndicatorInfo; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link MonitoredInfoBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     MonitoredInfoBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new MonitoredInfoBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of MonitoredInfoBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see MonitoredInfoBuilder + * @see Builder + * + */ +public class MonitoredInfoBuilder implements Builder { + + private String _id; + private MonitoringParameter _monitoringParameter; + private VnfIndicatorInfo _vnfIndicatorInfo; + private MonitoredInfoKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public MonitoredInfoBuilder() { + } + + public MonitoredInfoBuilder(MonitoredInfo base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._monitoringParameter = base.getMonitoringParameter(); + this._vnfIndicatorInfo = base.getVnfIndicatorInfo(); + } + + + public MonitoredInfoKey key() { + return key; + } + + public String getId() { + return _id; + } + + public MonitoringParameter getMonitoringParameter() { + return _monitoringParameter; + } + + public VnfIndicatorInfo getVnfIndicatorInfo() { + return _vnfIndicatorInfo; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public MonitoredInfoBuilder withKey(final MonitoredInfoKey key) { + this.key = key; + return this; + } + + public MonitoredInfoBuilder setId(final String value) { + this._id = value; + return this; + } + + public MonitoredInfoBuilder setMonitoringParameter(final MonitoringParameter value) { + this._monitoringParameter = value; + return this; + } + + public MonitoredInfoBuilder setVnfIndicatorInfo(final VnfIndicatorInfo value) { + this._vnfIndicatorInfo = value; + return this; + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public MonitoredInfoBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public MonitoredInfoBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public MonitoredInfoBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private MonitoredInfoBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public MonitoredInfo build() { + return new MonitoredInfoImpl(this); + } + + private static final class MonitoredInfoImpl + extends AbstractAugmentable + implements MonitoredInfo { + + private final String _id; + private final MonitoringParameter _monitoringParameter; + private final VnfIndicatorInfo _vnfIndicatorInfo; + private final MonitoredInfoKey key; + + MonitoredInfoImpl(MonitoredInfoBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new MonitoredInfoKey(base.getId()); + } + this._id = key.getId(); + this._monitoringParameter = base.getMonitoringParameter(); + this._vnfIndicatorInfo = base.getVnfIndicatorInfo(); + } + + @Override + public MonitoredInfoKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public MonitoringParameter getMonitoringParameter() { + return _monitoringParameter; + } + + @Override + public VnfIndicatorInfo getVnfIndicatorInfo() { + return _vnfIndicatorInfo; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_monitoringParameter); + result = prime * result + Objects.hashCode(_vnfIndicatorInfo); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!MonitoredInfo.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + MonitoredInfo other = (MonitoredInfo)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_monitoringParameter, other.getMonitoringParameter())) { + return false; + } + if (!Objects.equals(_vnfIndicatorInfo, other.getVnfIndicatorInfo())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + MonitoredInfoImpl otherImpl = (MonitoredInfoImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("MonitoredInfo"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_monitoringParameter", _monitoringParameter); + CodeHelpers.appendValue(helper, "_vnfIndicatorInfo", _vnfIndicatorInfo); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java new file mode 100644 index 0000000000000000000000000000000000000000..0a9d41beaa49a69fab9a21ef02ba0a3ab749879a --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/MonitoredInfoKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class MonitoredInfoKey + implements Identifier { + private static final long serialVersionUID = -3390894449966734843L; + private final String _id; + + + public MonitoredInfoKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public MonitoredInfoKey(MonitoredInfoKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof MonitoredInfoKey)) { + return false; + } + final MonitoredInfoKey other = (MonitoredInfoKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(MonitoredInfoKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java new file mode 100644 index 0000000000000000000000000000000000000000..3c358f7c26f9c2ca3de1ac1ac1bb4477d30dd51e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevel.java @@ -0,0 +1,173 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMappingKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * Describes the details of an NS level. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ns-instantiation-level {
+ *   min-elements 1;
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   list vnf-to-level-mapping {
+ *     key vnf-profile-id;
+ *     leaf vnf-profile-id {
+ *       type leafref {
+ *         path ../../../vnf-profile/id;
+ *       }
+ *     }
+ *     leaf number-of-instances {
+ *       default 1;
+ *       type uint32;
+ *     }
+ *   }
+ *   list virtual-link-to-level-mapping {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     uses link-bitrate-requirements;
+ *   }
+ *   list ns-to-level-mapping {
+ *     key ns-profile-id;
+ *     leaf ns-profile-id {
+ *       type leafref {
+ *         path ../../../ns-profile/id;
+ *       }
+ *     }
+ *     leaf number-of-instances {
+ *       default 1;
+ *       type uint32;
+ *     }
+ *   }
+ *   must "(count(vnf-to-level-mapping) + count(virtual-link-to-level-mapping) + count(ns-to-level-mapping)) > 0" {
+ *     error-message
+ *       "At least one attribute between vnf-to-level-mapping, virtual-link-to-level-mapping and ns-to-level-mapping shall be present.";
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-instantiation-level + * + *

To create instances of this class use {@link NsInstantiationLevelBuilder}. + * @see NsInstantiationLevelBuilder + * @see NsInstantiationLevelKey + * + */ +public interface NsInstantiationLevel + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-instantiation-level"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsInstantiationLevel.class; + } + + /** + * Identifier of this NsLevel information element. It uniquely identifies an NS + * level within the DF. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Human readable description of the NS level. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Specifies the profile of the VNFs involved in this NS level and, for each of + * them, the required number of instances. + * + * + * + * @return java.util.Map vnfToLevelMapping, or null if not present + */ + @Nullable Map getVnfToLevelMapping(); + + /** + * @return java.util.Map vnfToLevelMapping, or an empty list if it is not present + */ + default @NonNull Map nonnullVnfToLevelMapping() { + return CodeHelpers.nonnull(getVnfToLevelMapping()); + } + + /** + * Specifies the profile of the VLs involved in this NS level and, for each of + * them, the needed bandwidth. + * + * + * + * @return java.util.Map virtualLinkToLevelMapping, or null if not present + */ + @Nullable Map getVirtualLinkToLevelMapping(); + + /** + * @return java.util.Map virtualLinkToLevelMapping, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkToLevelMapping() { + return CodeHelpers.nonnull(getVirtualLinkToLevelMapping()); + } + + /** + * Specifies the profile of the nested NSs involved in this NS level and, for each + * of them, the required number of instances. + * + * + * + * @return java.util.Map nsToLevelMapping, or null if not present + */ + @Nullable Map getNsToLevelMapping(); + + /** + * @return java.util.Map nsToLevelMapping, or an empty list if it is not present + */ + default @NonNull Map nonnullNsToLevelMapping() { + return CodeHelpers.nonnull(getNsToLevelMapping()); + } + + @Override + NsInstantiationLevelKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..9bd20c9ede9c6c152c2fb8a962508bb94a9442b3 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelBuilder.java @@ -0,0 +1,398 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.NsToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VirtualLinkToLevelMappingKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMapping; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.instantiation.level.VnfToLevelMappingKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link NsInstantiationLevelBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsInstantiationLevelBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsInstantiationLevelBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsInstantiationLevelBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsInstantiationLevelBuilder + * @see Builder + * + */ +public class NsInstantiationLevelBuilder implements Builder { + + private String _description; + private String _id; + private Map _nsToLevelMapping; + private Map _virtualLinkToLevelMapping; + private Map _vnfToLevelMapping; + private NsInstantiationLevelKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsInstantiationLevelBuilder() { + } + + public NsInstantiationLevelBuilder(NsInstantiationLevel base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._description = base.getDescription(); + this._nsToLevelMapping = base.getNsToLevelMapping(); + this._virtualLinkToLevelMapping = base.getVirtualLinkToLevelMapping(); + this._vnfToLevelMapping = base.getVnfToLevelMapping(); + } + + + public NsInstantiationLevelKey key() { + return key; + } + + public String getDescription() { + return _description; + } + + public String getId() { + return _id; + } + + public Map getNsToLevelMapping() { + return _nsToLevelMapping; + } + + public Map getVirtualLinkToLevelMapping() { + return _virtualLinkToLevelMapping; + } + + public Map getVnfToLevelMapping() { + return _vnfToLevelMapping; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsInstantiationLevelBuilder withKey(final NsInstantiationLevelKey key) { + this.key = key; + return this; + } + + public NsInstantiationLevelBuilder setDescription(final String value) { + this._description = value; + return this; + } + + public NsInstantiationLevelBuilder setId(final String value) { + this._id = value; + return this; + } + public NsInstantiationLevelBuilder setNsToLevelMapping(final Map values) { + this._nsToLevelMapping = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setNsToLevelMapping(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder setNsToLevelMapping(final List values) { + return setNsToLevelMapping(CodeHelpers.compatMap(values)); + } + public NsInstantiationLevelBuilder setVirtualLinkToLevelMapping(final Map values) { + this._virtualLinkToLevelMapping = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkToLevelMapping(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder setVirtualLinkToLevelMapping(final List values) { + return setVirtualLinkToLevelMapping(CodeHelpers.compatMap(values)); + } + public NsInstantiationLevelBuilder setVnfToLevelMapping(final Map values) { + this._vnfToLevelMapping = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVnfToLevelMapping(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder setVnfToLevelMapping(final List values) { + return setVnfToLevelMapping(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsInstantiationLevelBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsInstantiationLevelBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsInstantiationLevelBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsInstantiationLevelBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsInstantiationLevel build() { + return new NsInstantiationLevelImpl(this); + } + + private static final class NsInstantiationLevelImpl + extends AbstractAugmentable + implements NsInstantiationLevel { + + private final String _description; + private final String _id; + private final Map _nsToLevelMapping; + private final Map _virtualLinkToLevelMapping; + private final Map _vnfToLevelMapping; + private final NsInstantiationLevelKey key; + + NsInstantiationLevelImpl(NsInstantiationLevelBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsInstantiationLevelKey(base.getId()); + } + this._id = key.getId(); + this._description = base.getDescription(); + this._nsToLevelMapping = CodeHelpers.emptyToNull(base.getNsToLevelMapping()); + this._virtualLinkToLevelMapping = CodeHelpers.emptyToNull(base.getVirtualLinkToLevelMapping()); + this._vnfToLevelMapping = CodeHelpers.emptyToNull(base.getVnfToLevelMapping()); + } + + @Override + public NsInstantiationLevelKey key() { + return key; + } + + @Override + public String getDescription() { + return _description; + } + + @Override + public String getId() { + return _id; + } + + @Override + public Map getNsToLevelMapping() { + return _nsToLevelMapping; + } + + @Override + public Map getVirtualLinkToLevelMapping() { + return _virtualLinkToLevelMapping; + } + + @Override + public Map getVnfToLevelMapping() { + return _vnfToLevelMapping; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_description); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_nsToLevelMapping); + result = prime * result + Objects.hashCode(_virtualLinkToLevelMapping); + result = prime * result + Objects.hashCode(_vnfToLevelMapping); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsInstantiationLevel.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsInstantiationLevel other = (NsInstantiationLevel)obj; + if (!Objects.equals(_description, other.getDescription())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_nsToLevelMapping, other.getNsToLevelMapping())) { + return false; + } + if (!Objects.equals(_virtualLinkToLevelMapping, other.getVirtualLinkToLevelMapping())) { + return false; + } + if (!Objects.equals(_vnfToLevelMapping, other.getVnfToLevelMapping())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsInstantiationLevelImpl otherImpl = (NsInstantiationLevelImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsInstantiationLevel"); + CodeHelpers.appendValue(helper, "_description", _description); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_nsToLevelMapping", _nsToLevelMapping); + CodeHelpers.appendValue(helper, "_virtualLinkToLevelMapping", _virtualLinkToLevelMapping); + CodeHelpers.appendValue(helper, "_vnfToLevelMapping", _vnfToLevelMapping); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java new file mode 100644 index 0000000000000000000000000000000000000000..8e7bbaf8057d455b8cc5a9cebc98b12b7861b4da --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsInstantiationLevelKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsInstantiationLevelKey + implements Identifier { + private static final long serialVersionUID = -4181296861555412040L; + private final String _id; + + + public NsInstantiationLevelKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsInstantiationLevelKey(NsInstantiationLevelKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsInstantiationLevelKey)) { + return false; + } + final NsInstantiationLevelKey other = (NsInstantiationLevelKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsInstantiationLevelKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java new file mode 100644 index 0000000000000000000000000000000000000000..d4f852c2f809fb2d8d81798de11756cfef615146 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfile.java @@ -0,0 +1,208 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupIdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Specifies a NS Profile supported by this NS DF. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list ns-profile {
+ *   must "min-number-of-instances <= max-number-of-instances" {
+ *     error-message
+ *       "min-number-of-instances has to be less than or equalmax-number-of-instances.";
+ *   }
+ *   must boolean(../../nested-nsd-id[.=current()/nsd-id]) {
+ *     error-message
+ *       "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *   }
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf nsd-id {
+ *     type leafref {
+ *       path ../../../../nsd/id;
+ *     }
+ *   }
+ *   leaf ns-df-id {
+ *     type leafref {
+ *       path deref(../nsd-id)/../df/id;
+ *     }
+ *   }
+ *   leaf instantiation-level-id {
+ *     type leafref {
+ *       path deref(../ns-df-id)/../ns-instantiation-level/id;
+ *     }
+ *   }
+ *   leaf min-number-of-instances {
+ *     type uint16;
+ *     default 1;
+ *   }
+ *   leaf max-number-of-instances {
+ *     type uint16;
+ *     default 1;
+ *   }
+ *   list affinity-or-anti-affinity-group-id {
+ *     key id;
+ *     leaf id {
+ *       type leafref {
+ *         path ../../../affinity-or-anti-affinity-group/id;
+ *       }
+ *     }
+ *   }
+ *   list virtual-link-connectivity {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     list constituent-cpd-id {
+ *       key constituent-base-element-id;
+ *       leaf constituent-base-element-id {
+ *         type leafref {
+ *           path ../../../id;
+ *         }
+ *       }
+ *       leaf constituent-cpd-id {
+ *         type leafref {
+ *           path deref(../../../nsd-id)/../sapd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/ns-profile + * + *

To create instances of this class use {@link NsProfileBuilder}. + * @see NsProfileBuilder + * @see NsProfileKey + * + */ +public interface NsProfile + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("ns-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.NsProfile.class; + } + + /** + * Identifies an NS profile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Identifies the NSD applicable to NS instantiated according to this profile. + * + * + * + * @return java.lang.String nsdId, or null if not present + */ + @Nullable String getNsdId(); + + /** + * Identifies the applicable network service DF within the scope of the NSD. + * + * + * + * @return java.lang.String nsDfId, or null if not present + */ + @Nullable String getNsDfId(); + + /** + * Identifies the NS level within the referenced NS DF to be used in the context of + * the parent NS instantiation. If not present, the default NS instantiation level + * as declared in the referenced NSD shall be used. + * + * + * + * @return java.lang.String instantiationLevelId, or null if not present + */ + @Nullable String getInstantiationLevelId(); + + /** + * Minimum number of nested NS instances based on the referenced NSD that is + * permitted to exist for this NsProfile. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 minNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMinNumberOfInstances(); + + /** + * Maximum number of nested NS instances based on the referenced NSD that is + * permitted to exist for this NsProfile. + * + * + * + * @return org.opendaylight.yangtools.yang.common.Uint16 maxNumberOfInstances, or null if not present + */ + @Nullable Uint16 getMaxNumberOfInstances(); + + /** + * Identifies an affinity or anti-affinity group the NSs created according to this + * NsProfile belongs to. + * + * + * + * @return java.util.Map affinityOrAntiAffinityGroupId, or null if not present + */ + @Nullable Map getAffinityOrAntiAffinityGroupId(); + + /** + * @return java.util.Map affinityOrAntiAffinityGroupId, or an empty list if it is not present + */ + default @NonNull Map nonnullAffinityOrAntiAffinityGroupId() { + return CodeHelpers.nonnull(getAffinityOrAntiAffinityGroupId()); + } + + /** + * @return java.util.Map virtualLinkConnectivity, or null if not present + */ + @Nullable Map getVirtualLinkConnectivity(); + + /** + * @return java.util.Map virtualLinkConnectivity, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkConnectivity() { + return CodeHelpers.nonnull(getVirtualLinkConnectivity()); + } + + @Override + NsProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..c97ef61ed4e9b76c7a1ddccc6af67b782a3afb99 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileBuilder.java @@ -0,0 +1,474 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Integer; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupId; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.AffinityOrAntiAffinityGroupIdKey; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ns.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; +import org.opendaylight.yangtools.yang.common.Uint16; + +/** + * Class that builds {@link NsProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     NsProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new NsProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of NsProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see NsProfileBuilder + * @see Builder + * + */ +public class NsProfileBuilder implements Builder { + + private Map _affinityOrAntiAffinityGroupId; + private String _id; + private String _instantiationLevelId; + private Uint16 _maxNumberOfInstances; + private Uint16 _minNumberOfInstances; + private String _nsDfId; + private String _nsdId; + private Map _virtualLinkConnectivity; + private NsProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public NsProfileBuilder() { + } + + public NsProfileBuilder(NsProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._affinityOrAntiAffinityGroupId = base.getAffinityOrAntiAffinityGroupId(); + this._instantiationLevelId = base.getInstantiationLevelId(); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + this._nsDfId = base.getNsDfId(); + this._nsdId = base.getNsdId(); + this._virtualLinkConnectivity = base.getVirtualLinkConnectivity(); + } + + + public NsProfileKey key() { + return key; + } + + public Map getAffinityOrAntiAffinityGroupId() { + return _affinityOrAntiAffinityGroupId; + } + + public String getId() { + return _id; + } + + public String getInstantiationLevelId() { + return _instantiationLevelId; + } + + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + public String getNsDfId() { + return _nsDfId; + } + + public String getNsdId() { + return _nsdId; + } + + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public NsProfileBuilder withKey(final NsProfileKey key) { + this.key = key; + return this; + } + public NsProfileBuilder setAffinityOrAntiAffinityGroupId(final Map values) { + this._affinityOrAntiAffinityGroupId = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setAffinityOrAntiAffinityGroupId(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setAffinityOrAntiAffinityGroupId(final List values) { + return setAffinityOrAntiAffinityGroupId(CodeHelpers.compatMap(values)); + } + + public NsProfileBuilder setId(final String value) { + this._id = value; + return this; + } + + public NsProfileBuilder setInstantiationLevelId(final String value) { + this._instantiationLevelId = value; + return this; + } + + public NsProfileBuilder setMaxNumberOfInstances(final Uint16 value) { + this._maxNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMaxNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setMaxNumberOfInstances(final Integer value) { + return setMaxNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public NsProfileBuilder setMinNumberOfInstances(final Uint16 value) { + this._minNumberOfInstances = value; + return this; + } + + /** + * Utility migration setter. + * + * @param value field value in legacy type + * @return this builder + * @deprecated Use {#link setMinNumberOfInstances(Uint16)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setMinNumberOfInstances(final Integer value) { + return setMinNumberOfInstances(CodeHelpers.compatUint(value)); + } + + public NsProfileBuilder setNsDfId(final String value) { + this._nsDfId = value; + return this; + } + + public NsProfileBuilder setNsdId(final String value) { + this._nsdId = value; + return this; + } + public NsProfileBuilder setVirtualLinkConnectivity(final Map values) { + this._virtualLinkConnectivity = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkConnectivity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder setVirtualLinkConnectivity(final List values) { + return setVirtualLinkConnectivity(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public NsProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public NsProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public NsProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private NsProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public NsProfile build() { + return new NsProfileImpl(this); + } + + private static final class NsProfileImpl + extends AbstractAugmentable + implements NsProfile { + + private final Map _affinityOrAntiAffinityGroupId; + private final String _id; + private final String _instantiationLevelId; + private final Uint16 _maxNumberOfInstances; + private final Uint16 _minNumberOfInstances; + private final String _nsDfId; + private final String _nsdId; + private final Map _virtualLinkConnectivity; + private final NsProfileKey key; + + NsProfileImpl(NsProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new NsProfileKey(base.getId()); + } + this._id = key.getId(); + this._affinityOrAntiAffinityGroupId = CodeHelpers.emptyToNull(base.getAffinityOrAntiAffinityGroupId()); + this._instantiationLevelId = base.getInstantiationLevelId(); + this._maxNumberOfInstances = base.getMaxNumberOfInstances(); + this._minNumberOfInstances = base.getMinNumberOfInstances(); + this._nsDfId = base.getNsDfId(); + this._nsdId = base.getNsdId(); + this._virtualLinkConnectivity = CodeHelpers.emptyToNull(base.getVirtualLinkConnectivity()); + } + + @Override + public NsProfileKey key() { + return key; + } + + @Override + public Map getAffinityOrAntiAffinityGroupId() { + return _affinityOrAntiAffinityGroupId; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getInstantiationLevelId() { + return _instantiationLevelId; + } + + @Override + public Uint16 getMaxNumberOfInstances() { + return _maxNumberOfInstances; + } + + @Override + public Uint16 getMinNumberOfInstances() { + return _minNumberOfInstances; + } + + @Override + public String getNsDfId() { + return _nsDfId; + } + + @Override + public String getNsdId() { + return _nsdId; + } + + @Override + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_affinityOrAntiAffinityGroupId); + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_instantiationLevelId); + result = prime * result + Objects.hashCode(_maxNumberOfInstances); + result = prime * result + Objects.hashCode(_minNumberOfInstances); + result = prime * result + Objects.hashCode(_nsDfId); + result = prime * result + Objects.hashCode(_nsdId); + result = prime * result + Objects.hashCode(_virtualLinkConnectivity); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!NsProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + NsProfile other = (NsProfile)obj; + if (!Objects.equals(_affinityOrAntiAffinityGroupId, other.getAffinityOrAntiAffinityGroupId())) { + return false; + } + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_instantiationLevelId, other.getInstantiationLevelId())) { + return false; + } + if (!Objects.equals(_maxNumberOfInstances, other.getMaxNumberOfInstances())) { + return false; + } + if (!Objects.equals(_minNumberOfInstances, other.getMinNumberOfInstances())) { + return false; + } + if (!Objects.equals(_nsDfId, other.getNsDfId())) { + return false; + } + if (!Objects.equals(_nsdId, other.getNsdId())) { + return false; + } + if (!Objects.equals(_virtualLinkConnectivity, other.getVirtualLinkConnectivity())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + NsProfileImpl otherImpl = (NsProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("NsProfile"); + CodeHelpers.appendValue(helper, "_affinityOrAntiAffinityGroupId", _affinityOrAntiAffinityGroupId); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_instantiationLevelId", _instantiationLevelId); + CodeHelpers.appendValue(helper, "_maxNumberOfInstances", _maxNumberOfInstances); + CodeHelpers.appendValue(helper, "_minNumberOfInstances", _minNumberOfInstances); + CodeHelpers.appendValue(helper, "_nsDfId", _nsDfId); + CodeHelpers.appendValue(helper, "_nsdId", _nsdId); + CodeHelpers.appendValue(helper, "_virtualLinkConnectivity", _virtualLinkConnectivity); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java new file mode 100644 index 0000000000000000000000000000000000000000..29c568306c408115d67e4e419ae71de3f79d8aaa --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/NsProfileKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class NsProfileKey + implements Identifier { + private static final long serialVersionUID = 5077089461983925448L; + private final String _id; + + + public NsProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public NsProfileKey(NsProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof NsProfileKey)) { + return false; + } + final NsProfileKey other = (NsProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(NsProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java new file mode 100644 index 0000000000000000000000000000000000000000..85b64e5403fe535249becaf6ad44936ab97eb83e --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfile.java @@ -0,0 +1,123 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import java.util.Map; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list pnf-profile {
+ *   key id;
+ *   must boolean(../../pnfd-id[.=current()/pnfd-id]) {
+ *     error-message
+ *       "PNFDs in the profile has to be listed as a dependency of the network service descriptor.";
+ *   }
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf pnfd-id {
+ *     type leafref {
+ *       path ../../../../pnfd/id;
+ *     }
+ *   }
+ *   list virtual-link-connectivity {
+ *     key virtual-link-profile-id;
+ *     leaf virtual-link-profile-id {
+ *       type leafref {
+ *         path ../../../virtual-link-profile/id;
+ *       }
+ *     }
+ *     list constituent-cpd-id {
+ *       key constituent-base-element-id;
+ *       leaf constituent-base-element-id {
+ *         type leafref {
+ *           path ../../../id;
+ *         }
+ *       }
+ *       leaf constituent-cpd-id {
+ *         type leafref {
+ *           path deref(../../../pnfd-id)/../ext-cpd/id;
+ *         }
+ *       }
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/pnf-profile + * + *

To create instances of this class use {@link PnfProfileBuilder}. + * @see PnfProfileBuilder + * @see PnfProfileKey + * + */ +public interface PnfProfile + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("pnf-profile"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.PnfProfile.class; + } + + /** + * Identifier of this PnfProfile information element. It uniquely identifies a + * PnfProfile. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * References a PNFD. + * + * + * + * @return java.lang.String pnfdId, or null if not present + */ + @Nullable String getPnfdId(); + + /** + * Defines the connection information of the PNF, it contains connection + * relationship between a PNF connection point and a NS Virtual Link. + * + * + * + * @return java.util.Map virtualLinkConnectivity, or null if not present + */ + @Nullable Map getVirtualLinkConnectivity(); + + /** + * @return java.util.Map virtualLinkConnectivity, or an empty list if it is not present + */ + default @NonNull Map nonnullVirtualLinkConnectivity() { + return CodeHelpers.nonnull(getVirtualLinkConnectivity()); + } + + @Override + PnfProfileKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..e6f61b6837fe1fbca37abb49287d142daa3fdc74 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileBuilder.java @@ -0,0 +1,314 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivity; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.pnf.profile.VirtualLinkConnectivityKey; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link PnfProfileBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     PnfProfileBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new PnfProfileBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This pattern is supported by the immutable nature of PnfProfileBuilder, as instances can be freely passed around without + * worrying about synchronization issues. + * + *

+ * As a side note: method chaining results in: + *

    + *
  • very efficient Java bytecode, as the method invocation result, in this case the Builder reference, is + * on the stack, so further method invocations just need to fill method arguments for the next method + * invocation, which is terminated by {@link #build()}, which is then returned from the method
  • + *
  • better understanding by humans, as the scope of mutable state (the builder) is kept to a minimum and is + * very localized
  • + *
  • better optimization oportunities, as the object scope is minimized in terms of invocation (rather than + * method) stack, making escape analysis a lot + * easier. Given enough compiler (JIT/AOT) prowess, the cost of th builder object can be completely + * eliminated
  • + *
+ * + * @see PnfProfileBuilder + * @see Builder + * + */ +public class PnfProfileBuilder implements Builder { + + private String _id; + private String _pnfdId; + private Map _virtualLinkConnectivity; + private PnfProfileKey key; + + + Map>, Augmentation> augmentation = Collections.emptyMap(); + + public PnfProfileBuilder() { + } + + public PnfProfileBuilder(PnfProfile base) { + if (base instanceof AugmentationHolder) { + @SuppressWarnings("unchecked") + Map>, Augmentation> aug =((AugmentationHolder) base).augmentations(); + if (!aug.isEmpty()) { + this.augmentation = new HashMap<>(aug); + } + } + this.key = base.key(); + this._id = base.getId(); + this._pnfdId = base.getPnfdId(); + this._virtualLinkConnectivity = base.getVirtualLinkConnectivity(); + } + + + public PnfProfileKey key() { + return key; + } + + public String getId() { + return _id; + } + + public String getPnfdId() { + return _pnfdId; + } + + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + @SuppressWarnings({ "unchecked", "checkstyle:methodTypeParameterName"}) + public > E$$ augmentation(Class augmentationType) { + return (E$$) augmentation.get(Objects.requireNonNull(augmentationType)); + } + + public PnfProfileBuilder withKey(final PnfProfileKey key) { + this.key = key; + return this; + } + + public PnfProfileBuilder setId(final String value) { + this._id = value; + return this; + } + + public PnfProfileBuilder setPnfdId(final String value) { + this._pnfdId = value; + return this; + } + public PnfProfileBuilder setVirtualLinkConnectivity(final Map values) { + this._virtualLinkConnectivity = values; + return this; + } + + /** + * Utility migration setter. + * + * IMPORTANT NOTE: This method does not completely match previous mechanics, as the list is processed as + * during this method's execution. Any future modifications of the list are NOT + * reflected in this builder nor its products. + * + * @param values Legacy List of values + * @return this builder + * @throws IllegalArgumentException if the list contains entries with the same key + * @throws NullPointerException if the list contains a null entry + * @deprecated Use {#link #setVirtualLinkConnectivity(Map)} instead. + */ + @Deprecated(forRemoval = true) + public PnfProfileBuilder setVirtualLinkConnectivity(final List values) { + return setVirtualLinkConnectivity(CodeHelpers.compatMap(values)); + } + + /** + * Add an augmentation to this builder's product. + * + * @param augmentation augmentation to be added + * @return this builder + * @throws NullPointerException if {@code augmentation} is null + */ + public PnfProfileBuilder addAugmentation(Augmentation augmentation) { + return doAddAugmentation(augmentation.implementedInterface(), augmentation); + } + + /** + * Add or remove an augmentation to this builder's product. + * + * @param augmentationType augmentation type to be added or removed + * @param augmentationValue augmentation value, null if the augmentation type should be removed + * @return this builder + * @deprecated Use either {@link #addAugmentation(Augmentation)} or {@link #removeAugmentation(Class)} instead. + */ + @Deprecated(forRemoval = true) + public PnfProfileBuilder addAugmentation(Class> augmentationType, Augmentation augmentationValue) { + return augmentationValue == null ? removeAugmentation(augmentationType) : doAddAugmentation(augmentationType, augmentationValue); + } + + /** + * Remove an augmentation from this builder's product. If this builder does not track such an augmentation + * type, this method does nothing. + * + * @param augmentationType augmentation type to be removed + * @return this builder + */ + public PnfProfileBuilder removeAugmentation(Class> augmentationType) { + if (this.augmentation instanceof HashMap) { + this.augmentation.remove(augmentationType); + } + return this; + } + + private PnfProfileBuilder doAddAugmentation(Class> augmentationType, Augmentation augmentationValue) { + if (!(this.augmentation instanceof HashMap)) { + this.augmentation = new HashMap<>(); + } + + this.augmentation.put(augmentationType, augmentationValue); + return this; + } + + @Override + public PnfProfile build() { + return new PnfProfileImpl(this); + } + + private static final class PnfProfileImpl + extends AbstractAugmentable + implements PnfProfile { + + private final String _id; + private final String _pnfdId; + private final Map _virtualLinkConnectivity; + private final PnfProfileKey key; + + PnfProfileImpl(PnfProfileBuilder base) { + super(base.augmentation); + if (base.key() != null) { + this.key = base.key(); + } else { + this.key = new PnfProfileKey(base.getId()); + } + this._id = key.getId(); + this._pnfdId = base.getPnfdId(); + this._virtualLinkConnectivity = CodeHelpers.emptyToNull(base.getVirtualLinkConnectivity()); + } + + @Override + public PnfProfileKey key() { + return key; + } + + @Override + public String getId() { + return _id; + } + + @Override + public String getPnfdId() { + return _pnfdId; + } + + @Override + public Map getVirtualLinkConnectivity() { + return _virtualLinkConnectivity; + } + + private int hash = 0; + private volatile boolean hashValid = false; + + @Override + public int hashCode() { + if (hashValid) { + return hash; + } + + final int prime = 31; + int result = 1; + result = prime * result + Objects.hashCode(_id); + result = prime * result + Objects.hashCode(_pnfdId); + result = prime * result + Objects.hashCode(_virtualLinkConnectivity); + result = prime * result + Objects.hashCode(augmentations()); + + hash = result; + hashValid = true; + return result; + } + + @Override + public boolean equals(Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof DataObject)) { + return false; + } + if (!PnfProfile.class.equals(((DataObject)obj).implementedInterface())) { + return false; + } + PnfProfile other = (PnfProfile)obj; + if (!Objects.equals(_id, other.getId())) { + return false; + } + if (!Objects.equals(_pnfdId, other.getPnfdId())) { + return false; + } + if (!Objects.equals(_virtualLinkConnectivity, other.getVirtualLinkConnectivity())) { + return false; + } + if (getClass() == obj.getClass()) { + // Simple case: we are comparing against self + PnfProfileImpl otherImpl = (PnfProfileImpl) obj; + if (!Objects.equals(augmentations(), otherImpl.augmentations())) { + return false; + } + } else { + // Hard case: compare our augments with presence there... + for (Map.Entry>, Augmentation> e : augmentations().entrySet()) { + if (!e.getValue().equals(other.augmentation(e.getKey()))) { + return false; + } + } + // .. and give the other one the chance to do the same + if (!obj.equals(this)) { + return false; + } + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper("PnfProfile"); + CodeHelpers.appendValue(helper, "_id", _id); + CodeHelpers.appendValue(helper, "_pnfdId", _pnfdId); + CodeHelpers.appendValue(helper, "_virtualLinkConnectivity", _virtualLinkConnectivity); + CodeHelpers.appendValue(helper, "augmentation", augmentations().values()); + return helper.toString(); + } + } +} diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java new file mode 100644 index 0000000000000000000000000000000000000000..aaf8e8efe53a0225a1adbaa5945345769886af52 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/PnfProfileKey.java @@ -0,0 +1,62 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Override; +import java.lang.String; +import java.util.Objects; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.Identifier; + +public class PnfProfileKey + implements Identifier { + private static final long serialVersionUID = 944242176321633264L; + private final String _id; + + + public PnfProfileKey(String _id) { + + this._id = _id; + } + + /** + * Creates a copy from Source Object. + * + * @param source Source object + */ + public PnfProfileKey(PnfProfileKey source) { + this._id = source._id; + } + + + public String getId() { + return _id; + } + + + @Override + public int hashCode() { + return CodeHelpers.wrapperHashCode(_id); + } + + @Override + public final boolean equals(java.lang.Object obj) { + if (this == obj) { + return true; + } + if (!(obj instanceof PnfProfileKey)) { + return false; + } + final PnfProfileKey other = (PnfProfileKey) obj; + if (!Objects.equals(_id, other._id)) { + return false; + } + return true; + } + + @Override + public String toString() { + final MoreObjects.ToStringHelper helper = MoreObjects.toStringHelper(PnfProfileKey.class); + CodeHelpers.appendValue(helper, "_id", _id); + return helper.toString(); + } +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java new file mode 100644 index 0000000000000000000000000000000000000000..66f476894abc9c2470304f52d8723cf0b6c27931 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspect.java @@ -0,0 +1,102 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import java.lang.Class; +import java.lang.Override; +import java.lang.String; +import org.eclipse.jdt.annotation.NonNull; +import org.eclipse.jdt.annotation.Nullable; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.$YangModuleInfoImpl; +import org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.Df; +import org.opendaylight.yangtools.yang.binding.Augmentable; +import org.opendaylight.yangtools.yang.binding.ChildOf; +import org.opendaylight.yangtools.yang.binding.Identifiable; +import org.opendaylight.yangtools.yang.common.QName; + +/** + * The scaling aspects supported by this DF of the NS. + * + *

+ * This class represents the following YANG schema fragment defined in module etsi-nfv-descriptors + *

+ * list scaling-aspect {
+ *   key id;
+ *   leaf id {
+ *     type string;
+ *   }
+ *   leaf name {
+ *     type string;
+ *   }
+ *   leaf description {
+ *     type string;
+ *   }
+ *   leaf scaling-level {
+ *     type leafref {
+ *       path ../../ns-instantiation-level/id;
+ *     }
+ *   }
+ * }
+ * 
The schema path to identify an instance is + * etsi-nfv-descriptors/nsd/df/scaling-aspect + * + *

To create instances of this class use {@link ScalingAspectBuilder}. + * @see ScalingAspectBuilder + * @see ScalingAspectKey + * + */ +public interface ScalingAspect + extends + ChildOf, + Augmentable, + Identifiable +{ + + + + public static final @NonNull QName QNAME = $YangModuleInfoImpl.qnameOf("scaling-aspect"); + + @Override + default Class implementedInterface() { + return org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df.ScalingAspect.class; + } + + /** + * Identifier of this NsScalingAspect information element. It uniquely identifies + * the NS scaling aspect in an NSD. + * + * + * + * @return java.lang.String id, or null if not present + */ + @Nullable String getId(); + + /** + * Provides a human readable name of the NS scaling aspect. + * + * + * + * @return java.lang.String name, or null if not present + */ + @Nullable String getName(); + + /** + * Provides a human readable description of the NS scaling aspect. + * + * + * + * @return java.lang.String description, or null if not present + */ + @Nullable String getDescription(); + + /** + * Describes the details of an NS level. + * + * + * + * @return java.lang.String scalingLevel, or null if not present + */ + @Nullable String getScalingLevel(); + + @Override + ScalingAspectKey key(); + +} + diff --git a/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java new file mode 100644 index 0000000000000000000000000000000000000000..139601d920eda956c59c74c7c244acf1de813310 --- /dev/null +++ b/src/main/java/org/opendaylight/yang/gen/v1/urn/etsi/nfv/yang/etsi/nfv/descriptors/rev190425/nsd/df/ScalingAspectBuilder.java @@ -0,0 +1,317 @@ +package org.opendaylight.yang.gen.v1.urn.etsi.nfv.yang.etsi.nfv.descriptors.rev190425.nsd.df; +import com.google.common.base.MoreObjects; +import java.lang.Class; +import java.lang.Deprecated; +import java.lang.Object; +import java.lang.Override; +import java.lang.String; +import java.lang.SuppressWarnings; +import java.util.Collections; +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; +import org.opendaylight.yangtools.concepts.Builder; +import org.opendaylight.yangtools.yang.binding.AbstractAugmentable; +import org.opendaylight.yangtools.yang.binding.Augmentation; +import org.opendaylight.yangtools.yang.binding.AugmentationHolder; +import org.opendaylight.yangtools.yang.binding.CodeHelpers; +import org.opendaylight.yangtools.yang.binding.DataObject; + +/** + * Class that builds {@link ScalingAspectBuilder} instances. Overall design of the class is that of a + * fluent interface, where method chaining is used. + * + *

+ * In general, this class is supposed to be used like this template: + *

+ *   
+ *     ScalingAspectBuilder createTarget(int fooXyzzy, int barBaz) {
+ *         return new ScalingAspectBuilderBuilder()
+ *             .setFoo(new FooBuilder().setXyzzy(fooXyzzy).build())
+ *             .setBar(new BarBuilder().setBaz(barBaz).build())
+ *             .build();
+ *     }
+ *   
+ * 
+ * + *

+ * This