diff options
author | Enbo Wang <wangenbo@huawei.com> | 2020-03-05 02:11:13 +0800 |
---|---|---|
committer | Enbo Wang <wangenbo@huawei.com> | 2020-03-05 20:52:53 +0800 |
commit | 2aacf632e9d21e140b6a35a8096cca8d2b2329dd (patch) | |
tree | 575e9f41cf4ac982dab374c6f3044d9c126f8260 /bpmn/MSOCommonBPMN/src/main/java/org | |
parent | e0f2aae2a783beac292e51fb9ef13272ae050b67 (diff) |
Support PNF software upgrade workflow using SDNC LCM API
Issue-ID: SO-2589
Signed-off-by: Enbo Wang <wangenbo@huawei.com>
Change-Id: I4b6940c21b70eeeaf96e8781762cb7029572e7ae
Diffstat (limited to 'bpmn/MSOCommonBPMN/src/main/java/org')
10 files changed, 443 insertions, 3 deletions
diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/SDNCLcmPropertiesImpl.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/SDNCLcmPropertiesImpl.java index eb2567d47c..9b46611468 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/SDNCLcmPropertiesImpl.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/restproperties/SDNCLcmPropertiesImpl.java @@ -31,12 +31,14 @@ public class SDNCLcmPropertiesImpl implements SDNCLcmProperties { public static final String SDNC_HOST = "sdnc.host"; public static final String SDNC_AUTH = "sdnc.auth"; public static final String LCM_PATH = "sdnc.lcm.path"; + public static final String LCM_ACTION_TIMEOUT = "sdnc.lcm.actionTimeout"; public static final String DMAAP_HOST = "sdnc.dmaap.host"; public static final String DMAAP_AUTH = "sdnc.dmaap.auth"; - public static final String DMAAP_PARTITION = "sdnc.dmaap.partition"; public static final String DMAAP_TIMEOUT = "sdnc.dmaap.timeout"; public static final String DMAAP_ENVIRONMENT = "sdnc.dmaap.environment"; + + public static final String LCM_DMAAP_PARTITION = "sdnc.lcm.dmaap.partition"; public static final String LCM_DMAAP_READ_TOPIC = "sdnc.lcm.dmapp.readTopic"; public static final String LCM_DMAAP_WRITE_TOPIC = "sdnc.lcm.dmaap.writeTopic"; @@ -56,6 +58,12 @@ public class SDNCLcmPropertiesImpl implements SDNCLcmProperties { } @Override + public long getActionTimeout() { + String actionTimeout = UrnPropertiesReader.getVariable(LCM_ACTION_TIMEOUT); + return (actionTimeout != null) ? Long.parseLong(actionTimeout) : SDNCConstants.LCM_ACTION_TIMEOUT; + } + + @Override public String getBasicAuth() { return UrnPropertiesReader.getVariable(SDNC_AUTH); } @@ -72,7 +80,7 @@ public class SDNCLcmPropertiesImpl implements SDNCLcmProperties { @Override public String getDmaapPartition() { - String partition = UrnPropertiesReader.getVariable(DMAAP_PARTITION); + String partition = UrnPropertiesReader.getVariable(LCM_DMAAP_PARTITION); return (partition != null) ? partition : SDNCConstants.LCM_DMAAP_PARTITION; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/common/SDNCConstants.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/common/SDNCConstants.java index fd9412e70e..dcbb120c69 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/common/SDNCConstants.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/common/SDNCConstants.java @@ -45,5 +45,6 @@ public interface SDNCConstants { String LCM_DMAAP_READ_TOPIC = "SDNC-LCM-WRITE"; String LCM_DMAAP_WRITE_TOPIC = "SDNC-LCM-READ"; - int LCM_TIMEOUT = 300; + long LCM_ACTION_TIMEOUT = 300000; // Millisecond + int LCM_OUTPUT_SUCCESS_CODE = 400; } diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmActionConstants.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmActionConstants.java new file mode 100644 index 0000000000..8ab40cb08d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmActionConstants.java @@ -0,0 +1,28 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.sdnc.lcm; + +public interface SDNCLcmActionConstants { + String ACTIVATE_N_E_SW = "ActivateNESw"; + String DOWNLOAD_N_E_SW = "DownloadNESw"; + String UPGRADE_POST_CHECK = "UpgradePostCheck"; + String UPGRADE_PRE_CHECK = "UpgradePreCheck"; +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmClientBuilder.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmClientBuilder.java index 5616db3577..0f17c547b5 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmClientBuilder.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmClientBuilder.java @@ -39,6 +39,10 @@ public class SDNCLcmClientBuilder { sdncLcmProperties = pros; } + public SDNCLcmProperties getSDNCLcmProperties() { + return sdncLcmProperties; + } + public SDNCLcmRestClient newSDNCLcmRestClient(String operation) throws SDNCLcmClientBuilderException { URI pathUri; try { diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmProperties.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmProperties.java index df5fb3be0b..a21196e08f 100644 --- a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmProperties.java +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/SDNCLcmProperties.java @@ -27,6 +27,8 @@ public interface SDNCLcmProperties extends RestProperties { String getPath(); + long getActionTimeout(); + String getBasicAuth(); String getDmaapHost(); diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/ActivateNESwPayload.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/ActivateNESwPayload.java new file mode 100644 index 0000000000..d86d114a9f --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/ActivateNESwPayload.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.sdnc.lcm.beans.payload; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"ipaddressV4Oam", "playbookName", "swVersionToBeActivated"}) +public class ActivateNESwPayload { + + @JsonProperty(value = "ipaddress-v4-oam", required = true) + private String ipaddressV4Oam; + + @JsonProperty(value = "playbook-name") + private String playbookName; + + @JsonProperty(value = "swVersionToBeActivated", required = true) + private String swVersionToBeActivated; + + public String getIpaddressV4Oam() { + return ipaddressV4Oam; + } + + public void setIpaddressV4Oam(String value) { + this.ipaddressV4Oam = value; + } + + public String getPlaybookName() { + return playbookName; + } + + public void setPlaybookName(String value) { + this.playbookName = value; + } + + public String getSwVersionToBeActivated() { + return swVersionToBeActivated; + } + + public void setSwVersionToBeActivated(String value) { + this.swVersionToBeActivated = value; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/DownloadNESwPayload.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/DownloadNESwPayload.java new file mode 100644 index 0000000000..5dc5cf503d --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/DownloadNESwPayload.java @@ -0,0 +1,66 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.sdnc.lcm.beans.payload; + +import java.util.ArrayList; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"ipaddressV4Oam", "playbookName", "swToBeDownloaded"}) +public class DownloadNESwPayload { + + @JsonProperty(value = "ipaddress-v4-oam", required = true) + private String ipaddressV4Oam; + + @JsonProperty(value = "playbook-name") + private String playbookName; + + @JsonProperty(value = "swToBeDownloaded", required = true) + private List<SwToBeDownloadedElement> swToBeDownloaded = new ArrayList<>(); + + public String getIpaddressV4Oam() { + return ipaddressV4Oam; + } + + public void setIpaddressV4Oam(String value) { + this.ipaddressV4Oam = value; + } + + public String getPlaybookName() { + return playbookName; + } + + public void setPlaybookName(String value) { + this.playbookName = value; + } + + public List<SwToBeDownloadedElement> getSwToBeDownloaded() { + return swToBeDownloaded; + } + + public void setSwToBeDownloaded(List<SwToBeDownloadedElement> value) { + this.swToBeDownloaded = value; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/SwToBeDownloadedElement.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/SwToBeDownloadedElement.java new file mode 100644 index 0000000000..1a3529d7c4 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/SwToBeDownloadedElement.java @@ -0,0 +1,75 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.sdnc.lcm.beans.payload; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"swLocation", "swFileSize", "swFileCompression", "swFileFormat"}) +public class SwToBeDownloadedElement { + + @JsonProperty(value = "swLocation", required = true) + private String swLocation; + + @JsonProperty(value = "swFileSize") + private long swFileSize; + + @JsonProperty(value = "swFileCompression") + private String swFileCompression; + + @JsonProperty(value = "swFileFormat") + private String swFileFormat; + + public String getSwLocation() { + return swLocation; + } + + public void setSwLocation(String value) { + this.swLocation = value; + } + + public long getSwFileSize() { + return swFileSize; + } + + public void setSwFileSize(long value) { + this.swFileSize = value; + } + + public String getSwFileCompression() { + return swFileCompression; + } + + public void setSwFileCompression(String value) { + this.swFileCompression = value; + } + + public String getSwFileFormat() { + return swFileFormat; + } + + public void setSwFileFormat(String value) { + this.swFileFormat = value; + } + +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/UpgradePostCheckPayload.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/UpgradePostCheckPayload.java new file mode 100644 index 0000000000..76937d262c --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/UpgradePostCheckPayload.java @@ -0,0 +1,96 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.sdnc.lcm.beans.payload; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"ipaddressV4Oam", "playbookName", "oldSwVersion", "targetSwVersion", "ruleName", "additionalData"}) +public class UpgradePostCheckPayload { + + @JsonProperty(value = "ipaddress-v4-oam", required = true) + private String ipaddressV4Oam; + + @JsonProperty(value = "playbook-name") + private String playbookName; + + @JsonProperty(value = "oldSwVersion", required = true) + private String oldSwVersion; + + @JsonProperty(value = "targetSwVersion", required = true) + private String targetSwVersion; + + @JsonProperty(value = "ruleName", required = true) + private String ruleName; + + @JsonProperty(value = "additionalData") + private String additionalData; + + public String getIpaddressV4Oam() { + return ipaddressV4Oam; + } + + public void setIpaddressV4Oam(String value) { + this.ipaddressV4Oam = value; + } + + public String getPlaybookName() { + return playbookName; + } + + public void setPlaybookName(String value) { + this.playbookName = value; + } + + public String getOldSwVersion() { + return oldSwVersion; + } + + public void setOldSwVersion(String value) { + this.oldSwVersion = value; + } + + public String getTargetSwVersion() { + return targetSwVersion; + } + + public void setTargetSwVersion(String value) { + this.targetSwVersion = value; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String value) { + this.ruleName = value; + } + + public String getAdditionalData() { + return additionalData; + } + + public void setAdditionalData(String value) { + this.additionalData = value; + } +} diff --git a/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/UpgradePreCheckPayload.java b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/UpgradePreCheckPayload.java new file mode 100644 index 0000000000..d1a95b8418 --- /dev/null +++ b/bpmn/MSOCommonBPMN/src/main/java/org/onap/so/client/sdnc/lcm/beans/payload/UpgradePreCheckPayload.java @@ -0,0 +1,96 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2020 Huawei Technologies Co., Ltd. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.client.sdnc.lcm.beans.payload; + +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; + +@JsonInclude(JsonInclude.Include.NON_NULL) +@JsonPropertyOrder({"ipaddressV4Oam", "playbookName", "oldSwVersion", "targetSwVersion", "ruleName", "additionalData"}) +public class UpgradePreCheckPayload { + + @JsonProperty(value = "ipaddress-v4-oam", required = true) + private String ipaddressV4Oam; + + @JsonProperty(value = "playbook-name") + private String playbookName; + + @JsonProperty(value = "oldSwVersion", required = true) + private String oldSwVersion; + + @JsonProperty(value = "targetSwVersion", required = true) + private String targetSwVersion; + + @JsonProperty(value = "ruleName", required = true) + private String ruleName; + + @JsonProperty(value = "additionalData") + private String additionalData; + + public String getIpaddressV4Oam() { + return ipaddressV4Oam; + } + + public void setIpaddressV4Oam(String value) { + this.ipaddressV4Oam = value; + } + + public String getPlaybookName() { + return playbookName; + } + + public void setPlaybookName(String value) { + this.playbookName = value; + } + + public String getOldSwVersion() { + return oldSwVersion; + } + + public void setOldSwVersion(String value) { + this.oldSwVersion = value; + } + + public String getTargetSwVersion() { + return targetSwVersion; + } + + public void setTargetSwVersion(String value) { + this.targetSwVersion = value; + } + + public String getRuleName() { + return ruleName; + } + + public void setRuleName(String value) { + this.ruleName = value; + } + + public String getAdditionalData() { + return additionalData; + } + + public void setAdditionalData(String value) { + this.additionalData = value; + } +} |