diff options
author | 2017-01-31 11:40:03 +0100 | |
---|---|---|
committer | 2017-01-31 12:59:33 +0100 | |
commit | 025301d08b061482c1f046d562bf017c8cbcfe8d (patch) | |
tree | 68a2a549736c9bf0f7cd4e71c76e40ef7e2606f2 /adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso | |
parent | 2754ad52f833278a5c925bd788a16d1dce16a598 (diff) |
Initial OpenECOMP MSO commit
Change-Id: Ia6a7574859480717402cc2f22534d9973a78fa6d
Signed-off-by: ChrisC <cc697w@intl.att.com>
Diffstat (limited to 'adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso')
59 files changed, 4856 insertions, 0 deletions
diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java new file mode 100644 index 0000000000..af44ce42b6 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ContrailNetwork.java @@ -0,0 +1,86 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +import java.util.List; + +public class ContrailNetwork { + private String shared = "false"; + private String external = "false"; + private List<String> routeTargets; + private List<String> policyFqdns; + private List<String> routeTableFqdns; + + public ContrailNetwork() { + super(); + } + + public ContrailNetwork(String shared, String external, List<String> routeTargets, List<String> policyFqdns, List<String> routeTableFqdns) { + super(); + this.shared = shared; + this.external = external; + this.routeTargets = routeTargets; + this.policyFqdns = policyFqdns; + this.routeTableFqdns = routeTableFqdns; + } + + public String getShared() { + return shared; + } + + public void setShared(String shared) { + this.shared = shared; + } + + public String getExternal() { + return external; + } + + public void setExternal(String external) { + this.external = external; + } + + public List<String> getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List<String> routeTargets) { + this.routeTargets = routeTargets; + } + + public List<String> getPolicyFqdns() { + return policyFqdns; + } + + public void setPolicyFqdns(List<String> policyFqdns) { + this.policyFqdns = policyFqdns; + } + + public List<String> getRouteTableFqdns() { + return routeTableFqdns; + } + + public void setRouteTableFqdns(List<String> routeTableFqdns) { + this.routeTableFqdns = routeTableFqdns; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java new file mode 100644 index 0000000000..e756261afb --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkError.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "createNetworkError") +@NoJackson +public class CreateNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = -4283402447149144456L; + + public CreateNetworkError() { + super(""); + } + + public CreateNetworkError(String message) { + super(message); + } + + public CreateNetworkError(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(message, category, rolledBack, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java new file mode 100644 index 0000000000..b8c70dd193 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkRequest.java @@ -0,0 +1,191 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.openstack.beans.Subnet; +import org.openecomp.mso.entity.MsoRequest; + +import java.util.List; +import java.util.Map; +import java.util.HashMap; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +/* README +* 1) Used JAXB/Jettison - see @NoJackson annotation on class to get RootElements REad by RestEasy +* 2) due to 1) Maps need to use this format + +"networkParams": {"entry": [ + {"key": "network_id", + "value": "59ed7b41-2983-413f-ba93-e7d437433916"}, + {"key": "subnet_id", + "value": "086c9298-5c57-49b7-bb2b-6fd5730c5d92"}, + {"key": "server_name_0", + "value": "RaaNetwork1"} + ]}, + * 3) to output json see toJSonString method below which required the @JsonRootName annotation and the WRAP_ROOT feature enabled + * 4) Tryong to work with RESTEASY JACKSON and JAXB/JETTISON to conform to Json input/output specs +*/ +@JsonRootName("createNetworkRequest") +@XmlRootElement(name = "createNetworkRequest") +@NoJackson +public class CreateNetworkRequest extends NetworkRequestCommon { + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkName; + private String networkType; + private String networkTypeVersion; + private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON; + private List<Subnet> subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean failIfExists = false; + private Boolean backout = true; + private Map<String,String> networkParams = new HashMap<String, String>(); + private MsoRequest msoRequest = new MsoRequest(); + + public CreateNetworkRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getNetworkTypeVersion() { + return networkTypeVersion; + } + + public void setNetworkTypeVersion(String networkTypeVersion) { + this.networkTypeVersion = networkTypeVersion; + } + + public String getNetworkTechnology() { + return networkTechnology.toString(); + } + + public void setNetworkTechnology(String networkTechnology) { + this.networkTechnology = NetworkTechnology.valueOf(networkTechnology); + } + + public List<Subnet> getSubnets() { + return subnets; + } + + public void setSubnets(List<Subnet> subnets) { + this.subnets = subnets; + } + + public ProviderVlanNetwork getProviderVlanNetwork() { + return providerVlanNetwork; + } + + public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { + this.providerVlanNetwork = providerVlanNetwork; + } + + public ContrailNetwork getContrailNetwork() { + return contrailNetwork; + } + + public void setContrailNetwork(ContrailNetwork contrailNetwork) { + this.contrailNetwork = contrailNetwork; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map<String, String> getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map<String, String> networkParams) { + this.networkParams = networkParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public boolean isContrailRequest() { + return (networkTechnology == NetworkTechnology.CONTRAIL) && (contrailNetwork != null); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java new file mode 100644 index 0000000000..f47272f5db --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/CreateNetworkResponse.java @@ -0,0 +1,122 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.openstack.beans.NetworkRollback; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("createNetworkResponse") +@XmlRootElement(name = "createNetworkResponse") +@NoJackson +public class CreateNetworkResponse extends NetworkResponseCommon { + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private String networkFqdn; + private Boolean networkCreated; + private Map<String, String> subnetMap; + private NetworkRollback rollback = new NetworkRollback(); + + public CreateNetworkResponse() { + super(); + } + + public CreateNetworkResponse(String networkId, + String neutronNetworkId, + String networkStackId, + String networkFqdn, + Boolean networkCreated, + Map<String, String> subnetIdMap, + NetworkRollback rollback, + String messageId) { + super(messageId); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.networkStackId = networkStackId; + this.networkFqdn = networkFqdn; + this.networkCreated = networkCreated; + this.subnetMap = subnetIdMap; + this.rollback = rollback; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkFqdn() { + return networkFqdn; + } + + public void setNetworkFqdn(String networkFqdn) { + this.networkFqdn = networkFqdn; + } + + public Boolean getNetworkCreated() { + return networkCreated; + } + + public void setNetworkCreated(Boolean networkCreated) { + this.networkCreated = networkCreated; + } + + public Map<String, String> getSubnetMap() { + return subnetMap; + } + + public void setSubnetMap(Map<String, String> subnetMap) { + this.subnetMap = subnetMap; + } + + public NetworkRollback getRollback() { + return rollback; + } + + public void setRollback(NetworkRollback rollback) { + this.rollback = rollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java new file mode 100644 index 0000000000..22af7fe21b --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkError.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "deleteNetworkError") +@NoJackson +public class DeleteNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = 2735474165790444180L; + + public DeleteNetworkError() { + super(""); + } + + public DeleteNetworkError(String message) { + super(message); + } + + public DeleteNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java new file mode 100644 index 0000000000..62c308d142 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkRequest.java @@ -0,0 +1,93 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.entity.MsoRequest; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("deleteNetworkRequest") +@XmlRootElement(name = "deleteNetworkRequest") +@NoJackson +public class DeleteNetworkRequest extends NetworkRequestCommon { + + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkStackId; + private String networkType; + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteNetworkRequest() {} + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java new file mode 100644 index 0000000000..d6d295a53a --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/DeleteNetworkResponse.java @@ -0,0 +1,62 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("deleteNetworkResponse") +@XmlRootElement(name = "deleteNetworkResponse") +@NoJackson +public class DeleteNetworkResponse extends NetworkResponseCommon { + + private String networkId; + private Boolean networkDeleted; + + public DeleteNetworkResponse() { + super(); + } + + public DeleteNetworkResponse(String networkId, Boolean networkDeleted, String messageId) { + super(messageId); + this.networkId = networkId; + this.networkDeleted = networkDeleted; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public Boolean getNetworkDeleted() { + return networkDeleted; + } + + public void setNetworkDeleted(Boolean networkDeleted) { + this.networkDeleted = networkDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java new file mode 100644 index 0000000000..de37c3d8fd --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkExceptionResponse.java @@ -0,0 +1,69 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +public class NetworkExceptionResponse extends NetworkResponseCommon { + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public NetworkExceptionResponse () {} + + public NetworkExceptionResponse (String message) { + super(); + this.message = message; + } + + public NetworkExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java new file mode 100644 index 0000000000..d04e960b00 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkRequestCommon.java @@ -0,0 +1,95 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import java.io.ByteArrayOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.SerializationConfig; + +/** + * Everything that is common between all Network Requests. + */ +public abstract class NetworkRequestCommon { + private Boolean skipAAI = false; + private String messageId; + private String notificationUrl; + + public Boolean getSkipAAI() { + return skipAAI; + } + + public void setSkipAAI(Boolean skipAAI) { + this.skipAAI = skipAAI; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String getNotificationUrl() { + return notificationUrl; + } + + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + } + + public boolean isSynchronous() { + return notificationUrl == null || (notificationUrl != null && notificationUrl.isEmpty()); + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + // ignore + } + return jsonString; + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + // Shouldn't happen... + e.printStackTrace(); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java new file mode 100644 index 0000000000..e7cc9b9ceb --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkResponseCommon.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import java.io.ByteArrayOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.SerializationConfig; + +/** + * Everything that is common between all Volume Group Responses, except for QueryVolumeGroupResponse. + */ +public abstract class NetworkResponseCommon { + private String messageId; + + public NetworkResponseCommon() { + messageId = null; + } + + public NetworkResponseCommon(String messageId) { + this.messageId = messageId; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } catch (Exception e) { + // ignore + } + return jsonString; + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + // Shouldn't happen... + e.printStackTrace(); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java new file mode 100644 index 0000000000..62a821d658 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/NetworkTechnology.java @@ -0,0 +1,26 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +public enum NetworkTechnology { + NEUTRON, VMWARE, CONTRAIL +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java new file mode 100644 index 0000000000..3956d3e785 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/ProviderVlanNetwork.java @@ -0,0 +1,56 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import java.util.List; + +public class ProviderVlanNetwork { + private String physicalNetworkName; + private List<Integer> vlans; + + public ProviderVlanNetwork() { + super(); + } + + public ProviderVlanNetwork(String physicalNetworkName, List<Integer> vlans) { + super(); + this.physicalNetworkName = physicalNetworkName; + this.vlans = vlans; + } + + public String getPhysicalNetworkName() { + return physicalNetworkName; + } + + public void setPhysicalNetworkName(String physicalNetworkName) { + this.physicalNetworkName = physicalNetworkName; + } + + public List<Integer> getVlans() { + return vlans; + } + + public void setVlans(List<Integer> vlans) { + this.vlans = vlans; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java new file mode 100644 index 0000000000..2b602f6882 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkError.java @@ -0,0 +1,34 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "queryNetworkError") +@NoJackson +public class QueryNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = -6125469596399867146L; +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java new file mode 100644 index 0000000000..e79b463f93 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/QueryNetworkResponse.java @@ -0,0 +1,144 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.openstack.beans.NetworkStatus; + +import java.util.List; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.ObjectMapper; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "queryNetworkResponse") +@NoJackson +public class QueryNetworkResponse { + private String networkId; + private String neutronNetworkId; + private String networkStackId; + private Boolean networkExists; + private NetworkStatus networkStatus; + private List<Integer> vlans; + private List<String> routeTargets; + private Map<String, String> subnetIdMap; + private Map<String, String> networkOutputs; + + public QueryNetworkResponse() { + super(); + } + + public QueryNetworkResponse(String networkId, String neutronNetworkId, + String networkStackId, NetworkStatus networkStatus, + Map<String, String> networkOutputs) { + super(); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.networkStackId = networkStackId; + this.networkStatus = networkStatus; + this.networkOutputs = networkOutputs; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public NetworkStatus getNetworkStatus() { + return networkStatus; + } + + public void setNetworkStatus(NetworkStatus networkStatus) { + this.networkStatus = networkStatus; + } + + public Boolean getNetworkExists() { + return networkExists; + } + + public void setNetworkExists(Boolean networkExists) { + this.networkExists = networkExists; + } + + public List<Integer> getVlans() { + return vlans; + } + + public void setVlans(List<Integer> vlans) { + this.vlans = vlans; + } + + public List<String> getRouteTargets() { + return routeTargets; + } + + public void setRouteTargets(List<String> routeTargets) { + this.routeTargets = routeTargets; + } + + public Map<String, String> getSubnetIdMap() { + return subnetIdMap; + } + + public void setSubnetIdMap(Map<String, String> subnetIdMap) { + this.subnetIdMap = subnetIdMap; + } + + public Map<String, String> getNetworkOutputs() { + return networkOutputs; + } + + public void setNetworkOutputs(Map<String, String> networkOutputs) { + this.networkOutputs = networkOutputs; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + jsonString = mapper.writeValueAsString(this); + } + catch (Exception e) {} + return jsonString; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java new file mode 100644 index 0000000000..9e6a328998 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkError.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "rollbackNetworkError") +@NoJackson +public class RollbackNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = -3954464103037391980L; + + public RollbackNetworkError() { + super(""); + } + + public RollbackNetworkError(String message) { + super(message); + } + + public RollbackNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java new file mode 100644 index 0000000000..37751149b9 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkRequest.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.openstack.beans.NetworkRollback; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("rollbackNetworkRequest") +@XmlRootElement(name = "rollbackNetworkRequest") +@NoJackson +public class RollbackNetworkRequest extends NetworkRequestCommon { + private NetworkRollback networkRollback; + + public RollbackNetworkRequest() { + super(); + } + + public NetworkRollback getNetworkRollback() { + return networkRollback; + } + + public void setNetworkRollback(NetworkRollback networkRollback) { + this.networkRollback = networkRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java new file mode 100644 index 0000000000..a7b3c16efa --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/RollbackNetworkResponse.java @@ -0,0 +1,53 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("rollbackNetworkResponse") +@XmlRootElement(name = "rollbackNetworkResponse") +@NoJackson +public class RollbackNetworkResponse extends NetworkResponseCommon { + + private Boolean networkRolledBack; + + public RollbackNetworkResponse() { + super(); + } + + public RollbackNetworkResponse(Boolean networkRolledBack, String messageId) { + super(messageId); + this.networkRolledBack = networkRolledBack; + } + + public Boolean getNetworkRolledBack() { + return networkRolledBack; + } + + public void setNetworkRolledBack(Boolean networkRolledBack) { + this.networkRolledBack = networkRolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java new file mode 100644 index 0000000000..f7066daa83 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkError.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + +import java.io.Serializable; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "updateNetworkError") +@NoJackson +public class UpdateNetworkError extends NetworkExceptionResponse implements Serializable { + private static final long serialVersionUID = 46820809807914392L; + + public UpdateNetworkError() { + super(""); + } + + public UpdateNetworkError(String message) { + super(message); + } + + public UpdateNetworkError(String message, MsoExceptionCategory category, boolean unused, String messageid) { + super(message, category, unused, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java new file mode 100644 index 0000000000..5ddc050131 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkRequest.java @@ -0,0 +1,178 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import org.openecomp.mso.entity.MsoRequest; +import org.openecomp.mso.openstack.beans.Subnet; + +import java.util.Map; +import java.util.HashMap; +import java.util.List; + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("updateNetworkRequest") +@XmlRootElement(name = "updateNetworkRequest") +@NoJackson +public class UpdateNetworkRequest extends NetworkRequestCommon { + private String cloudSiteId; + private String tenantId; + private String networkId; + private String networkStackId; + private String networkName; + private String networkType; + private String networkTypeVersion; + private NetworkTechnology networkTechnology = NetworkTechnology.NEUTRON; + private List<Subnet> subnets; + private ProviderVlanNetwork providerVlanNetwork; + private ContrailNetwork contrailNetwork; + private Boolean backout = true; + private Map<String,String> networkParams = new HashMap<String, String>(); + private MsoRequest msoRequest = new MsoRequest(); + + public UpdateNetworkRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNetworkStackId() { + return networkStackId; + } + + public void setNetworkStackId(String networkStackId) { + this.networkStackId = networkStackId; + } + + public String getNetworkName() { + return networkName; + } + + public void setNetworkName(String networkName) { + this.networkName = networkName; + } + + public String getNetworkType() { + return networkType; + } + + public void setNetworkType(String networkType) { + this.networkType = networkType; + } + + public String getNetworkTypeVersion() { + return networkTypeVersion; + } + + public void setNetworkTypeVersion(String networkTypeVersion) { + this.networkTypeVersion = networkTypeVersion; + } + + public String getNetworkTechnology() { + return networkTechnology.toString(); + } + + public void setNetworkTechnology(String networkTechnology) { + try { + this.networkTechnology = NetworkTechnology.valueOf(networkTechnology.toUpperCase()); + } catch (IllegalArgumentException e) { + // ignore + } + } + + public List<Subnet> getSubnets() { + return subnets; + } + + public void setSubnets(List<Subnet> subnets) { + this.subnets = subnets; + } + + public ProviderVlanNetwork getProviderVlanNetwork() { + return providerVlanNetwork; + } + + public void setProviderVlanNetwork(ProviderVlanNetwork providerVlanNetwork) { + this.providerVlanNetwork = providerVlanNetwork; + } + + public ContrailNetwork getContrailNetwork() { + return contrailNetwork; + } + + public void setContrailNetwork(ContrailNetwork contrailNetwork) { + this.contrailNetwork = contrailNetwork; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map<String, String> getNetworkParams() { + return networkParams; + } + + public void setNetworkParams(Map<String, String> networkParams) { + this.networkParams = networkParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + public boolean isContrailRequest() { + return (networkTechnology == NetworkTechnology.CONTRAIL) && (contrailNetwork != null); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java new file mode 100644 index 0000000000..d1531bf1ff --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/nwrest/UpdateNetworkResponse.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.nwrest; + + + +import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("updateNetworkResponse") +@XmlRootElement(name = "updateNetworkResponse") +@NoJackson +public class UpdateNetworkResponse extends NetworkResponseCommon { + + private String networkId; + private String neutronNetworkId; + private Map<String, String> subnetMap; + + public UpdateNetworkResponse() { + } + + public UpdateNetworkResponse(String networkId, String neutronNetworkId, + Map<String, String> subnetMap, String messageId) { + super(messageId); + this.networkId = networkId; + this.neutronNetworkId = neutronNetworkId; + this.subnetMap = subnetMap; + } + + public String getNetworkId() { + return networkId; + } + + public void setNetworkId(String networkId) { + this.networkId = networkId; + } + + public String getNeutronNetworkId() { + return neutronNetworkId; + } + + public void setNeutronNetworkId(String neutronNetworkId) { + this.neutronNetworkId = neutronNetworkId; + } + + public Map<String, String> getSubnetMap() { + return subnetMap; + } + + public void setSubnetMap(Map<String, String> subnetMap) { + this.subnetMap = subnetMap; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java new file mode 100644 index 0000000000..2a624a8934 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantError.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "createTenantError") +@NoJackson +public class CreateTenantError implements Serializable { + private static final long serialVersionUID = 7305288262646805568L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public CreateTenantError () {} + + public CreateTenantError (String message) { + this.message = message; + } + + public CreateTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java new file mode 100644 index 0000000000..3bfaf05b15 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantRequest.java @@ -0,0 +1,98 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import org.openecomp.mso.entity.MsoRequest; +import java.util.Map; +import java.util.HashMap; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "createTenantRequest") +@NoJackson +public class CreateTenantRequest extends TenantRequestCommon { + private String cloudSiteId; + private String tenantName; + private Boolean failIfExists; + private Boolean backout; + private Map<String,String> metadata = new HashMap<String, String>(); + private MsoRequest msoRequest = new MsoRequest(); + + public CreateTenantRequest() {} + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantName() { + return tenantName; + } + + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map<String, String> getMetadata() { + return metadata; + } + + public void setMetadata(Map<String, String> metadata) { + this.metadata = metadata; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "CreateTenantRequest [cloudSiteId=" + cloudSiteId + + ", tenantName=" + tenantName + ", failIfExists=" + + failIfExists + ", backout=" + backout + ", metadata=" + + metadata + "]"; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java new file mode 100644 index 0000000000..d25d2b47c8 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/CreateTenantResponse.java @@ -0,0 +1,86 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "createTenantResponse") +@NoJackson +public class CreateTenantResponse implements Serializable { + private static final long serialVersionUID = -456155026754759682L; + private String cloudSiteId; + private String tenantId; + private Boolean tenantCreated; + private TenantRollback tenantRollback = new TenantRollback(); + + public CreateTenantResponse() {} + + public CreateTenantResponse(String cloudSiteId, String tenantId, + Boolean tenantCreated, TenantRollback tenantRollback) { + this.cloudSiteId = cloudSiteId; + this.tenantId = tenantId; + this.tenantCreated = tenantCreated; + this.tenantRollback = tenantRollback; + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public Boolean getTenantCreated() { + return tenantCreated; + } + + public void setTenantCreated(Boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public TenantRollback getTenantRollback() { + return tenantRollback; + } + + public void setTenantRollback(TenantRollback tenantRollback) { + this.tenantRollback = tenantRollback; + } + + @Override + public String toString() { + return "CreateTenantResponse [cloudSiteId=" + cloudSiteId + + ", tenantId=" + tenantId + ", tenantCreated=" + tenantCreated + + ", tenantRollback=" + tenantRollback.toString() + "]"; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java new file mode 100644 index 0000000000..e55e58f294 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantError.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "deleteTenantError") +@NoJackson +public class DeleteTenantError implements Serializable { + private static final long serialVersionUID = -5778340182805870809L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public DeleteTenantError () {} + + public DeleteTenantError (String message) { + this.message = message; + } + + public DeleteTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java new file mode 100644 index 0000000000..8efb10b83f --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantRequest.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import org.openecomp.mso.entity.MsoRequest; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "deleteTenantRequest") +@NoJackson +public class DeleteTenantRequest extends TenantRequestCommon { + + private String cloudSiteId; + private String tenantId; + + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteTenantRequest() {} + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java new file mode 100644 index 0000000000..f2a1d38171 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/DeleteTenantResponse.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "deleteTenantResponse") +@NoJackson +public class DeleteTenantResponse { + + private Boolean tenantDeleted; + + public DeleteTenantResponse() {} + + public Boolean getTenantDeleted() { + return tenantDeleted; + } + + public void setTenantDeleted(Boolean tenantDeleted) { + this.tenantDeleted = tenantDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java new file mode 100644 index 0000000000..531a683aca --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/HealthCheckHandler.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import javax.ws.rs.GET; +import javax.ws.rs.HEAD; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.Response; + +import org.apache.http.HttpStatus; + +import org.openecomp.mso.logger.MsoLogger; + +@Path("/") +public class HealthCheckHandler { + + private static MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.RA); + private static final String CHECK_HTML = "<!DOCTYPE html><html><head><meta charset=\"ISO-8859-1\"><title>Health Check</title></head><body>Application ready</body></html>"; + private static final Response HEALTH_CHECK_RESPONSE = Response.status (HttpStatus.SC_OK) + .entity (CHECK_HTML) + .build (); + @HEAD + @GET + @Path("/healthcheck") + @Produces("text/html") + public Response healthcheck () { + msoLogger.debug ("Health check call in Tenant Adapter"); + return HEALTH_CHECK_RESPONSE; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java new file mode 100644 index 0000000000..100df47018 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantError.java @@ -0,0 +1,63 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "queryTenantError") +@NoJackson +public class QueryTenantError implements Serializable { + private static final long serialVersionUID = 7358240830662453507L; + private String message; + private MsoExceptionCategory category; + + public QueryTenantError () {} + + public QueryTenantError (String message) { + this.message = message; + } + + public QueryTenantError (String message, MsoExceptionCategory category) { + this.message = message; + this.category = category; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java new file mode 100644 index 0000000000..5fb5db7b5e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/QueryTenantResponse.java @@ -0,0 +1,64 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "queryTenantResponse") +@NoJackson +public class QueryTenantResponse extends TenantRequestCommon { + private String tenantId; + private String tenantName; + private Map<String,String> metadata; + + public QueryTenantResponse() {} + + public QueryTenantResponse (String id, String name, Map<String,String> metadata) { + this.tenantId = id; + this.tenantName = name; + this.metadata = metadata; + } + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getTenantName() { + return tenantName; + } + public void setTenantName(String tenantName) { + this.tenantName = tenantName; + } + + public Map<String, String> getMetadata() { + return metadata; + } + public void setMetadata(Map<String, String> metadata) { + this.metadata = metadata; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java new file mode 100644 index 0000000000..0327cefbd5 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantError.java @@ -0,0 +1,73 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "rollbackTenantError") +@NoJackson +public class RollbackTenantError implements Serializable { + private static final long serialVersionUID = -5313713674529615223L; + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public RollbackTenantError () {} + + public RollbackTenantError (String message) { + this.message = message; + } + + public RollbackTenantError (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java new file mode 100644 index 0000000000..a78da38692 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantRequest.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "rollbackTenantRequest") +@NoJackson +public class RollbackTenantRequest extends TenantRequestCommon { + + private TenantRollback tenantRollback; + + public RollbackTenantRequest() {} + + public TenantRollback getTenantRollback() { + return tenantRollback; + } + + public void setTenantRollback(TenantRollback tenantRollback) { + this.tenantRollback = tenantRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java new file mode 100644 index 0000000000..ec9632fbc5 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/RollbackTenantResponse.java @@ -0,0 +1,43 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "rollbackTenantResponse") +@NoJackson +public class RollbackTenantResponse { + + private Boolean tenantRolledback; + + public RollbackTenantResponse() {} + + public Boolean getTenantRolledback() { + return tenantRolledback; + } + + public void setTenantRolledback(Boolean tenantRolledback) { + this.tenantRolledback = tenantRolledback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java new file mode 100644 index 0000000000..5a79243e42 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantExceptionResponse.java @@ -0,0 +1,76 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@XmlRootElement(name = "createTenantResponse") +@NoJackson +public class TenantExceptionResponse implements Serializable { + + private static final long serialVersionUID = -9062290006520066109L; + + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public TenantExceptionResponse () {} + + public TenantExceptionResponse (String message) { + this.message = message; + } + + public TenantExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack) { + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } + +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java new file mode 100644 index 0000000000..972d5eb6fa --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRequestCommon.java @@ -0,0 +1,61 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + +import java.io.ByteArrayOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.SerializationConfig; + +public class TenantRequestCommon { + public String toJsonString() { + try { + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + // Shouldn't happen... + e.printStackTrace(); + return ""; + } + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + // Shouldn't happen... + e.printStackTrace(); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java new file mode 100644 index 0000000000..3d346afabe --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/tenantrest/TenantRollback.java @@ -0,0 +1,81 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.tenantrest; + + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.openecomp.mso.entity.MsoRequest; +import org.jboss.resteasy.annotations.providers.NoJackson; + +/** + * Javabean representing the rollback criteria following a "Create Tenant" + * operation. This structure can be passed back to the "Rollback Tenant" + * operation to undo the effects of the create. + * + * + */ + +@XmlRootElement(name = "rollbackTenantRequest") +@NoJackson +public class TenantRollback extends TenantRequestCommon { + private String tenantId; + private String cloudId; + private boolean tenantCreated = false; + private MsoRequest msoRequest; + + public TenantRollback() {} + + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getCloudId() { + return cloudId; + } + public void setCloudId(String cloudId) { + this.cloudId = cloudId; + } + + public boolean getTenantCreated() { + return tenantCreated; + } + public void setTenantCreated(boolean tenantCreated) { + this.tenantCreated = tenantCreated; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest (MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + + @Override + public String toString() { + return "VnfRollback: cloud=" + cloudId + ", tenant=" + tenantId + + ", tenantCreated=" + tenantCreated; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java new file mode 100644 index 0000000000..f337c4c9de --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleRequest.java @@ -0,0 +1,212 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import org.openecomp.mso.entity.MsoRequest; + +import java.util.Map; +import java.util.HashMap; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.codehaus.jackson.map.annotate.JsonRootName; + +/* README +* 1) Used JAXB/Jettison - see @NoJackson annotation on class to get RootElements REad by RestEasy +* 2) due to 1) Maps need to use this format + +"vfModuleParams": {"entry": [ + {"key": "network_id", + "value": "59ed7b41-2983-413f-ba93-e7d437433916"}, + {"key": "subnet_id", + "value": "086c9298-5c57-49b7-bb2b-6fd5730c5d92"}, + {"key": "server_name_0", + "value": "RaaVnf1"} + ]}, + * 3) to output json see toJSonString method below which required the @JsonRootName annotation and the WRAP_ROOT feature enabled + * 4) Tryong to work with RESTEASY JACKSON and JAXB/JETTISON to conform to Json input/output specs +*/ +@JsonRootName("createVfModuleRequest") +@XmlRootElement(name = "createVfModuleRequest") +@NoJackson +public class CreateVfModuleRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + + private String vnfId; + private String vnfType; + private String vnfVersion; + + private String vfModuleId; + private String vfModuleName; + private String vfModuleType; + + private String volumeGroupId; + private String volumeGroupStackId; + private String baseVfModuleId; + private String baseVfModuleStackId; + + private String requestType; + private Boolean failIfExists; + private Boolean backout; + + private Map<String,String> vfModuleParams = new HashMap<String, String>(); + private MsoRequest msoRequest = new MsoRequest(); + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleName() { + return vfModuleName; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getBaseVfModuleId() { + return baseVfModuleId; + } + + public void setBaseVfModuleId(String baseVfModuleId) { + this.baseVfModuleId = baseVfModuleId; + } + + public String getBaseVfModuleStackId() { + return baseVfModuleStackId; + } + + public void setBaseVfModuleStackId(String baseVfModuleStackId) { + this.baseVfModuleStackId = baseVfModuleStackId; + } + + public String getRequestType() { + return requestType; + } + + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map<String, String> getVfModuleParams() { + return vfModuleParams; + } + + public void setVfModuleParams(Map<String, String> vfModuleParams) { + this.vfModuleParams = vfModuleParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java new file mode 100644 index 0000000000..566a136712 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVfModuleResponse.java @@ -0,0 +1,106 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("createVfModuleResponse") +@XmlRootElement(name = "createVfModuleResponse") +@NoJackson +public class CreateVfModuleResponse extends VfResponseCommon { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Boolean vfModuleCreated; + private Map<String,String> vfModuleOutputs = new HashMap<String, String>(); + private VfModuleRollback rollback = new VfModuleRollback(); + + public CreateVfModuleResponse() { + super(); + } + + public CreateVfModuleResponse(String vnfId, String vfModuleId, + String vfModuleStackId, Boolean vfModuleCreated, + Map<String, String> vfModuleOutputs, VfModuleRollback rollback, + String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vfModuleCreated; + this.vfModuleOutputs = vfModuleOutputs; + this.rollback = rollback; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public Boolean getVfModuleCreated() { + return vfModuleCreated; + } + + public void setVfModuleCreated(Boolean vfModuleCreated) { + this.vfModuleCreated = vfModuleCreated; + } + + public Map<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map<String, String> vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } + + public VfModuleRollback getRollback() { + return rollback; + } + + public void setRollback(VfModuleRollback rollback) { + this.rollback = rollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java new file mode 100644 index 0000000000..b93a26031f --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupRequest.java @@ -0,0 +1,141 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.entity.MsoRequest; + +@JsonRootName("createVolumeGroupRequest") +@XmlRootElement(name = "createVolumeGroupRequest") +@NoJackson +public class CreateVolumeGroupRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String volumeGroupName; + private String volumeGroupId; + private String vnfType; + private String vnfVersion; + private String vfModuleType; + private Map<String,String> volumeGroupParams = new HashMap<String, String>(); + private Boolean failIfExists; + private Boolean suppressBackout; + private MsoRequest msoRequest = new MsoRequest(); + + public CreateVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public Map<String, String> getVolumeGroupParams() { + return volumeGroupParams; + } + + public void setVolumeGroupParams(Map<String, String> volumeGroupParams) { + this.volumeGroupParams = volumeGroupParams; + } + + public String getVolumeGroupName() { + return volumeGroupName; + } + + public void setVolumeGroupName(String volumeGroupName) { + this.volumeGroupName = volumeGroupName; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getSuppressBackout() { + return suppressBackout; + } + + public void setSuppressBackout(Boolean suppressBackout) { + this.suppressBackout = suppressBackout; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java new file mode 100644 index 0000000000..abf599b13d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/CreateVolumeGroupResponse.java @@ -0,0 +1,101 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@JsonRootName("createVolumeGroupResponse") +@XmlRootElement(name = "createVolumeGroupResponse") +@NoJackson +public class CreateVolumeGroupResponse extends VfResponseCommon { + private String volumeGroupId; + private String volumeGroupStackId; + private Boolean volumeGroupCreated; + private Map<String,String> volumeGroupOutputs = new HashMap<String, String>(); + private VolumeGroupRollback volumeGroupRollback = new VolumeGroupRollback(); + + public CreateVolumeGroupResponse() { + super(); + } + + public CreateVolumeGroupResponse( + String volumeGroupId, + String volumeGroupStackId, + Boolean volumeGroupCreated, + Map<String, String> volumeGroupOutputs, + VolumeGroupRollback volumeGroupRollback, + String messageId) + { + super(messageId); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupCreated = volumeGroupCreated; + this.volumeGroupOutputs = volumeGroupOutputs; + this.volumeGroupRollback = volumeGroupRollback; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public Boolean getVolumeGroupCreated() { + return volumeGroupCreated; + } + + public void setVolumeGroupCreated(Boolean volumeGroupCreated) { + this.volumeGroupCreated = volumeGroupCreated; + } + + public Map<String, String> getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public VolumeGroupRollback getVolumeGroupRollback() { + return volumeGroupRollback; + } + + public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { + this.volumeGroupRollback = volumeGroupRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java new file mode 100644 index 0000000000..14ecd5e654 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleRequest.java @@ -0,0 +1,93 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import org.openecomp.mso.entity.MsoRequest; + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("deleteVfModuleRequest") +@XmlRootElement(name = "deleteVfModuleRequest") +@NoJackson +public class DeleteVfModuleRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteVfModuleRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java new file mode 100644 index 0000000000..a3d00a95cd --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVfModuleResponse.java @@ -0,0 +1,70 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("deleteVfModuleResponse") +@XmlRootElement(name = "deleteVfModuleResponse") +@NoJackson +public class DeleteVfModuleResponse extends VfResponseCommon { + private String vnfId; + private String vfModuleId; + private Boolean vfModuleDeleted; + + public DeleteVfModuleResponse() { + super(); + } + + public DeleteVfModuleResponse(String vnfId, String vfModuleId, Boolean vfModuleDeleted, String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleDeleted = vfModuleDeleted; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public Boolean getVfModuleDeleted() { + return vfModuleDeleted; + } + + public void setVfModuleDeleted(Boolean vfModuleDeleted) { + this.vfModuleDeleted = vfModuleDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java new file mode 100644 index 0000000000..01dc8ffa38 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupRequest.java @@ -0,0 +1,84 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.entity.MsoRequest; + +@JsonRootName("deleteVolumeGroupRequest") +@XmlRootElement(name = "deleteVolumeGroupRequest") +@NoJackson +public class DeleteVolumeGroupRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String volumeGroupId; + private String volumeGroupStackId; + private MsoRequest msoRequest = new MsoRequest(); + + public DeleteVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java new file mode 100644 index 0000000000..738abd6923 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/DeleteVolumeGroupResponse.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@JsonRootName("deleteVolumeGroupResponse") +@XmlRootElement(name = "deleteVolumeGroupResponse") +@NoJackson +public class DeleteVolumeGroupResponse extends VfResponseCommon { + private Boolean volumeGroupDeleted; + + public DeleteVolumeGroupResponse() { + super(); + } + + public DeleteVolumeGroupResponse(Boolean volumeGroupDeleted, String messageId) { + super(messageId); + this.volumeGroupDeleted = volumeGroupDeleted; + } + + public Boolean getVolumeGroupDeleted() { + return volumeGroupDeleted; + } + + public void setVolumeGroupDeleted(Boolean volumeGroupDeleted) { + this.volumeGroupDeleted = volumeGroupDeleted; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java new file mode 100644 index 0000000000..91da93065d --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVfModuleResponse.java @@ -0,0 +1,106 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.ObjectMapper; +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.beans.VnfStatus; + +@XmlRootElement(name = "queryVfModuleResponse") +@NoJackson +public class QueryVfModuleResponse { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private VnfStatus vnfStatus; + private Map<String,String> vfModuleOutputs; + + public QueryVfModuleResponse() { + super(); + } + + public QueryVfModuleResponse(String vnfId, String vfModuleId, + String vfModuleStackId, VnfStatus vnfStatus, + Map<String, String> vfModuleOutputs) { + super(); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vnfStatus = vnfStatus; + this.vfModuleOutputs = vfModuleOutputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public VnfStatus getVnfStatus() { + return vnfStatus; + } + + public void setVnfStatus(VnfStatus vnfStatus) { + this.vnfStatus = vnfStatus; + } + + public Map<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map<String, String> vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + jsonString = mapper.writeValueAsString(this); + } + catch (Exception e) {} + return jsonString; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java new file mode 100644 index 0000000000..5e0d8bbe90 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/QueryVolumeGroupResponse.java @@ -0,0 +1,100 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.SerializationConfig; +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.beans.VnfStatus; + +@XmlRootElement(name = "queryVolumeGroupResponse") +@NoJackson +public class QueryVolumeGroupResponse { + private String volumeGroupId; + private String volumeGroupStackId; + private VnfStatus volumeGroupStatus; + private Map<String,String> volumeGroupOutputs; + + public QueryVolumeGroupResponse() { + } + + public QueryVolumeGroupResponse( + String volumeGroupId, + String volumeGroupStackId, + VnfStatus volumeGroupStatus, + Map<String, String> volumeGroupOutputs) + { + super(); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupStatus = volumeGroupStatus; + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public VnfStatus getVolumeGroupStatus() { + return volumeGroupStatus; + } + + public void setVolumeGroupStatus(VnfStatus volumeGroupStatus) { + this.volumeGroupStatus = volumeGroupStatus; + } + + public Map<String, String> getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String toJsonString() { + String jsonString = null; + try { + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + } + catch (Exception e) {} + return jsonString; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java new file mode 100644 index 0000000000..3365a05907 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleRequest.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("rollbackVfModuleRequest") +@XmlRootElement(name = "rollbackVfModuleRequest") +@NoJackson +public class RollbackVfModuleRequest extends VfRequestCommon { + private VfModuleRollback vfModuleRollback; + + public RollbackVfModuleRequest() { + super(); + } + + public VfModuleRollback getVfModuleRollback() { + return vfModuleRollback; + } + + public void setVfModuleRollback(VfModuleRollback vfModuleRollback) { + this.vfModuleRollback = vfModuleRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java new file mode 100644 index 0000000000..d877d667c8 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVfModuleResponse.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("rollbackVfModuleResponse") +@XmlRootElement(name = "rollbackVfModuleResponse") +@NoJackson +public class RollbackVfModuleResponse extends VfResponseCommon { + private Boolean vfModuleRolledback; + + public RollbackVfModuleResponse() { + super(); + } + + public RollbackVfModuleResponse(Boolean vfModuleRolledback, String messageId) { + super(messageId); + this.vfModuleRolledback = vfModuleRolledback; + } + + public Boolean getVfModuleRolledback() { + return vfModuleRolledback; + } + + public void setVfModuleRolledback(Boolean vfModuleRolledback) { + this.vfModuleRolledback = vfModuleRolledback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java new file mode 100644 index 0000000000..cb877bb858 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupRequest.java @@ -0,0 +1,46 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@JsonRootName("rollbackVolumeGroupRequest") +@XmlRootElement(name = "rollbackVolumeGroupRequest") +@NoJackson +public class RollbackVolumeGroupRequest extends VfRequestCommon { + private VolumeGroupRollback volumeGroupRollback; + + public RollbackVolumeGroupRequest() { + super(); + } + + public VolumeGroupRollback getVolumeGroupRollback() { + return volumeGroupRollback; + } + + public void setVolumeGroupRollback(VolumeGroupRollback volumeGroupRollback) { + this.volumeGroupRollback = volumeGroupRollback; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java new file mode 100644 index 0000000000..603b7581c0 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/RollbackVolumeGroupResponse.java @@ -0,0 +1,51 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@JsonRootName("rollbackVolumeGroupResponse") +@XmlRootElement(name = "rollbackVolumeGroupResponse") +@NoJackson +public class RollbackVolumeGroupResponse extends VfResponseCommon { + private Boolean volumeGroupRolledBack; + + public RollbackVolumeGroupResponse() { + super(); + } + + public RollbackVolumeGroupResponse(Boolean volumeGroupRolledBack, String messageId) { + super(messageId); + this.volumeGroupRolledBack = volumeGroupRolledBack; + } + + public Boolean getVolumeGroupRolledBack() { + return volumeGroupRolledBack; + } + + public void setVolumeGroupRolledBack(Boolean volumeGroupRolledBack) { + this.volumeGroupRolledBack = volumeGroupRolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java new file mode 100644 index 0000000000..a234e749ba --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleRequest.java @@ -0,0 +1,205 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import org.openecomp.mso.entity.MsoRequest; + +import java.util.Map; +import java.util.HashMap; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("updateVfModuleRequest") +@XmlRootElement(name = "updateVfModuleRequest") +@NoJackson +public class UpdateVfModuleRequest extends VfRequestCommon { + + private String cloudSiteId; + private String tenantId; + + private String vnfId; + private String vnfType; + private String vnfVersion; + + private String vfModuleName; + private String vfModuleType; + private String vfModuleId; + private String vfModuleStackId; + + private String volumeGroupId; + private String volumeGroupStackId; + + private String baseVfModuleId; + private String baseVfModuleStackId; + + private String requestType; + private Boolean failIfExists; + private Boolean backout; + + private Map<String,String> vfModuleParams = new HashMap<String, String>(); + private MsoRequest msoRequest = new MsoRequest(); + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleName() { + return vfModuleName; + } + + public void setVfModuleName(String vfModuleName) { + this.vfModuleName = vfModuleName; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getBaseVfModuleId() { + return baseVfModuleId; + } + + public void setBaseVfModuleId(String baseVfModuleId) { + this.baseVfModuleId = baseVfModuleId; + } + + public String getBaseVfModuleStackId() { + return baseVfModuleStackId; + } + + public void setBaseVfModuleStackId(String baseVfModuleStackId) { + this.baseVfModuleStackId = baseVfModuleStackId; + } + + public String getRequestType() { + return requestType; + } + + public void setRequestType(String requestType) { + this.requestType = requestType; + } + + public Boolean getFailIfExists() { + return failIfExists; + } + + public void setFailIfExists(Boolean failIfExists) { + this.failIfExists = failIfExists; + } + + public Boolean getBackout() { + return backout; + } + + public void setBackout(Boolean backout) { + this.backout = backout; + } + + public Map<String, String> getVfModuleParams() { + return vfModuleParams; + } + + public void setVfModuleParams(Map<String, String> vfModuleParams) { + this.vfModuleParams = vfModuleParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java new file mode 100644 index 0000000000..af162b2e98 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVfModuleResponse.java @@ -0,0 +1,85 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("updateVfModuleResponse") +@XmlRootElement(name = "updateVfModuleResponse") +@NoJackson +public class UpdateVfModuleResponse extends VfResponseCommon { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private Map<String,String> vfModuleOutputs = new HashMap<String, String>(); + + public UpdateVfModuleResponse() { + super(); + } + + public UpdateVfModuleResponse(String vnfId, String vfModuleId, + String vfModuleStackId, + Map<String, String> vfModuleOutputs, + String messageId) { + super(messageId); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleOutputs = vfModuleOutputs; + } + + public String getVnfId() { + return vnfId; + } + + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + + public String getVfModuleId() { + return vfModuleId; + } + + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + + public String getVfModuleStackId() { + return vfModuleStackId; + } + + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + + public Map<String, String> getVfModuleOutputs() { + return vfModuleOutputs; + } + + public void setVfModuleOutputs(Map<String, String> vfModuleOutputs) { + this.vfModuleOutputs = vfModuleOutputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java new file mode 100644 index 0000000000..50c60b30d6 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupRequest.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.entity.MsoRequest; + +@JsonRootName("updateVolumeGroupRequest") +@XmlRootElement(name = "updateVolumeGroupRequest") +@NoJackson +public class UpdateVolumeGroupRequest extends VfRequestCommon { + private String cloudSiteId; + private String tenantId; + private String volumeGroupId; + private String volumeGroupStackId; + private String vnfType; + private String vnfVersion; + private String vfModuleType; + private Map<String,String> volumeGroupParams = new HashMap<String, String>(); + private MsoRequest msoRequest = new MsoRequest(); + + public UpdateVolumeGroupRequest() { + super(); + } + + public String getCloudSiteId() { + return cloudSiteId; + } + + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + + public String getTenantId() { + return tenantId; + } + + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public String getVnfType() { + return vnfType; + } + + public void setVnfType(String vnfType) { + this.vnfType = vnfType; + } + + public String getVnfVersion() { + return vnfVersion; + } + + public void setVnfVersion(String vnfVersion) { + this.vnfVersion = vnfVersion; + } + + public String getVfModuleType() { + return vfModuleType; + } + + public void setVfModuleType(String vfModuleType) { + this.vfModuleType = vfModuleType; + } + + public Map<String, String> getVolumeGroupParams() { + return volumeGroupParams; + } + + public void setVolumeGroupParams(Map<String, String> volumeGroupParams) { + this.volumeGroupParams = volumeGroupParams; + } + + public MsoRequest getMsoRequest() { + return msoRequest; + } + + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java new file mode 100644 index 0000000000..2bd210f131 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/UpdateVolumeGroupResponse.java @@ -0,0 +1,80 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.util.HashMap; +import java.util.Map; + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +@JsonRootName("updateVolumeGroupResponse") +@XmlRootElement(name = "updateVolumeGroupResponse") +@NoJackson +public class UpdateVolumeGroupResponse extends VfResponseCommon { + private String volumeGroupId; + private String volumeGroupStackId; + private Map<String,String> volumeGroupOutputs; + + public UpdateVolumeGroupResponse() { + super(); + this.volumeGroupOutputs = new HashMap<String, String>(); + } + + public UpdateVolumeGroupResponse( + String volumeGroupId, + String volumeGroupStackId, + Map<String, String> volumeGroupOutputs, + String messageId) + { + super(messageId); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupOutputs = volumeGroupOutputs; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + + public Map<String, String> getVolumeGroupOutputs() { + return volumeGroupOutputs; + } + + public void setVolumeGroupOutputs(Map<String, String> volumeGroupOutputs) { + this.volumeGroupOutputs = volumeGroupOutputs; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java new file mode 100644 index 0000000000..419d1df566 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleExceptionResponse.java @@ -0,0 +1,74 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.io.Serializable; +import javax.xml.bind.annotation.XmlRootElement; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "vfModuleException") +@NoJackson +public class VfModuleExceptionResponse extends VfResponseCommon implements Serializable { + private static final long serialVersionUID = -9062290006520066109L; + + private String message; + private MsoExceptionCategory category; + private Boolean rolledBack; + + public VfModuleExceptionResponse () {} + + public VfModuleExceptionResponse (String message) { + this.message = message; + } + + public VfModuleExceptionResponse (String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(messageid); + this.message = message; + this.category = category; + this.rolledBack = rolledBack; + } + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + + public MsoExceptionCategory getCategory () { + return category; + } + + public void setCategory (MsoExceptionCategory category) { + this.category = category; + } + + public Boolean getRolledBack() { + return rolledBack; + } + + public void setRolledBack(Boolean rolledBack) { + this.rolledBack = rolledBack; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java new file mode 100644 index 0000000000..84ef7146fd --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfModuleRollback.java @@ -0,0 +1,123 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.openecomp.mso.entity.MsoRequest; +import org.openecomp.mso.openstack.beans.VnfRollback; +import org.jboss.resteasy.annotations.providers.NoJackson; +import org.codehaus.jackson.map.annotate.JsonRootName; + +@JsonRootName("VfModuleRollback") +@XmlRootElement(name = "VfModuleRollback") +@NoJackson +public class VfModuleRollback { + private String vnfId; + private String vfModuleId; + private String vfModuleStackId; + private boolean vfModuleCreated = false; + private String tenantId; + private String cloudSiteId; + private MsoRequest msoRequest; + private String messageId; + + public VfModuleRollback() { + } + + public VfModuleRollback(VnfRollback vrb, String vfModuleId, String vfModuleStackId, String messageId) + { + this.vnfId = vrb.getVnfId(); + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vrb.getVnfCreated(); + this.tenantId = vrb.getTenantId(); + this.cloudSiteId = vrb.getCloudSiteId(); + this.msoRequest = vrb.getMsoRequest(); + this.messageId = messageId; + } + + public VfModuleRollback(String vnfId, String vfModuleId, + String vfModuleStackId, boolean vfModuleCreated, String tenantId, + String cloudSiteId, + MsoRequest msoRequest, + String messageId) { + super(); + this.vnfId = vnfId; + this.vfModuleId = vfModuleId; + this.vfModuleStackId = vfModuleStackId; + this.vfModuleCreated = vfModuleCreated; + this.tenantId = tenantId; + this.cloudSiteId = cloudSiteId; + this.msoRequest = msoRequest; + this.messageId = messageId; + } + + public String getVnfId() { + return vnfId; + } + public void setVnfId(String vnfId) { + this.vnfId = vnfId; + } + public String getVfModuleId() { + return vfModuleId; + } + public void setVfModuleId(String vfModuleId) { + this.vfModuleId = vfModuleId; + } + public String getVfModuleStackId() { + return vfModuleStackId; + } + public void setVfModuleStackId(String vfModuleStackId) { + this.vfModuleStackId = vfModuleStackId; + } + public boolean isVfModuleCreated() { + return vfModuleCreated; + } + public void setVfModuleCreated(boolean vfModuleCreated) { + this.vfModuleCreated = vfModuleCreated; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getCloudSiteId() { + return cloudSiteId; + } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + public String getMessageId() { + return messageId; + } + public void setMessageId(String messageId) { + this.messageId = messageId; + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java new file mode 100644 index 0000000000..e315444eb3 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfRequestCommon.java @@ -0,0 +1,52 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +/** + * Everything that is common between all VfModule and VolumeGroup Requests. + */ +public abstract class VfRequestCommon extends VfResponseCommon { + private Boolean skipAAI; + private String notificationUrl; + + public Boolean getSkipAAI() { + return skipAAI; + } + + public void setSkipAAI(Boolean skipAAI) { + this.skipAAI = skipAAI; + } + + public String getNotificationUrl() { + return notificationUrl; + } + + public void setNotificationUrl(String notificationUrl) { + this.notificationUrl = notificationUrl; + } + + public boolean isSynchronous() { + return notificationUrl == null || (notificationUrl != null && notificationUrl.isEmpty()); + } + + // getMessageId, setMessageId, toJsonString, toJsonString are all defined in VfResponseCommon. +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java new file mode 100644 index 0000000000..96a83e41fd --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VfResponseCommon.java @@ -0,0 +1,83 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import java.io.ByteArrayOutputStream; + +import javax.xml.bind.JAXBContext; +import javax.xml.bind.Marshaller; + +import org.codehaus.jackson.map.ObjectMapper; +import org.codehaus.jackson.map.SerializationConfig; + +/** + * Everything that is common between all VfModule and VolumeGroup Responses, + * except for QueryVfModuleResponse and QueryVolumeGroupResponse. + */ +public abstract class VfResponseCommon { + private String messageId; + + public VfResponseCommon() { + messageId = null; + } + + public VfResponseCommon(String messageId) { + this.messageId = messageId; + } + + public String getMessageId() { + return messageId; + } + + public void setMessageId(String messageId) { + this.messageId = messageId; + } + + public String toJsonString() { + try { + String jsonString = null; + ObjectMapper mapper = new ObjectMapper(); + mapper.enable(SerializationConfig.Feature.WRAP_ROOT_VALUE); + jsonString = mapper.writeValueAsString(this); + return jsonString; + } catch (Exception e) { + // Shouldn't happen... + e.printStackTrace(); + return ""; + } + } + + public String toXmlString() { + try { + ByteArrayOutputStream bs = new ByteArrayOutputStream(); + JAXBContext context = JAXBContext.newInstance(this.getClass()); + Marshaller marshaller = context.createMarshaller(); + marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true); //pretty print XML + marshaller.marshal(this, bs); + return bs.toString(); + } catch (Exception e) { + // Shouldn't happen... + e.printStackTrace(); + return ""; + } + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java new file mode 100644 index 0000000000..bc4e54b3a2 --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupExceptionResponse.java @@ -0,0 +1,48 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.openstack.exceptions.MsoExceptionCategory; + +@XmlRootElement(name = "volumeGroupException") +@NoJackson +public class VolumeGroupExceptionResponse extends VfModuleExceptionResponse { + // Exactly the same as a VfModuleExceptionResponse + + private static final long serialVersionUID = 1168681288205898800L; + + public VolumeGroupExceptionResponse() { + super(); + } + + public VolumeGroupExceptionResponse(String message) { + super(message); + } + + public VolumeGroupExceptionResponse(String message, MsoExceptionCategory category, boolean rolledBack, String messageid) { + super(message, category, rolledBack, messageid); + } +} diff --git a/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java new file mode 100644 index 0000000000..bda222159e --- /dev/null +++ b/adapters/mso-adapters-rest-interface/src/main/java/org/openecomp/mso/adapters/vnfrest/VolumeGroupRollback.java @@ -0,0 +1,130 @@ +/*- + * ============LICENSE_START======================================================= + * OPENECOMP - MSO + * ================================================================================ + * Copyright (C) 2017 AT&T Intellectual Property. 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.openecomp.mso.adapters.vnfrest; + + +import javax.xml.bind.annotation.XmlRootElement; + +import org.codehaus.jackson.map.annotate.JsonRootName; +import org.jboss.resteasy.annotations.providers.NoJackson; + +import org.openecomp.mso.entity.MsoRequest; + +@JsonRootName("VolumeGroupRollback") +@XmlRootElement(name = "VolumeGroupRollback") +@NoJackson +public class VolumeGroupRollback { +// “volumeGroupRollback”: { +// “volumeGroupId”: “<A&AI_ VOLUME_GROUP_ID>”, +// “volumeGroupStackId”: “<VOLUME_GROUP _STACK_ID>”, +// “tenantId”: “<TENANT_ID>”, +// “cloudSiteId”: “<CLOUD_CLLI>”, +// “volumeGroupCreated”: TRUE|FALSE, +// “msoRequest”: { +// “requestId”: “<REQUEST_ID>”, +// “serviceInstanceId”: “<SERVICE_INSTANCE_ID>” +// } +//}, + + private String volumeGroupId; + private String volumeGroupStackId; + private String tenantId; + private String cloudSiteId; + private boolean volumeGroupCreated = false; + private MsoRequest msoRequest; + private String messageId; + + public VolumeGroupRollback() { + } + + public VolumeGroupRollback(VolumeGroupRollback vrb, String volumeGroupStackId, String messageId) + { + this.volumeGroupId = vrb.getVolumeGroupId(); + this.volumeGroupStackId = volumeGroupStackId; + this.tenantId = vrb.getTenantId(); + this.cloudSiteId = vrb.getCloudSiteId(); + this.volumeGroupCreated = vrb.isVolumeGroupCreated(); + this.msoRequest = vrb.getMsoRequest(); + this.messageId = messageId; + } + + public VolumeGroupRollback( + String volumeGroupId, + String volumeGroupStackId, + boolean volumeGroupCreated, + String tenantId, + String cloudSiteId, + MsoRequest msoRequest, + String messageId) + { + super(); + this.volumeGroupId = volumeGroupId; + this.volumeGroupStackId = volumeGroupStackId; + this.volumeGroupCreated = volumeGroupCreated; + this.tenantId = tenantId; + this.cloudSiteId = cloudSiteId; + this.msoRequest = msoRequest; + this.messageId = messageId; + } + + public String getVolumeGroupId() { + return volumeGroupId; + } + public void setVolumeGroupId(String volumeGroupId) { + this.volumeGroupId = volumeGroupId; + } + public String getVolumeGroupStackId() { + return volumeGroupStackId; + } + public void setVolumeGroupStackId(String volumeGroupStackId) { + this.volumeGroupStackId = volumeGroupStackId; + } + public String getTenantId() { + return tenantId; + } + public void setTenantId(String tenantId) { + this.tenantId = tenantId; + } + public String getCloudSiteId() { + return cloudSiteId; + } + public void setCloudSiteId(String cloudSiteId) { + this.cloudSiteId = cloudSiteId; + } + public boolean isVolumeGroupCreated() { + return volumeGroupCreated; + } + public void setVolumeGroupCreated(boolean volumeGroupCreated) { + this.volumeGroupCreated = volumeGroupCreated; + } + public MsoRequest getMsoRequest() { + return msoRequest; + } + public void setMsoRequest(MsoRequest msoRequest) { + this.msoRequest = msoRequest; + } + public String getMessageId() { + return messageId; + } + public void setMessageId(String messageId) { + this.messageId = messageId; + } +} |