* 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.
private String vnfId;
private String tenantId;
private String cloudSiteId;
+ private String cloudOwner;
private boolean tenantCreated = false;
private boolean vnfCreated = false;
private MsoRequest msoRequest;
/**
* For backwards compatibility... orchestration mode defaults to HEAT
- *
+ *
* @param vnfId
* @param tenantId
* @param cloudSiteId
+ * @param cloudOwner
* @param tenantCreated
* @param vnfCreated
* @param msoRequest
* @param requestType
* @param modelCustomizationUuid
*/
- public VnfRollback(String vnfId, String tenantId, String cloudSiteId,
+ public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId,
boolean tenantCreated, boolean vnfCreated,
MsoRequest msoRequest,
String volumeGroupName, String volumeGroupId, String requestType, String modelCustomizationUuid) {
this.vnfId = vnfId;
this.tenantId = tenantId;
this.cloudSiteId = cloudSiteId;
+ this.cloudOwner = cloudOwner;
this.tenantCreated = tenantCreated;
this.vnfCreated = vnfCreated;
this.msoRequest = msoRequest;
/**
* For backwards compatibility... orchestration mode defaults to HEAT
- *
+ *
* @param vnfId
* @param tenantId
* @param cloudSiteId
+ * @param cloudOwner
* @param tenantCreated
* @param vnfCreated
* @param msoRequest
* @param requestType
* @param modelCustomizationUuid
*/
- public VnfRollback(String vnfId, String tenantId, String cloudSiteId,
+ public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId,
boolean tenantCreated, boolean vnfCreated,
MsoRequest msoRequest, String volumeGroupName, String volumeGroupId,
String requestType, String modelCustomizationUuid, String orchestrationMode) {
this.vnfId = vnfId;
this.tenantId = tenantId;
this.cloudSiteId = cloudSiteId;
+ this.cloudOwner = cloudOwner;
this.tenantCreated = tenantCreated;
this.vnfCreated = vnfCreated;
this.msoRequest = msoRequest;
public void setCloudSiteId(String cloudId) {
this.cloudSiteId = cloudId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
public boolean getTenantCreated() {
return tenantCreated;
}
}
@Override
public String toString() {
- return "VnfRollback: cloud=" + cloudSiteId + ", tenant=" + tenantId +
+ return "VnfRollback: cloud=" + cloudSiteId + ", cloudOwner=" + cloudOwner + ", tenant=" + tenantId +
", vnf=" + vnfId + ", tenantCreated=" + tenantCreated +
", vnfCreated=" + vnfCreated + ", requestType = " + requestType
+ ", modelCustomizationUuid=" + this.modelCustomizationUuid
@Autowired
private MsoTenantUtilsFactory tenantUtilsFactory;
-
+
@Autowired
private KeystoneV3Authentication keystoneV3Authentication;
-
+
private static final Logger logger = LoggerFactory.getLogger(MsoHeatUtils.class);
// Properties names and variables (with default values)
* this method does not include environment, files, or heatFiles
*/
public StackInfo createStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
int timeoutMinutes) throws MsoException {
// Just call the new method with the environment & files variable set to null
return this.createStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
// This method has environment, but not files or heatFiles
public StackInfo createStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
String environment) throws MsoException {
// Just call the new method with the files/heatFiles variables set to null
return this.createStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
// This method has environment and files, but not heatFiles.
public StackInfo createStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
String environment,
Map <String, Object> files) throws MsoException {
return this.createStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
// This method has environment, files, heatfiles
public StackInfo createStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
Map <String, Object> files,
Map <String, Object> heatFiles) throws MsoException {
return this.createStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
* stack. We must combine them before we add them to the stack if they're both non-null.
*
* @param cloudSiteId The cloud (may be a region) in which to create the stack.
+ * @param cloudOwner the cloud owner of the cloud site in which to create the stack
* @param tenantId The Openstack ID of the tenant in which to create the Stack
* @param stackName The name of the stack to create
* @param heatTemplate The Heat template
@SuppressWarnings("unchecked")
public StackInfo createStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
request.header ("X-Auth-Key", CryptoUtils.decryptCloudConfigPassword(cloudIdentity.getMsoPass ()));
heatStack = executeAndRecordOpenstackRequest (request);
} catch (OpenStackResponseException e) {
- if (e.getStatus () == 409) {
+ if (e.getStatus () == 409) {
MsoStackAlreadyExists me = new MsoStackAlreadyExists (stackName, tenantId, cloudSiteId);
me.addContext (CREATE_STACK);
throw me;
logger.debug("ERROR STATUS = {},\n{}\n{}", e.getStatus(), e.getMessage(), e.getLocalizedMessage());
throw heatExceptionToMsoException (e, CREATE_STACK);
}
- } catch (OpenStackConnectException e) {
+ } catch (OpenStackConnectException e) {
throw heatExceptionToMsoException (e, CREATE_STACK);
- } catch (RuntimeException e) {
+ } catch (RuntimeException e) {
throw runtimeExceptionToMsoException (e, CREATE_STACK);
}
// Otherwise, simple query by name returns a 302 redirect.
// NOTE: This is specific to the v1 Orchestration API.
String canonicalName = stackName + "/" + heatStack.getId ();
-
+
if (pollForCompletion) {
heatStack = pollStackForCompletion(cloudSiteId, tenantId, stackName, timeoutMinutes, backout, heatClient,
heatStack, canonicalName);
logger.debug("an error occurred trying to print out the current outputs of the stack", e);
}
- if ("CREATE_IN_PROGRESS".equals (heatStack.getStackStatus ())) {
+ if ("CREATE_IN_PROGRESS".equals (heatStack.getStackStatus ())) {
if (pollTimeout <= 0) {
logger.error("{} Cloud site: {} Tenant: {} Stack: {} Stack status: {} {} Create stack timeout",
MessageEnum.RA_CREATE_STACK_TIMEOUT, cloudSiteId, tenantId, stackName,
*
* @param tenantId The Openstack ID of the tenant in which to query
* @param cloudSiteId The cloud identifier (may be a region) in which to query
+ * @param cloudOwner the cloud owner of the cloud site in which to query
* @param stackName The name of the stack to query (may be simple or canonical)
* @return A StackInfo object
* @throws MsoOpenstackException Thrown if the Openstack API call returns an exception.
*/
- public StackInfo queryStack (String cloudSiteId, String tenantId, String stackName) throws MsoException {
+ public StackInfo queryStack (String cloudSiteId, String cloudOwner, String tenantId, String stackName) throws MsoException {
logger.debug ("Query HEAT stack: {} in tenant {}", stackName, tenantId);
// Obtain the cloud site information where we will create the stack
* all or partially deleted, so the resulting stack must be considered invalid.
*
* @param tenantId The Openstack ID of the tenant in which to perform the delete
+ * @param cloudOwner the cloud owner of the cloud site in which to delete the stack
* @param cloudSiteId The cloud identifier (may be a region) from which to delete the stack.
* @param stackName The name/id of the stack to delete. May be simple or canonical
* @param pollForCompletion Indicator that polling should be handled in Java vs. in the client
* @throws MsoCloudSiteNotFound
*/
public StackInfo deleteStack (String tenantId,
+ String cloudOwner,
String cloudSiteId,
String stackName,
boolean pollForCompletion) throws MsoException {
if (ServerType.KEYSTONE.equals(cloudIdentity.getIdentityServerType())) {
Keystone keystoneTenantClient = new Keystone (keystoneUrl);
Access access = null;
-
+
Authentication credentials = authenticationMethodFactory.getAuthenticationFor(cloudIdentity);
-
+
OpenStackRequest <Access> request = keystoneTenantClient.tokens ()
.authenticate (credentials).withTenantId (tenantId);
-
+
access = executeAndRecordOpenstackRequest (request);
-
+
try {
// Isolate trying to printout the region IDs
try {
}
- public Map<String, Object> queryStackForOutputs(String cloudSiteId,
+ public Map<String, Object> queryStackForOutputs(String cloudSiteId, String cloudOwner,
String tenantId, String stackName) throws MsoException {
logger.debug("MsoHeatUtils.queryStackForOutputs)");
- StackInfo heatStack = this.queryStack(cloudSiteId, tenantId, stackName);
+ StackInfo heatStack = this.queryStack(cloudSiteId, cloudOwner, tenantId, stackName);
if (heatStack == null || heatStack.getStatus() == HeatStatus.NOTFOUND) {
return null;
}
sb.append("[END]");
return sb;
}
-
+
public void copyBaseOutputsToInputs(Map<String, Object> inputs,
Map<String, Object> otherStackOutputs, List<String> paramNames, Map<String, String> aliases) {
throws VduException
{
String cloudSiteId = cloudInfo.getCloudSiteId();
+ String cloudOwner = cloudInfo.getCloudOwner();
String tenantId = cloudInfo.getTenantId();
// Translate the VDU ModelInformation structure to that which is needed for
try {
StackInfo stackInfo = createStack (cloudSiteId,
+ cloudOwner,
tenantId,
instanceName,
heatTemplate,
throws VduException
{
String cloudSiteId = cloudInfo.getCloudSiteId();
+ String cloudOwner = cloudInfo.getCloudOwner();
String tenantId = cloudInfo.getTenantId();
try {
// Query the Cloudify Deployment object and populate a VduInstance
- StackInfo stackInfo = queryStack (cloudSiteId, tenantId, instanceId);
+ StackInfo stackInfo = queryStack (cloudSiteId, cloudOwner, tenantId, instanceId);
return stackInfoToVduInstance(stackInfo);
}
throws VduException
{
String cloudSiteId = cloudInfo.getCloudSiteId();
+ String cloudOwner = cloudInfo.getCloudOwner();
String tenantId = cloudInfo.getTenantId();
try {
// Delete the Heat stack
- StackInfo stackInfo = deleteStack (tenantId, cloudSiteId, instanceId, true);
+ StackInfo stackInfo = deleteStack (tenantId, cloudOwner, cloudSiteId, instanceId, true);
// Populate a VduInstance based on the deleted Cloudify Deployment object
VduInstance vduInstance = stackInfoToVduInstance(stackInfo);
return vduStatus;
}
-
+
public Resources queryStackResources(String cloudSiteId, String tenantId, String stackName) throws MsoException {
CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId)
.orElseThrow(() -> new MsoCloudSiteNotFound(cloudSiteId));
* 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.
*/
public StackInfo updateStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
// Keeping this method to allow compatibility with no environment or files variable sent. In this case,
// simply return the new method with the environment variable set to null.
return this.updateStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
}
public StackInfo updateStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
// Keeping this method to allow compatibility with no environment variable sent. In this case,
// simply return the new method with the files variable set to null.
return this.updateStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
}
public StackInfo updateStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
String environment,
Map <String, Object> files) throws MsoException {
return this.updateStack (cloudSiteId,
+ cloudOwner,
tenantId,
stackName,
heatTemplate,
*/
public StackInfo updateStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
* The nested templates and get_file entries both end up being added to the "files" on the
* stack. We must combine them before we add them to the stack if they're both non-null.
*
- * @param cloudSiteId The cloud (may be a region) in which to create the stack.
+ * @param cloudSiteId The cloud (may be a region) in which to create the stack
+ * @param cloudOwner the cloud owner of the cloud site in which to create the stack
* @param tenantId The Openstack ID of the tenant in which to create the Stack
* @param stackName The name of the stack to create
* @param heatTemplate The Heat template
@SuppressWarnings("unchecked")
@Override
public StackInfo createStack (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String stackName,
String heatTemplate,
logger.debug(String.format("Multicloud Request is: %s", multicloudRequest.toString()));
}
- String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, null);
+ String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, cloudOwner, null);
RestClient multicloudClient = getMulticloudClient(multicloudEndpoint);
if (multicloudClient == null) {
if (logger.isDebugEnabled()) {
logger.debug("Multicloud Create Response Body: {}", multicloudResponseBody);
}
- return getStackStatus(cloudSiteId, tenantId, canonicalName, pollForCompletion, timeoutMinutes, backout);
+ return getStackStatus(cloudSiteId, cloudOwner, tenantId, canonicalName, pollForCompletion, timeoutMinutes, backout);
}
StringBuilder stackErrorStatusReason = new StringBuilder(response.getStatusInfo().getReasonPhrase());
if (null != multicloudResponseBody) {
}
@Override
- public Map<String, Object> queryStackForOutputs(String cloudSiteId,
+ public Map<String, Object> queryStackForOutputs(String cloudSiteId, String cloudOwner,
String tenantId, String stackName) throws MsoException {
logger.debug("MsoHeatUtils.queryStackForOutputs)");
- StackInfo heatStack = this.queryStack(cloudSiteId, tenantId, stackName);
+ StackInfo heatStack = this.queryStack(cloudSiteId, cloudOwner, tenantId, stackName);
if (heatStack == null || heatStack.getStatus() == HeatStatus.NOTFOUND) {
return null;
}
*
* @param tenantId The Openstack ID of the tenant in which to query
* @param cloudSiteId The cloud identifier (may be a region) in which to query
+ * @param cloudOwner cloud owner of the cloud site in which to query
* @param stackId The ID of the stack to query
* @return A StackInfo object
* @throws MsoOpenstackException Thrown if the Openstack API call returns an exception.
*/
@Override
- public StackInfo queryStack (String cloudSiteId, String tenantId, String instanceId) throws MsoException {
+ public StackInfo queryStack (String cloudSiteId, String cloudOwner, String tenantId, String instanceId) throws MsoException {
if (logger.isDebugEnabled()) {
logger.debug (String.format("Query multicloud HEAT stack: %s in tenant %s", instanceId, tenantId));
}
StackInfo returnInfo = new StackInfo();
returnInfo.setName(stackName);
- String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, stackId);
+ String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, cloudOwner, stackId);
RestClient multicloudClient = getMulticloudClient(multicloudEndpoint);
if (multicloudClient != null) {
return returnInfo;
}
- public StackInfo deleteStack (String cloudSiteId, String tenantId, String instanceId) throws MsoException {
+ public StackInfo deleteStack (String cloudSiteId, String cloudOwner, String tenantId, String instanceId) throws MsoException {
if (logger.isDebugEnabled()) {
logger.debug (String.format("Delete multicloud HEAT stack: %s in tenant %s", instanceId, tenantId));
}
returnInfo.setName(stackName);
Response response = null;
- String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, stackId);
+ String multicloudEndpoint = getMulticloudEndpoint(cloudSiteId, cloudOwner, stackId);
RestClient multicloudClient = getMulticloudClient(multicloudEndpoint);
if (multicloudClient != null) {
returnInfo.setStatus(HeatStatus.NOTFOUND);
returnInfo.setStatusMessage(response.getStatusInfo().getReasonPhrase());
} else if (response.getStatus() == Response.Status.NO_CONTENT.getStatusCode()) {
- return getStackStatus(cloudSiteId, tenantId, instanceId);
+ return getStackStatus(cloudSiteId, cloudOwner, tenantId, instanceId);
} else {
returnInfo.setStatus(HeatStatus.FAILED);
returnInfo.setStatusMessage(response.getStatusInfo().getReasonPhrase());
return HeatStatus.UNKNOWN;
}
- private StackInfo getStackStatus(String cloudSiteId, String tenantId, String instanceId) throws MsoException {
- return getStackStatus(cloudSiteId, tenantId, instanceId, false, 0, false);
+ private StackInfo getStackStatus(String cloudSiteId, String cloudOwner, String tenantId, String instanceId) throws MsoException {
+ return getStackStatus(cloudSiteId, cloudOwner, tenantId, instanceId, false, 0, false);
}
- private StackInfo getStackStatus(String cloudSiteId, String tenantId, String instanceId, boolean pollForCompletion, int timeoutMinutes, boolean backout) throws MsoException {
+ private StackInfo getStackStatus(String cloudSiteId, String cloudOwner, String tenantId, String instanceId, boolean pollForCompletion, int timeoutMinutes, boolean backout) throws MsoException {
StackInfo stackInfo = new StackInfo();
// If client has requested a final response, poll for stack completion
while (true) {
try {
- stackInfo = queryStack(cloudSiteId, tenantId, instanceId);
+ stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
logger.debug (stackInfo.getStatus() + " (" + instanceId + ")");
if (HeatStatus.BUILDING.equals(stackInfo.getStatus())) {
if (pollTimeout <= 0) {
// Note that this should not occur, since there is a timeout specified
// in the Openstack (multicloud?) call.
- logger.error(String.format("%s %s %s %s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_TIMEOUT.toString(), cloudSiteId, tenantId, instanceId, stackInfo.getStatus(), "", "", ErrorCode.AvailabilityError.getValue(), "Create stack timeout"));
+ logger.error(String.format("%s %s %s %s %s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_TIMEOUT.toString(), cloudOwner, cloudSiteId, tenantId, instanceId, stackInfo.getStatus(), "", "", ErrorCode.AvailabilityError.getValue(), "Create stack timeout"));
createTimedOut = true;
break;
}
} else {
try {
logger.debug("Create Stack error - unable to query for stack status - attempting to delete stack: " + instanceId + " - This will likely fail and/or we won't be able to query to see if delete worked");
- StackInfo deleteInfo = deleteStack(cloudSiteId, tenantId, instanceId);
+ StackInfo deleteInfo = deleteStack(cloudSiteId, cloudOwner, tenantId, instanceId);
// this may be a waste of time - if we just got an exception trying to query the stack - we'll just
// get another one, n'est-ce pas?
boolean deleted = false;
while (!deleted) {
try {
- StackInfo queryInfo = queryStack(cloudSiteId, tenantId, instanceId);
+ StackInfo queryInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
logger.debug("Deleting " + instanceId + ", status: " + queryInfo.getStatus());
if (HeatStatus.DELETING.equals(queryInfo.getStatus())) {
if (deletePollTimeout <= 0) {
- logger.error(String.format("%s %s %s %s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_TIMEOUT.toString(), cloudSiteId, tenantId, instanceId,
+ logger.error(String.format("%s %s %s %s %s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_TIMEOUT.toString(), cloudOwner, cloudSiteId, tenantId, instanceId,
queryInfo.getStatus(), "", "", ErrorCode.AvailabilityError.getValue(),
"Rollback: DELETE stack timeout"));
break;
try {
logger.debug("Create Stack errored - attempting to DELETE stack: " + instanceId);
logger.debug("deletePollInterval=" + deletePollInterval + ", deletePollTimeout=" + deletePollTimeout);
- StackInfo deleteInfo = deleteStack(cloudSiteId, tenantId, instanceId);
+ StackInfo deleteInfo = deleteStack(cloudSiteId, cloudOwner, tenantId, instanceId);
boolean deleted = false;
while (!deleted) {
try {
- StackInfo queryInfo = queryStack(cloudSiteId, tenantId, instanceId);
+ StackInfo queryInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
logger.debug("Deleting " + instanceId + ", status: " + queryInfo.getStatus());
if (HeatStatus.DELETING.equals(queryInfo.getStatus())) {
if (deletePollTimeout <= 0) {
- logger.error(String.format("%s %s %s %s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_TIMEOUT.toString(), cloudSiteId, tenantId, instanceId,
+ logger.error(String.format("%s %s %s %s %s %s %s %s %d %s", MessageEnum.RA_CREATE_STACK_TIMEOUT.toString(), cloudOwner, cloudSiteId, tenantId, instanceId,
queryInfo.getStatus(), "", "", ErrorCode.AvailabilityError.getValue(),
"Rollback: DELETE stack timeout"));
break;
}
} else {
// Get initial status, since it will have been null after the create.
- stackInfo = queryStack(cloudSiteId, tenantId, instanceId);
+ stackInfo = queryStack(cloudSiteId, cloudOwner, tenantId, instanceId);
logger.debug("Multicloud stack query status is: " + stackInfo.getStatus());
}
return stackInfo;
return null;
}
- private String getMulticloudEndpoint(String cloudSiteId, String workloadId) throws MsoCloudSiteNotFound {
+ private String getMulticloudEndpoint(String cloudSiteId, String cloudOwner, String workloadId) throws MsoCloudSiteNotFound {
CloudSite cloudSite = cloudConfig.getCloudSite(cloudSiteId).orElseThrow(() -> new MsoCloudSiteNotFound(cloudSiteId));
String endpoint = cloudSite.getIdentityService().getIdentityUrl();
throws VduException
{
String cloudSiteId = cloudInfo.getCloudSiteId();
+ String cloudOwner = cloudInfo.getCloudOwner();
String tenantId = cloudInfo.getTenantId();
// Translate the VDU ModelInformation structure to that which is needed for
try {
StackInfo stackInfo = createStack (cloudSiteId,
+ cloudOwner,
tenantId,
instanceName,
heatTemplate,
throws VduException
{
String cloudSiteId = cloudInfo.getCloudSiteId();
+ String cloudOwner = cloudInfo.getCloudOwner();
String tenantId = cloudInfo.getTenantId();
try {
// Query the Cloudify Deployment object and populate a VduInstance
- StackInfo stackInfo = queryStack (cloudSiteId, tenantId, instanceId);
+ StackInfo stackInfo = queryStack (cloudSiteId, cloudOwner, tenantId, instanceId);
return stackInfoToVduInstance(stackInfo);
}
throws VduException
{
String cloudSiteId = cloudInfo.getCloudSiteId();
+ String cloudOwner = cloudInfo.getCloudOwner();
String tenantId = cloudInfo.getTenantId();
try {
// Delete the Multicloud stack
- StackInfo stackInfo = deleteStack (cloudSiteId, tenantId, instanceId);
+ StackInfo stackInfo = deleteStack (cloudSiteId, cloudOwner, tenantId, instanceId);
// Populate a VduInstance based on the deleted Cloudify Deployment object
VduInstance vduInstance = stackInfoToVduInstance(stackInfo);
private String vnfId = "testVnfId";
private String tenantId = "testTenantId";
+ private String cloudOwner = "testCloudOwner";
private String cloudSiteId = "testCloudSiteId";
private boolean tenantCreated = true;
private boolean vnfCreated = true;
private String requestType = "testRequestType";
private String modelCustomizationUuid = "testModelCustimizationUuid";
private String orchestrationMode = "testOrchestrationMode";
- private static final String VNF_ROLLBACK_STRING = "VnfRollback: cloud=testCloudSiteId, tenant=testTenantId, vnf=testVnfId, "
+ private static final String VNF_ROLLBACK_STRING = "VnfRollback: cloud=testCloudSiteId, cloudOwner=testCloudOwner, tenant=testTenantId, vnf=testVnfId, "
+ "tenantCreated=true, vnfCreated=true, requestType = testRequestType, modelCustomizationUuid=testModelCustimizationUuid, mode=testOrchestrationMode";
@Test
public void VnfRollbackInstantiationTest() {
- vnfRollback = new VnfRollback(vnfId, tenantId, cloudSiteId, tenantCreated, vnfCreated,
+ vnfRollback = new VnfRollback(vnfId, tenantId, cloudOwner, cloudSiteId, tenantCreated, vnfCreated,
msoRequest, volumeGroupName, volumeGroupId, requestType, modelCustomizationUuid);
assertEquals(vnfId, vnfRollback.getVnfId());
assertEquals(tenantId, vnfRollback.getTenantId());
+ assertEquals(cloudOwner, vnfRollback.getCloudOwner());
assertEquals(cloudSiteId, vnfRollback.getCloudSiteId());
assertEquals(tenantCreated, vnfRollback.getTenantCreated());
assertEquals(vnfCreated, vnfRollback.getVnfCreated());
@Test
public void VnfRollbackInstantiationOrchestrationModeTest() {
- vnfRollback = new VnfRollback(vnfId, tenantId, cloudSiteId, tenantCreated, vnfCreated,
+ vnfRollback = new VnfRollback(vnfId, tenantId, cloudOwner, cloudSiteId, tenantCreated, vnfCreated,
msoRequest, volumeGroupName, volumeGroupId, requestType, modelCustomizationUuid, orchestrationMode);
assertEquals(vnfId, vnfRollback.getVnfId());
assertEquals(tenantId, vnfRollback.getTenantId());
+ assertEquals(cloudOwner, vnfRollback.getCloudOwner());
assertEquals(cloudSiteId, vnfRollback.getCloudSiteId());
assertEquals(tenantCreated, vnfRollback.getTenantCreated());
assertEquals(vnfCreated, vnfRollback.getVnfCreated());
@Test
public void toStringTest() {
- vnfRollback = new VnfRollback(vnfId, tenantId, cloudSiteId, tenantCreated, vnfCreated,
+ vnfRollback = new VnfRollback(vnfId, tenantId, cloudOwner, cloudSiteId, tenantCreated, vnfCreated,
msoRequest, volumeGroupName, volumeGroupId, requestType, modelCustomizationUuid, orchestrationMode);
assertEquals(VNF_ROLLBACK_STRING, vnfRollback.toString());
StubOpenStack.mockOpenStackResponseAccess(wireMockPort);
StubOpenStack.mockOpenStackPostStack_200("OpenstackResponse_Stack_Created.json");
StubOpenStack.mockOpenStackGet("TEST-stack/stackId");
- StackInfo stackInfo = heatUtils.createStack(cloudSite.getId(), "tenantId", "TEST-stack",
+ StackInfo stackInfo = heatUtils.createStack(cloudSite.getId(), "CloudOwner", "tenantId", "TEST-stack",
"TEST-heat", new HashMap<>(), false, 1, "TEST-env",
new HashMap<>(), new HashMap<>(), false);
assertNotNull(stackInfo);
@InjectMocks
private MsoHeatUtilsWithUpdate heatUtils;
+ private String cloudOwner;
private String cloudSiteId;
private String tenantId;
private String stackName;
public void before() {
MockitoAnnotations.initMocks(this);
+ cloudOwner = "cloudOwner";
cloudSiteId = "cloudSiteId";
tenantId = "tenantId";
stackName = "stackName";
doReturn("0").when(environment).getProperty(isA(String.class), isA(String.class));
doReturn(updateStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
- StackInfo actualStackInfo = heatUtils.updateStack(cloudSiteId, tenantId, stackName,
+ StackInfo actualStackInfo = heatUtils.updateStack(cloudSiteId, cloudOwner, tenantId, stackName,
heatTemplate, stackInputs, pollForCompletion, timeoutMinutes);
assertThat(actualStackInfo, sameBeanAs(expectedStackInfo));
doReturn("0").when(environment).getProperty(isA(String.class), isA(String.class));
doReturn(updateStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
- StackInfo actualStackInfo = heatUtils.updateStack(cloudSiteId, tenantId, stackName,
+ StackInfo actualStackInfo = heatUtils.updateStack(cloudSiteId, cloudOwner, tenantId, stackName,
heatTemplate, stackInputs, pollForCompletion, timeoutMinutes, environmentString);
assertThat(actualStackInfo, sameBeanAs(expectedStackInfo));
doReturn("0").when(environment).getProperty(isA(String.class), isA(String.class));
doReturn(updateStack).when(heatUtils).queryHeatStack(isA(Heat.class), isA(String.class));
- StackInfo actualStackInfo = heatUtils.updateStack(cloudSiteId, tenantId, stackName,
+ StackInfo actualStackInfo = heatUtils.updateStack(cloudSiteId, cloudOwner, tenantId, stackName,
heatTemplate, stackInputs, pollForCompletion, timeoutMinutes , environmentString, files);
assertThat(actualStackInfo, sameBeanAs(expectedStackInfo));
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withBody(CREATE_STACK_RESPONSE)
.withStatus(HttpStatus.SC_CREATED)));
- StackInfo result = multicloudUtils.createStack("MTN13", "TEST-tenant", "TEST-stack",
+ StackInfo result = multicloudUtils.createStack("MTN13", "CloudOwner", "TEST-tenant", "TEST-stack",
"TEST-heat", new HashMap<>(), false, 200, "TEST-env",
new HashMap<>(), new HashMap<>());
assertNotNull(result);
cloudSite.setIdentityService(new CloudIdentity());
when(cloudConfigMock.getCloudSite("MTN13")).
thenReturn(Optional.of(cloudSite));
- multicloudUtilsMock.createStack("MTN13", "TEST-tenant", "TEST-stack",
+ multicloudUtilsMock.createStack("MTN13", "CloudOwner", "TEST-tenant", "TEST-stack",
"TEST-heat", new HashMap<>(), false, 200, "TEST-env",
new HashMap<>(), new HashMap<>());
} catch (MsoException e) {
stubFor(post(urlPathEqualTo("/v2.0"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withStatus(HttpStatus.SC_BAD_REQUEST)));
- multicloudUtils.createStack("MTN13", "TEST-tenant", "TEST-stack",
+ multicloudUtils.createStack("MTN13", "CloudOwner", "TEST-tenant", "TEST-stack",
"TEST-heat", new HashMap<>(), false, 200, "TEST-env",
new HashMap<>(), new HashMap<>());
} catch (MsoException e) {
stubFor(post(urlPathEqualTo("/v2.0"))
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withStatus(HttpStatus.SC_CREATED)));
- StackInfo result = multicloudUtils.createStack("MTN13", "TEST-tenant", "TEST-stack",
+ StackInfo result = multicloudUtils.createStack("MTN13", "CloudOwner", "TEST-tenant", "TEST-stack",
"TEST-heat", new HashMap<>(), false, 200, "TEST-env",
new HashMap<>(), new HashMap<>());
assertNotNull(result);
* 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.
/**
* Cloud information structure for deploying/managing a VDU. Includes the cloud site
- * as well as tenant information within the site. Currently this is defined as a
+ * as well as tenant information within the site. Currently this is defined as a
* cloud site ID. which would map to a CloudConfig entry.
* Perhaps the CloudConfig entry itself should be provided, instead of requiring each
* plug-in to query it.
- *
+ *
* The meaning of 'tenant' may differ by cloud provider, but every cloud supports some
* sort of tenant partitioning.
- *
+ *
*/
public class CloudInfo {
-
+
private String cloudSiteId;
- private String tenantId;
+ private String cloudOwner;
+ private String tenantId;
private String tenantName;//bpmn query and pass
-
+
public CloudInfo() {
}
-
- public CloudInfo (String cloudSiteId, String tenantId, String tenantName) {
+
+ public CloudInfo (String cloudSiteId, String cloudOwner, String tenantId, String tenantName) {
this.cloudSiteId = cloudSiteId;
+ this.cloudOwner = cloudOwner;
this.tenantId = tenantId;
this.tenantName = tenantName;
}
-
+
public String getCloudSiteId() {
return cloudSiteId;
}
public void setCloudSiteId(String cloudSiteId) {
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
public String getTenantId() {
return tenantId;
}
public void setTenantName(String tenantName) {
this.tenantName = tenantName;
}
-
-
+
+
}
\ No newline at end of file
@XmlAccessorType(XmlAccessType.FIELD)
public class CreateVfModuleRequest extends VfRequestCommon {
private String cloudSiteId;
+ private String cloudOwner;
private String tenantId;
private String vnfId;
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
public String getTenantId() {
return tenantId;
}
@XmlAccessorType(XmlAccessType.FIELD)
public class CreateVolumeGroupRequest extends VfRequestCommon {
private String cloudSiteId;
+ private String cloudOwner;
private String tenantId;
private String volumeGroupName;
private String volumeGroupId;
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
public String getTenantId() {
return tenantId;
}
*/
private static final long serialVersionUID = -8504083539107392561L;
private String cloudSiteId;
+ private String cloudOwner;
private String tenantId;
private String vnfId;
private String vfModuleId;
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
public String getTenantId() {
return tenantId;
}
* 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.
@XmlRootElement(name = "deleteVolumeGroupRequest")
public class DeleteVolumeGroupRequest extends VfRequestCommon {
private String cloudSiteId;
+ private String cloudOwner;
private String tenantId;
private String volumeGroupId;
private String volumeGroupStackId;
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
public String getTenantId() {
return tenantId;
}
public void setMsoRequest(MsoRequest msoRequest) {
this.msoRequest = msoRequest;
}
-
+
@Override
public String toString() {
return new ToStringBuilder(this).appendSuper(super.toString()).append("cloudSiteId", cloudSiteId)
* 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.
public class UpdateVfModuleRequest extends VfRequestCommon {
private String cloudSiteId;
+ private String cloudOwner;
private String tenantId;
private String vnfId;
private String requestType;
private Boolean failIfExists;
private Boolean backout;
-
+
@XmlJavaTypeAdapter(MapAdapter.class)
private Map<String,Object> vfModuleParams = new HashMap<>();
private MsoRequest msoRequest = new MsoRequest();
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
public String getTenantId() {
return tenantId;
}
* 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.
@XmlAccessorType(XmlAccessType.FIELD)
public class UpdateVolumeGroupRequest extends VfRequestCommon {
private String cloudSiteId;
+ private String cloudOwner;
private String tenantId;
private String volumeGroupId;
private String volumeGroupStackId;
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
+
public String getTenantId() {
return tenantId;
}
* 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.
private String vfModuleStackId;
private boolean vfModuleCreated = false;
private String tenantId;
+ private String cloudOwner;
private String cloudSiteId;
private MsoRequest msoRequest;
private String messageId;
this.vfModuleStackId = vfModuleStackId;
this.vfModuleCreated = vrb.getVnfCreated();
this.tenantId = vrb.getTenantId();
+ this.cloudOwner = vrb.getCloudOwner();
this.cloudSiteId = vrb.getCloudSiteId();
this.msoRequest = vrb.getMsoRequest();
this.messageId = messageId;
public VfModuleRollback(String vnfId, String vfModuleId,
String vfModuleStackId, boolean vfModuleCreated, String tenantId,
+ String cloudOwner,
String cloudSiteId,
MsoRequest msoRequest,
String messageId) {
this.vfModuleStackId = vfModuleStackId;
this.vfModuleCreated = vfModuleCreated;
this.tenantId = tenantId;
+ this.cloudOwner = cloudOwner;
this.cloudSiteId = cloudSiteId;
this.msoRequest = msoRequest;
this.messageId = messageId;
public void setCloudSiteId(String cloudSiteId) {
this.cloudSiteId = cloudSiteId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
public MsoRequest getMsoRequest() {
return msoRequest;
}
* 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.
// “volumeGroupId”: “<A&AI_ VOLUME_GROUP_ID>”,
// “volumeGroupStackId”: “<VOLUME_GROUP _STACK_ID>”,
// “tenantId”: “<TENANT_ID>”,
+// "cloudOwnerId"" "<CLOUD_OWNER>",
// “cloudSiteId”: “<CLOUD_CLLI>”,
// “volumeGroupCreated”: TRUE|FALSE,
// “msoRequest”: {
private String volumeGroupId;
private String volumeGroupStackId;
private String tenantId;
+ private String cloudOwnerId;
private String cloudSiteId;
private boolean volumeGroupCreated = false;
private MsoRequest msoRequest;
this.volumeGroupId = vrb.getVolumeGroupId();
this.volumeGroupStackId = volumeGroupStackId;
this.tenantId = vrb.getTenantId();
+ this.cloudOwnerId = vrb.getCloudOwnerId();
this.cloudSiteId = vrb.getCloudSiteId();
this.volumeGroupCreated = vrb.isVolumeGroupCreated();
this.msoRequest = vrb.getMsoRequest();
String volumeGroupStackId,
boolean volumeGroupCreated,
String tenantId,
+ String cloudOwnerId,
String cloudSiteId,
MsoRequest msoRequest,
String messageId)
this.volumeGroupStackId = volumeGroupStackId;
this.volumeGroupCreated = volumeGroupCreated;
this.tenantId = tenantId;
+ this.cloudOwnerId = cloudOwnerId;
this.cloudSiteId = cloudSiteId;
this.msoRequest = msoRequest;
this.messageId = messageId;
public void setCloudSiteId(String cloudSiteId) {
this.cloudSiteId = cloudSiteId;
}
- public boolean isVolumeGroupCreated() {
+ public String getCloudOwnerId() {
+ return cloudOwnerId;
+ }
+ public void setCloudOwnerId(String cloudOwnerId) {
+ this.cloudOwnerId = cloudOwnerId;
+ }public boolean isVolumeGroupCreated() {
return volumeGroupCreated;
}
public void setVolumeGroupCreated(boolean volumeGroupCreated) {
* 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.
public class VnfRollback {
private String vnfId;
private String tenantId;
+ private String cloudOwner;
private String cloudSiteId;
private boolean tenantCreated = false;
private boolean vnfCreated = false;
/**
* For backwards compatibility... orchestration mode defaults to HEAT
- *
+ *
* @param vnfId
* @param tenantId
+ * @param cloudOwner
* @param cloudSiteId
* @param tenantCreated
* @param vnfCreated
* @param requestType
* @param modelCustomizationUuid
*/
- public VnfRollback(String vnfId, String tenantId, String cloudSiteId,
+ public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId,
boolean tenantCreated, boolean vnfCreated,
MsoRequest msoRequest,
String volumeGroupName, String volumeGroupId, String requestType, String modelCustomizationUuid) {
super();
this.vnfId = vnfId;
this.tenantId = tenantId;
+ this.cloudOwner = cloudOwner;
this.cloudSiteId = cloudSiteId;
this.tenantCreated = tenantCreated;
this.vnfCreated = vnfCreated;
}
/**
- *
+ *
* @param vnfId
* @param tenantId
+ * @param cloudOwner
* @param cloudSiteId
* @param tenantCreated
* @param vnfCreated
* @param requestType
* @param modelCustomizationUuid
*/
- public VnfRollback(String vnfId, String tenantId, String cloudSiteId,
+ public VnfRollback(String vnfId, String tenantId, String cloudOwner, String cloudSiteId,
boolean tenantCreated, boolean vnfCreated,
MsoRequest msoRequest, String volumeGroupName, String volumeGroupId,
String requestType, String modelCustomizationUuid, String orchestrationMode) {
super();
this.vnfId = vnfId;
this.tenantId = tenantId;
+ this.cloudOwner = cloudOwner;
this.cloudSiteId = cloudSiteId;
this.tenantCreated = tenantCreated;
this.vnfCreated = vnfCreated;
public void setCloudSiteId(String cloudId) {
this.cloudSiteId = cloudId;
}
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+ public void setCloudOwner(String cloudOwner) {
+ this.cloudOwner = cloudOwner;
+ }
public boolean getTenantCreated() {
return tenantCreated;
}
}
@Override
public String toString() {
- return "VnfRollback: cloud=" + cloudSiteId + ", tenant=" + tenantId +
+ return "VnfRollback: owner=" + cloudOwner + ", cloud=" + cloudSiteId + ", tenant=" + tenantId +
", vnf=" + vnfId + ", tenantCreated=" + tenantCreated +
", vnfCreated=" + vnfCreated + ", requestType = " + requestType
+ ", modelCustomizationUuid=" + this.modelCustomizationUuid
<createVfModuleRequest>
<cloudSiteId>RegionOne</cloudSiteId>
+ <cloudOwner>CloudOwner</cloudOwner>
<tenantId>09d8566ea45e43aa974cf447ed591d77</tenantId>
<vnfId>8daea639-82b9-4da6-aec9-5054f006a82d</vnfId>
<vnfName>vcpe_vnf_vcpe_infra_201903101808</vnfName>
</msoRequest>
<messageId>11c8ec20-a1f8-4aa2-926f-e55d67a30f8b-1552241542248</messageId>
<notificationUrl>http://so-bpmn-infra.onap:8081/mso/WorkflowMessage/VNFAResponse/11c8ec20-a1f8-4aa2-926f-e55d67a30f8b-1552241542248</notificationUrl>
-</createVfModuleRequest>
\ No newline at end of file
+</createVfModuleRequest>
* 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.
private static final String CREATE_NETWORK_CONTEXT = "CreateNetwork";
private static final String MSO_CONFIGURATION_ERROR = "MsoConfigurationError";
private static final String NEUTRON_MODE = "NEUTRON";
-
+
private static final Logger logger = LoggerFactory.getLogger(MsoNetworkAdapterImpl.class);
@Autowired
private MsoHeatUtilsWithUpdate heatWithUpdate;
@Autowired
private MsoCommonUtils commonUtils;
-
- @Autowired
+
+ @Autowired
private NetworkResourceCustomizationRepository networkCustomRepo;
-
+
@Autowired
private CollectionNetworkResourceCustomizationRepository collectionNetworkCustomRepo;
-
+
@Autowired
private NetworkResourceRepository networkResourceRepo;
/**
StackInfo heatStack = null;
long queryNetworkStarttime = System.currentTimeMillis ();
try {
- heatStack = heat.queryStack (cloudSiteId, tenantId, networkName);
+ heatStack = heat.queryStack (cloudSiteId, "CloudOwner", tenantId, networkName);
} catch (MsoException me) {
me.addContext (CREATE_NETWORK_CONTEXT);
logger.error("{} {} Create Network (heat): query network {} in {}/{}: ",
if (backout == null)
backout = true;
heatStack = heat.createStack (cloudSiteId,
+ "CloudOwner",
tenantId,
networkName,
template,
logger.debug("Network {} successfully created via HEAT", networkName);
}
-
+
return;
}
-
+
NetworkResource networkResource = networkCheck(
startTime,
networkType,
StackInfo heatStack = null;
long queryStackStarttime = System.currentTimeMillis();
try {
- heatStack = heat.queryStack(cloudSiteId, tenantId, networkName);
+ heatStack = heat.queryStack(cloudSiteId, "CloudOwner", tenantId, networkName);
} catch (MsoException me) {
me.addContext(UPDATE_NETWORK_CONTEXT);
logger.error("{} {} Exception - QueryStack query {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
boolean aic3template = false;
String aic3nw = AIC3_NW;
-
+
aic3nw = environment.getProperty(AIC3_NW_PROPERTY, AIC3_NW);
-
+
if (template.contains(aic3nw))
aic3template = true;
long updateStackStarttime = System.currentTimeMillis();
try {
heatStack = heatWithUpdate.updateStack(cloudSiteId,
+ "CloudOwner",
tenantId,
networkId,
template,
throw new NetworkException(error, MsoExceptionCategory.USERDATA);
}
-
+
return networkResource;
}
StackInfo heatStack = null;
long queryStackStarttime = System.currentTimeMillis ();
try {
- heatStack = heat.queryStack (cloudSiteId, tenantId, networkNameOrId);
+ heatStack = heat.queryStack (cloudSiteId, "CloudOwner", tenantId, networkNameOrId);
} catch (MsoException me) {
me.addContext ("QueryNetwork");
logger.error("{} {} Exception - Query Network (heat): {} in {}/{} ", MessageEnum.RA_QUERY_NETWORK_EXC,
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
-
+
if (commonUtils.isNullOrEmpty (cloudSiteId)
|| commonUtils.isNullOrEmpty(tenantId)
|| commonUtils.isNullOrEmpty(networkId)) {
// Retrieve the Network Resource definition
NetworkResource networkResource = null;
-
+
if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) {
if (!commonUtils.isNullOrEmpty(networkType)) {
networkResource = networkResourceRepo.findFirstByModelNameOrderByModelVersionDesc(networkType);
networkResource = nrc.getNetworkResource();
}
}
-
+
String mode = "";
if (networkResource != null) {
logger.debug("Got Network definition from Catalog: {}", networkResource.toString());
// The deleteStack function in MsoHeatUtils returns NOTFOUND if the stack was not found or if the stack was deleted.
// So query first to report back if stack WAS deleted or just NOTOFUND
StackInfo heatStack = null;
- heatStack = heat.queryStack(cloudSiteId, tenantId, networkId);
+ heatStack = heat.queryStack(cloudSiteId, "CloudOwner", tenantId, networkId);
if (heatStack != null && heatStack.getStatus() != HeatStatus.NOTFOUND)
{
- heat.deleteStack (tenantId, cloudSiteId, networkId, true);
+ heat.deleteStack (tenantId, "CloudOwner", cloudSiteId, networkId, true);
networkDeleted.value = true;
}
else
throw new NetworkException (me);
}
}
-
+
// On success, nothing is returned.
return;
// Retrieve the Network Resource definition
NetworkResource networkResource = null;
if (commonUtils.isNullOrEmpty(modelCustomizationUuid)) {
- networkResource = networkCustomRepo.findOneByNetworkType(networkType).getNetworkResource();
+ networkResource = networkCustomRepo.findOneByNetworkType(networkType).getNetworkResource();
} else {
networkResource = networkCustomRepo.findOneByModelCustomizationUUID(modelCustomizationUuid).getNetworkResource();
}
try {
// The deleteStack function in MsoHeatUtils returns success if the stack
// was not found. So don't bother to query first.
- heat.deleteStack (tenantId, cloudSiteId, networkId, true);
+ heat.deleteStack (tenantId, "CloudOwner", cloudSiteId, networkId, true);
} catch (MsoException me) {
me.addContext ("RollbackNetwork");
logger.error("{} {} Exception - Rollback Network (heat): {} in {}/{} ",
stackParams.put (VLANS, csl);
}
if (routeTargets != null) {
-
+
String rtGlobal = "";
String rtImport = "";
String rtExport = "";
logger.debug("Input RT:{}", rt);
String role = rt.getRouteTargetRole();
String rtValue = rt.getRouteTarget();
-
+
if ("IMPORT".equalsIgnoreCase(role))
{
sep = rtImport.isEmpty() ? "" : ",";
}
}
-
+
if (!rtImport.isEmpty())
{
stackParams.put ("route_targets_import", rtImport);
* 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.
@Autowired
private Environment environment;
-
+
private static final String VALET_BASE_URL = "org.onap.so.adapters.valet.base_url";
private static final String VALET_BASE_PATH = "org.onap.so.adapters.valet.base_path";
private static final String VALET_AUTH = "org.onap.so.adapters.valet.basic_auth";
private static final String REQ_ID_HEADER_NAME = "X-RequestID";
protected static final String NO_STATUS_RETURNED = "no status returned from Valet";
-
+
private static final String DEFAULT_BASE_URL = "http://localhost:8080/";
private static final String DEFAULT_BASE_PATH = "api/valet/placement/v1";
private static final String DEFAULT_AUTH_STRING = "";
private static final String BODY=", body=";
@Autowired
private ObjectMapper mapper;
-
+
protected String baseUrl;
protected String basePath;
protected String authString;
-
- /*
- * Setup the properties needed from properties file. Each will fall to a default
+
+ /*
+ * Setup the properties needed from properties file. Each will fall to a default
*/
@PostConstruct
private void setupParams() {
logger.debug("Error retrieving valet properties. {}", e.getMessage());
}
}
-
+
/*
- * This method will be invoked to send a Create request to Valet.
+ * This method will be invoked to send a Create request to Valet.
*/
- public GenericValetResponse<ValetCreateResponse> callValetCreateRequest(String requestId, String regionId, String tenantId, String serviceInstanceId,
+ public GenericValetResponse<ValetCreateResponse> callValetCreateRequest(String requestId, String regionId, String ownerId, String tenantId, String serviceInstanceId,
String vnfId, String vnfName, String vfModuleId, String vfModuleName, String keystoneUrl, HeatRequest heatRequest) throws Exception {
ResponseEntity<ValetCreateResponse> response = null;
GenericValetResponse<ValetCreateResponse> gvr = null;
try {
UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
URI uri = builder.build();
-
- ValetCreateRequest vcr = this.createValetCreateRequest(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
+
+ ValetCreateRequest vcr = this.createValetCreateRequest(regionId, ownerId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
String body = mapper.writeValueAsString(vcr);
HttpHeaders headers = generateHeaders(requestId);
- HttpEntity<String> entity = new HttpEntity<>(body, headers);
-
+ HttpEntity<String> entity = new HttpEntity<>(body, headers);
+
response = getRestTemplate().exchange(uri, HttpMethod.POST, entity, ValetCreateResponse.class);
gvr = this.getGVRFromResponse(response);
} catch (Exception e) {
}
return gvr;
}
-
+
private RestTemplate getRestTemplate(){
RestTemplate restTemplate = new RestTemplate();
restTemplate.setRequestFactory(new BufferingClientHttpRequestFactory(new HttpComponentsClientHttpRequestFactory()));
return restTemplate;
}
-
+
/*
- * This method will be invoked to send an Update request to Valet.
+ * This method will be invoked to send an Update request to Valet.
*/
- public GenericValetResponse<ValetUpdateResponse> callValetUpdateRequest(String requestId, String regionId, String tenantId, String serviceInstanceId,
+ public GenericValetResponse<ValetUpdateResponse> callValetUpdateRequest(String requestId, String regionId, String ownerId, String tenantId, String serviceInstanceId,
String vnfId, String vnfName, String vfModuleId, String vfModuleName, String keystoneUrl, HeatRequest heatRequest) throws Exception {
ResponseEntity<ValetUpdateResponse> response = null;
GenericValetResponse<ValetUpdateResponse> gvr = null;
try {
UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
URI uri = builder.build();
-
- ValetUpdateRequest vur = this.createValetUpdateRequest(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
+
+ ValetUpdateRequest vur = this.createValetUpdateRequest(regionId, ownerId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
String body = mapper.writeValueAsString(vur);
- HttpHeaders headers = generateHeaders(requestId);
+ HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
-
-
+
+
response = getRestTemplate().exchange(uri, HttpMethod.PUT, entity, ValetUpdateResponse.class);
gvr = this.getGVRFromResponse(response);
} catch (Exception e) {
}
return gvr;
}
-
+
/*
* This method will be invoked to send a Delete request to Valet.
*/
- public GenericValetResponse<ValetDeleteResponse> callValetDeleteRequest(String requestId, String regionId, String tenantId, String vfModuleId, String vfModuleName) throws Exception {
+ public GenericValetResponse<ValetDeleteResponse> callValetDeleteRequest(String requestId, String regionId, String ownerId, String tenantId, String vfModuleId, String vfModuleName) throws Exception {
ResponseEntity<ValetDeleteResponse> response = null;
GenericValetResponse<ValetDeleteResponse> gvr = null;
try {
UriBuilder builder = UriBuilder.fromPath(baseUrl).path(basePath).queryParam(REQUEST_ID, requestId);
URI uri = builder.build();
-
- ValetDeleteRequest vdr = this.createValetDeleteRequest(regionId, tenantId, vfModuleId, vfModuleName);
-
+
+ ValetDeleteRequest vdr = this.createValetDeleteRequest(regionId, ownerId, tenantId, vfModuleId, vfModuleName);
+
String body = mapper.writeValueAsString(vdr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
-
-
+
+
response = getRestTemplate().exchange(uri, HttpMethod.DELETE, entity, ValetDeleteResponse.class);
gvr = this.getGVRFromResponse(response);
} catch (Exception e) {
}
return gvr;
}
-
+
/*
- * This method is called to invoke a Confirm request to Valet.
+ * This method is called to invoke a Confirm request to Valet.
*/
public GenericValetResponse<ValetConfirmResponse> callValetConfirmRequest(String requestId, String stackId) throws Exception {
ResponseEntity<ValetConfirmResponse> response = null;
try {
UriBuilder builder = UriBuilder.fromPath(this.baseUrl).path(this.basePath).path("{requestId}/confirm/");
URI uri = builder.build(requestId);
-
+
ValetConfirmRequest vcr = this.createValetConfirmRequest(stackId);
-
+
String body = mapper.writeValueAsString(vcr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
}
return gvr;
}
-
- /*
+
+ /*
* This method is called to invoke a Rollback request to Valet.
*/
public GenericValetResponse<ValetRollbackResponse> callValetRollbackRequest(String requestId, String stackId, Boolean suppressRollback, String errorMessage) throws Exception {
try {
UriBuilder builder = UriBuilder.fromPath(this.baseUrl).path(this.basePath).path("{requestId}/rollback/");
URI uri = builder.build(requestId);
-
+
ValetRollbackRequest vrr = this.createValetRollbackRequest(stackId, suppressRollback, errorMessage);
-
+
String body = mapper.writeValueAsString(vrr);
HttpHeaders headers = generateHeaders(requestId);
HttpEntity<String> entity = new HttpEntity<>(body, headers);
-
-
+
+
response = getRestTemplate().exchange(uri, HttpMethod.PUT, entity, ValetRollbackResponse.class);
gvr = this.getGVRFromResponse(response);
} catch (Exception e) {
}
return gvr;
}
-
+
/*
* This method is to construct the ValetCreateRequest pojo
*/
- private ValetCreateRequest createValetCreateRequest(String regionId, String tenantId, String serviceInstanceId,
+ private ValetCreateRequest createValetCreateRequest(String regionId, String ownerId, String tenantId, String serviceInstanceId,
String vnfId, String vnfName, String vfModuleId, String vfModuleName, String keystoneUrl, HeatRequest heatRequest) {
ValetCreateRequest vcr = new ValetCreateRequest();
vcr.setHeatRequest(heatRequest);
vcr.setKeystoneUrl(keystoneUrl);
vcr.setRegionId(regionId);
+ vcr.setOwnerId(ownerId);
vcr.setServiceInstanceId(serviceInstanceId);
vcr.setTenantId(tenantId);
vcr.setVfModuleId(vfModuleId);
vcr.setVfModuleName(vfModuleName);
vcr.setVnfId(vnfId);
vcr.setVnfName(vnfName);
-
+
return vcr;
}
-
+
/*
* This method is to construct the ValetUpdateRequest pojo
*/
- private ValetUpdateRequest createValetUpdateRequest(String regionId, String tenantId, String serviceInstanceId,
+ private ValetUpdateRequest createValetUpdateRequest(String regionId, String ownerId, String tenantId, String serviceInstanceId,
String vnfId, String vnfName, String vfModuleId, String vfModuleName, String keystoneUrl, HeatRequest heatRequest) {
ValetUpdateRequest vur = new ValetUpdateRequest();
vur.setHeatRequest(heatRequest);
vur.setKeystoneUrl(keystoneUrl);
vur.setRegionId(regionId == null ? "" : regionId);
+ vur.setOwnerId(ownerId == null ? "" : ownerId);
vur.setServiceInstanceId(serviceInstanceId == null ? "" : serviceInstanceId);
vur.setTenantId(tenantId == null ? "" : tenantId);
vur.setVfModuleId(vfModuleId == null ? "" : vfModuleId);
vur.setVfModuleName(vfModuleName == null ? "" : vfModuleName);
vur.setVnfId(vnfId == null ? "" : vnfId);
vur.setVnfName(vnfName == null ? "" : vnfName);
-
+
return vur;
}
-
+
/*
* This method is to construct the ValetDeleteRequest pojo
*/
- private ValetDeleteRequest createValetDeleteRequest(String regionId, String tenantId, String vfModuleId, String vfModuleName) {
+ private ValetDeleteRequest createValetDeleteRequest(String regionId, String ownerId, String tenantId, String vfModuleId, String vfModuleName) {
ValetDeleteRequest vdr = new ValetDeleteRequest();
vdr.setRegionId(regionId == null ? "" : regionId);
+ vdr.setOwnerId(ownerId == null ? "" : ownerId);
vdr.setTenantId(tenantId == null ? "" : tenantId);
vdr.setVfModuleId(vfModuleId == null ? "" : vfModuleId);
vdr.setVfModuleName(vfModuleName == null ? "" : vfModuleName);
-
+
return vdr;
}
-
+
/*
* This method is to construct the ValetDeleteRequest pojo
*/
private ValetConfirmRequest createValetConfirmRequest(String stackId) {
ValetConfirmRequest vcr = new ValetConfirmRequest();
vcr.setStackId(stackId);
-
+
return vcr;
}
-
+
/*
* This method is to construct the ValetRollbackRequest pojo
*/
vrr.setStackId(stackId);
vrr.setSuppressRollback(suppressRollback);
vrr.setErrorMessage(errorMessage);
-
+
return vrr;
}
-
+
private HttpHeaders generateHeaders(String requestId) {
HttpHeaders headers = new HttpHeaders();
headers.add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON);
headers.add("Authorization", "Basic " + this.authString);
}
headers.add(ValetClient.REQ_ID_HEADER_NAME, requestId);
-
+
return headers;
}
-
+
private <T> GenericValetResponse<T> getGVRFromResponse(ResponseEntity<T> response) {
GenericValetResponse<T> gvr = null;
if (response != null) {
T responseObj = response.getBody();
gvr = new GenericValetResponse<>(response.getStatusCodeValue(), ValetClient.NO_STATUS_RETURNED, responseObj);
-
+
} else {
gvr = new GenericValetResponse<>(-1, ValetClient.NO_STATUS_RETURNED, null);
}
* 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.
*/
public class ValetCreateRequest implements Serializable {
private static final long serialVersionUID = 768026109321305392L;
-
+
@JsonProperty("region_id")
private String regionId;
+ @JsonProperty("owner_id")
+ private String ownerId;
@JsonProperty("tenant_id")
private String tenantId;
@JsonProperty("service_instance_id")
private String keystoneUrl;
@JsonProperty("heat_request")
private HeatRequest heatRequest;
-
+
public ValetCreateRequest() {
super();
}
-
+
public String getRegionId() {
return this.regionId;
}
public void setRegionId(String regionId) {
this.regionId = regionId;
}
+ public String getOwnerId() {
+ return this.ownerId;
+ }
+ public void setOwnerId(String ownerId) {
+ this.ownerId = ownerId;
+ }
public String getTenantId() {
return this.tenantId;
}
public void setHeatRequest(HeatRequest heatRequest) {
this.heatRequest = heatRequest;
}
-
+
@Override
public int hashCode() {
- return Objects.hash(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
+ return Objects.hash(regionId, ownerId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
}
@Override
public boolean equals(Object o) {
return false;
}
ValetCreateRequest vcr = (ValetCreateRequest) o;
- return Objects.equals(regionId, vcr.regionId)
+ return Objects.equals(regionId, vcr.regionId)
+ && Objects.equals(ownerId, vcr.ownerId)
&& Objects.equals(tenantId, vcr.tenantId)
&& Objects.equals(serviceInstanceId, vcr.serviceInstanceId)
&& Objects.equals(vnfId, vcr.vnfId)
* 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.
*/
public class ValetDeleteRequest implements Serializable {
private static final long serialVersionUID = 768026109321305392L;
-
+
@JsonProperty("region_id")
private String regionId;
+ @JsonProperty("owner_id")
+ private String ownerId;
@JsonProperty("tenant_id")
private String tenantId;
@JsonProperty("vf_module_id")
private String vfModuleId;
@JsonProperty("vf_module_name")
private String vfModuleName;
-
+
public String getRegionId() {
return this.regionId;
}
public void setRegionId(String regionId) {
this.regionId = regionId;
}
+ public String getOwnerId() {
+ return this.ownerId;
+ }
+ public void setOwnerId(String ownerId) {
+ this.ownerId = ownerId;
+ }
public String getTenantId() {
return this.tenantId;
}
}
@Override
public int hashCode() {
- return Objects.hash(regionId, tenantId, vfModuleId, vfModuleName);
+ return Objects.hash(regionId, ownerId, tenantId, vfModuleId, vfModuleName);
}
@Override
public boolean equals(Object o) {
return false;
}
ValetDeleteRequest vdr = (ValetDeleteRequest) o;
- return Objects.equals(regionId, vdr.regionId)
+ return Objects.equals(regionId, vdr.regionId)
+ && Objects.equals(ownerId, vdr.ownerId)
&& Objects.equals(tenantId, vdr.tenantId)
&& Objects.equals(vfModuleId, vdr.vfModuleId)
&& Objects.equals(vfModuleName, vdr.vfModuleName);
* 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.
@JsonProperty("region_id")
private String regionId;
+ @JsonProperty("owner)_id")
+ private String ownerId;
@JsonProperty("tenant_id")
private String tenantId;
@JsonProperty("service_instance_id")
private String keystoneUrl;
@JsonProperty("heat_request")
private HeatRequest heatRequest;
-
+
public ValetUpdateRequest() {
super();
}
-
+
public String getRegionId() {
return this.regionId;
}
public void setRegionId(String regionId) {
this.regionId = regionId;
}
+ public String getOwnerId() {
+ return this.ownerId;
+ }
+ public void setOwnerId(String ownerId) {
+ this.ownerId = ownerId;
+ }
public String getTenantId() {
return this.tenantId;
}
}
@Override
public int hashCode() {
- return Objects.hash(regionId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
+ return Objects.hash(regionId, ownerId, tenantId, serviceInstanceId, vnfId, vnfName, vfModuleId, vfModuleName, keystoneUrl, heatRequest);
}
@Override
return false;
}
ValetUpdateRequest vur = (ValetUpdateRequest) o;
- return Objects.equals(regionId, vur.regionId)
+ return Objects.equals(regionId, vur.regionId)
+ && Objects.equals(ownerId, vur.ownerId)
&& Objects.equals(tenantId, vur.tenantId)
- && Objects.equals(serviceInstanceId, vur.serviceInstanceId)
+ && Objects.equals(serviceInstanceId, vur.serviceInstanceId)
&& Objects.equals(vnfId, vur.vnfId)
&& Objects.equals(vnfName, vur.vnfName)
&& Objects.equals(vfModuleId, vur.vfModuleId)
*/
@WebMethod
public void createVnf (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfType") @XmlElement(required=true) String vnfType,
@WebParam(name="vnfVersion") @XmlElement(required=false) String vnfVersion,
@WebMethod
public void updateVnf (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfType") @XmlElement(required=true) String vnfType,
@WebParam(name="vnfVersion") @XmlElement(required=false) String vnfVersion,
@WebMethod
public void queryVnf (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="request") MsoRequest msoRequest,
@WebMethod
public void deleteVnf (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="request") MsoRequest msoRequest)
@WebMethod
public void createVfModule (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfType") @XmlElement(required=true) String vnfType,
@WebParam(name="vnfVersion") @XmlElement(required=false) String vnfVersion,
@WebMethod
public void deleteVfModule (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vfName") @XmlElement(required=true) String vfName,
@WebParam(name="request") MsoRequest msoRequest,
@WebMethod
public void updateVfModule (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfType") @XmlElement(required=true) String vnfType,
@WebParam(name="vnfVersion") @XmlElement(required=false) String vnfVersion,
* 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.
@WebMethod
@Oneway
public void createVnfA (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
- @WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
+ @WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfType") @XmlElement(required=true) String vnfType,
@WebParam(name="vnfVersion") @XmlElement(required=false) String vnfVersion,
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
-
+
@WebMethod
@Oneway
public void updateVnfA (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfType") @XmlElement(required=true) String vnfType,
@WebParam(name="vnfVersion") @XmlElement(required=false) String vnfVersion,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="request") MsoRequest msoRequest,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
-
+
@WebMethod
@Oneway
public void queryVnfA (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebMethod
@Oneway
public void deleteVnfA (@WebParam(name="cloudSiteId") @XmlElement(required=true) String cloudSiteId,
+ @WebParam(name="cloudOwner") @XmlElement(required=false) String cloudOwner,
@WebParam(name="tenantId") @XmlElement(required=true) String tenantId,
@WebParam(name="vnfName") @XmlElement(required=true) String vnfName,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="messageId") @XmlElement(required=true) String messageId,
@WebParam(name="notificationUrl") @XmlElement(required=true) String notificationUrl );
-
+
@WebMethod
public void healthCheckA ();
}
* 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.
private static final String BPEL_AUTH_PROP = "org.onap.so.adapters.vnf.bpelauth";
private static final String ENCRYPTION_KEY_PROP = "org.onap.so.adapters.network.encryptionKey";
-
+
@Autowired
private Environment environment;
-
+
@Autowired
private MsoVnfAdapterImpl vnfImpl;
* and translating the response to an asynchronous notification.
*
* @param cloudSiteId CLLI code of the cloud site in which to create the VNF
+ * @param cloudOwner cloud owner of the cloud site in which to create the VNF
* @param tenantId Openstack tenant identifier
* @param vnfType VNF type key, should match a VNF definition in catalog DB
* @param vnfName Name to be assigned to the new VNF
*/
@Override
public void createVnfA (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
try {
vnfAdapter.createVnf (cloudSiteId,
+ cloudOwner,
tenantId,
vnfType,
vnfVersion,
@Override
public void updateVnfA (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
Holder <VnfRollback> vnfRollback = new Holder <> ();
try {
- vnfAdapter.updateVnf (cloudSiteId, tenantId, vnfType,vnfVersion, vnfName, requestType, volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback);
+ vnfAdapter.updateVnf (cloudSiteId, cloudOwner, tenantId, vnfType,vnfVersion, vnfName, requestType, volumeGroupHeatStackId, inputs, msoRequest, outputs, vnfRollback);
} catch (VnfException e) {
logger.error("{} {} Exception sending updateVnf notification ", MessageEnum.RA_UPDATE_VNF_ERR,
ErrorCode.BusinessProcesssError.getValue(), e);
* ID, its status, and the set of outputs (from when the stack was created).
*
* @param cloudSiteId CLLI code of the cloud site in which to query
+ * @param cloudOwner cloud owner of cloud site in which to query
* @param tenantId Openstack tenant identifier
* @param vnfName VNF Name or Openstack ID
* @param msoRequest Request tracking information for logs
*/
@Override
public void queryVnfA (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
String messageId,
Holder <Map <String, String>> outputs = new Holder <> ();
try {
- vnfAdapter.queryVnf (cloudSiteId, tenantId, vnfName, msoRequest, vnfExists, vnfId, status, outputs);
+ vnfAdapter.queryVnf (cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest, vnfExists, vnfId, status, outputs);
} catch (VnfException e) {
logger.error("{} {} Exception sending queryVnfA notification ", MessageEnum.RA_QUERY_VNF_ERR,
ErrorCode.BusinessProcesssError.getValue(), e);
* The method has no outputs.
*
* @param cloudSiteId CLLI code of the cloud site in which to delete
+ * @param cloudOwner cloud owner of cloud site in which to delete
* @param tenantId Openstack tenant identifier
* @param vnfName VNF Name or Openstack ID
* @param msoRequest Request tracking information for logs
*/
@Override
public void deleteVnfA (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
String messageId,
MsoVnfAdapter vnfAdapter = vnfImpl;
try {
- vnfAdapter.deleteVnf (cloudSiteId, tenantId, vnfName, msoRequest);
+ vnfAdapter.deleteVnf (cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest);
} catch (VnfException e) {
logger.error("{} {} Exception sending deleteVnfA notification ", MessageEnum.RA_DELETE_VNF_ERR,
ErrorCode.BusinessProcesssError.getValue(), e);
return notifyPort;
}
-
+
public String getEncryptedProperty(String key, String defaultValue, String encryptionKey) {
try {
return CryptoUtils.decrypt(this.environment.getProperty(key), this.environment.getProperty(encryptionKey));
* orchestrator fails on a subsequent operation.
*
* @param cloudSiteId CLLI code of the cloud site in which to create the VNF
+ * @param cloudOwner cloud owner of the cloud region in which to create the VNF
* @param tenantId Openstack tenant identifier
* @param vnfType VNF type key, should match a VNF definition in catalog DB
* @param vnfVersion VNF version key, should match a VNF definition in catalog DB
*/
@Override
public void createVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
logger.debug("ERROR trying to parse the volumeGroupHeatStackId " + volumeGroupHeatStackId,e);
}
this.createVfModule(cloudSiteId,
+ cloudOwner,
tenantId,
vnfType,
vnfVersion,
newRequestTypeSb.append(requestType);
}
this.createVfModule(cloudSiteId,
- tenantId,
+ cloudOwner,
+ tenantId,
vnfType,
vnfVersion,
genericVnfId,
- vnfName,
+ vnfName,
vfModuleId,
newRequestTypeSb.toString(),
vfVolGroupHeatStackId,
@Override
public void updateVnf(String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
*/
@Override
public void queryVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest,
StackInfo heatStack = null;
long subStartTime = System.currentTimeMillis ();
try {
- heatStack = heat.queryStack (cloudSiteId, tenantId, vnfName);
+ heatStack = heat.queryStack (cloudSiteId, cloudOwner, tenantId, vnfName);
} catch (MsoException me) {
me.addContext ("QueryVNF");
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
- String error = "Query VNF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
+ String error = "Query VNF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
tenantId, "OpenStack", "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryStack",
me);
* The method has no outputs.
*
* @param cloudSiteId CLLI code of the cloud site in which to delete
+ * @param cloudOwner cloud owner of the cloud region in which to delete
* @param tenantId Openstack tenant identifier
* @param vnfName VNF Name or Openstack ID
* @param msoRequest Request tracking information for logs
*/
@Override
public void deleteVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest) throws VnfException {
// could be thrown.
long subStartTime = System.currentTimeMillis ();
try {
- heat.deleteStack (tenantId, cloudSiteId, vnfName, true);
+ heat.deleteStack (tenantId, cloudOwner, cloudSiteId, vnfName, true);
} catch (MsoException me) {
me.addContext ("DeleteVNF");
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
- String error = "Delete VNF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Delete VNF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "DeleteVNF", ErrorCode.DataError.getValue(), "Exception - DeleteVNF",
me);
logger.debug(error);
// Get the elements of the VnfRollback object for easier access
String cloudSiteId = rollback.getCloudSiteId ();
+ String cloudOwner = rollback.getCloudOwner ();
String tenantId = rollback.getTenantId ();
String vnfId = rollback.getVnfId ();
- logger.debug("Rolling Back VNF {} in {}", vnfId, cloudSiteId + "/" + tenantId);
+ logger.debug("Rolling Back VNF {} in {}", vnfId, cloudOwner + "/" + cloudSiteId + "/" + tenantId);
// Use the MsoHeatUtils to delete the stack. Set the polling flag to true.
// The possible outcomes of deleteStack are a StackInfo object with status
// of NOTFOUND (on success) or FAILED (on error). Also, MsoOpenstackException
// could be thrown.
try {
- heat.deleteStack (tenantId, cloudSiteId, vnfId, true);
+ heat.deleteStack (tenantId, cloudOwner, cloudSiteId, vnfId, true);
} catch (MsoException me) {
// Failed to rollback the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("RollbackVNF");
- String error = "Rollback VNF: " + vnfId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfId, cloudSiteId,
+ String error = "Rollback VNF: " + vnfId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfId, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "DeleteStack", ErrorCode.DataError.getValue(),
"Exception - DeleteStack", me);
logger.debug(error);
@Override
public void createVfModule(String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
// Build a default rollback object (no actions performed)
VnfRollback vfRollback = new VnfRollback();
vfRollback.setCloudSiteId(cloudSiteId);
+ vfRollback.setCloudOwner(cloudOwner);
vfRollback.setTenantId(tenantId);
vfRollback.setMsoRequest(msoRequest);
vfRollback.setRequestType(requestTypeString);
StackInfo heatStack = null;
long subStartTime1 = System.currentTimeMillis ();
try {
- heatStack = heat.queryStack (cloudSiteId, tenantId, vfModuleName);
+ heatStack = heat.queryStack (cloudSiteId, cloudOwner, tenantId, vfModuleName);
} catch (MsoException me) {
- String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(), "Exception - queryStack",
me);
logger.debug(error);
HeatStatus status = heatStack.getStatus();
if (status == HeatStatus.INIT || status == HeatStatus.BUILDING || status == HeatStatus.DELETING || status == HeatStatus.UPDATING) {
// fail - it's in progress - return meaningful error
- String error = "Create VF: Stack " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
+ String error = "Create VF: Stack " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
"Stack " + vfModuleName + " already exists");
logger.debug(error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName ());
+ throw new VnfAlreadyExists (vfModuleName, cloudOwner, cloudSiteId, tenantId, heatStack.getCanonicalName ());
}
if (status == HeatStatus.FAILED) {
// fail - it exists and is in a FAILED state
- String error = "Create VF: Stack " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
+ String error = "Create VF: Stack " + vfModuleName + " already exists and is in FAILED state in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
"Stack " + vfModuleName + " already exists and is " + "in FAILED state");
logger.debug(error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName ());
+ throw new VnfAlreadyExists (vfModuleName, cloudOwner, cloudSiteId, tenantId, heatStack.getCanonicalName ());
}
if (status == HeatStatus.UNKNOWN || status == HeatStatus.UPDATED) {
// fail - it exists and is in a FAILED state
String error =
"Create VF: Stack " + vfModuleName + " already exists and has status " + status.toString() + " in "
- + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
+ + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
"Stack " + vfModuleName + " already exists and is " + "in UPDATED or UNKNOWN state");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName());
+ throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId, heatStack.getCanonicalName());
}
if (status == HeatStatus.CREATED) {
// fail - it exists
if (failIfExists != null && failIfExists) {
String error =
- "Create VF: Stack " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
+ "Create VF: Stack " + vfModuleName + " already exists in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "OpenStack", "queryStack", ErrorCode.DataError.getValue(),
"Stack " + vfModuleName + " already exists");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, heatStack.getCanonicalName());
+ throw new VnfAlreadyExists(vfModuleName, cloudOwner, cloudSiteId, tenantId, heatStack.getCanonicalName());
} else {
logger.debug ("Found Existing stack, status={}", heatStack.getStatus ());
// Populate the outputs from the existing stack.
if (nestedStackId != null) {
try {
logger.debug("Querying for nestedStackId = {}", nestedStackId);
- nestedHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedStackId);
+ nestedHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
- String error = "Create VFModule: Attached heatStack ID Query " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ String error = "Create VFModule: Attached heatStack ID Query " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "queryStack", ErrorCode.BusinessProcesssError.getValue(),
"MsoException trying to query nested stack", me);
logger.debug("ERROR trying to query nested stack= {}", error);
throw new VnfException (me);
}
if (nestedHeatStack == null || nestedHeatStack.getStatus() == HeatStatus.NOTFOUND) {
- String error = "Create VFModule: Attached heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
- cloudSiteId, tenantId, error, "OpenStack", "queryStack",
+ String error = "Create VFModule: Attached heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR" ;
+ logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, error, "OpenStack", "queryStack",
ErrorCode.BusinessProcesssError.getValue(),
"Create VFModule: Attached heatStack ID " + "DOES NOT EXIST");
logger.debug(error);
if (nestedBaseStackId != null) {
try {
logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId);
- nestedBaseHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedBaseStackId);
+ nestedBaseHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedBaseStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("CreateVFModule");
- String error = "Create VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
+ String error = "Create VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
logger
- .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "QueryStack", ErrorCode.BusinessProcesssError.getValue(),
"MsoException trying to query nested base stack", me);
logger.debug("ERROR trying to query nested base stack= {}", error);
throw new VnfException (me);
}
if (nestedBaseHeatStack == null || nestedBaseHeatStack.getStatus() == HeatStatus.NOTFOUND) {
- String error = "Create VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
- cloudSiteId, tenantId, error, "OpenStack", "QueryStack",
+ String error = "Create VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR" ;
+ logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, error, "OpenStack", "QueryStack",
ErrorCode.BusinessProcesssError.getValue(),
"Create VFModule: Attached base heatStack ID DOES NOT EXIST");
logger.debug("Exception occurred", error);
boolean sendResponseToValet = false;
if (isValetEnabled) {
Holder<Map<String, Object>> valetModifiedParamsHolder = new Holder<>();
- sendResponseToValet = this.valetCreateRequest(cloudSiteId, tenantId, heatFilesObjects,
+ sendResponseToValet = this.valetCreateRequest(cloudSiteId, cloudOwner, tenantId, heatFilesObjects,
nestedTemplatesChecked, vfModuleName, backout, heatTemplate, newEnvironmentString, goldenInputs,
msoRequest, inputs, failRequestOnValetFailure, valetModifiedParamsHolder);
if (sendResponseToValet) {
logger.debug("heat is not null!!");
heatStack = heat.createStack (cloudSiteId,
+ cloudOwner,
tenantId,
vfModuleName,
template,
}
} catch (MsoException me) {
me.addContext ("CreateVFModule");
- String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
+ String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger
- .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, "OpenStack", ErrorCode.DataError.getValue(), "MsoException - createStack",
me);
logger.debug(error);
}
throw new VnfException (me);
} catch (NullPointerException npe) {
- String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
+ String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + npe;
logger
- .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, "OpenStack", ErrorCode.DataError.getValue(),
"NullPointerException - createStack", npe);
logger.debug(error);
@Override
public void deleteVfModule (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest,
Holder <Map <String, String>> outputs) throws VnfException {
- logger.debug("Deleting VF {} in ", vnfName, cloudSiteId + "/" + tenantId);
+ logger.debug("Deleting VF {} in ", vnfName, cloudOwner + "/" + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
// so we'll need to query first
Map<String, Object> stackOutputs = null;
try {
- stackOutputs = heat.queryStackForOutputs(cloudSiteId, tenantId, vnfName);
+ stackOutputs = heat.queryStackForOutputs(cloudSiteId, cloudOwner, tenantId, vnfName);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("DeleteVFModule");
- String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), "Exception - QueryStack",
me);
logger.debug(error);
logger.debug("isValetEnabled={}, failRequestsOnValetFailure={}", isValetEnabled, failRequestOnValetFailure);
boolean valetDeleteRequestSucceeded = false;
if (isValetEnabled) {
- valetDeleteRequestSucceeded = this.valetDeleteRequest(cloudSiteId, tenantId, vnfName, msoRequest, failRequestOnValetFailure);
+ valetDeleteRequestSucceeded = this.valetDeleteRequest(cloudSiteId, cloudOwner, tenantId, vnfName, msoRequest, failRequestOnValetFailure);
}
// Use the MsoHeatUtils to delete the stack. Set the polling flag to true.
// could be thrown.
long subStartTime = System.currentTimeMillis ();
try {
- heat.deleteStack (tenantId, cloudSiteId, vnfName, true);
+ heat.deleteStack (tenantId, cloudOwner, cloudSiteId, vnfName, true);
} catch (MsoException me) {
me.addContext ("DeleteVNF");
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
- String error = "Delete VF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Delete VF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "DeleteStack", ErrorCode.DataError.getValue(),
"Exception - deleteStack", me);
logger.debug(error);
@Override
public void updateVfModule (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
StringBuilder sbInit = new StringBuilder();
sbInit.append("updateVfModule: \n");
- sbInit.append("cloudSiteId=" + cloudSiteId + "\n");
+ sbInit.append("cloudOwner=" + cloudOwner + "\n");
+ sbInit.append("cloudSiteId=" + cloudSiteId + "\n");
sbInit.append("tenantId=" + tenantId + "\n");
sbInit.append("vnfType=" + vnfType + "\n");
sbInit.append("vnfVersion=" + vnfVersion + "\n");
vfModuleName = this.getVfModuleNameFromModuleStackId(vfModuleStackId);
}
- logger.debug ("Updating VFModule: " + vfModuleName + " of type " + vfModuleType + "in " + cloudSiteId + "/" + tenantId);
+ logger.debug ("Updating VFModule: " + vfModuleName + " of type " + vfModuleType + "in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
logger.debug("requestTypeString = " + requestTypeString + ", nestedVolumeStackId = " + nestedStackId + ", nestedBaseStackId = " + nestedBaseStackId);
// Will capture execution time for metrics
// Build a default rollback object (no actions performed)
VnfRollback vfRollback = new VnfRollback ();
vfRollback.setCloudSiteId (cloudSiteId);
+ vfRollback.setCloudOwner (cloudOwner);
vfRollback.setTenantId (tenantId);
vfRollback.setMsoRequest (msoRequest);
vfRollback.setRequestType(requestTypeString);
long queryStackStarttime = System.currentTimeMillis ();
logger.debug("UpdateVfModule - querying for {}", vfModuleName);
try {
- heatStack = heat.queryStack (cloudSiteId, tenantId, vfModuleName);
+ heatStack = heat.queryStack (cloudSiteId, cloudOwner, tenantId, vfModuleName);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("UpdateVFModule");
- String error = "Update VFModule: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ String error = "Update VFModule: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), "Exception - QueryStack",
me);
logger.debug(error);
//TODO - do we need to check for the other status possibilities?
if (heatStack == null || heatStack.getStatus () == HeatStatus.NOTFOUND) {
// Not Found
- String error = "Update VF: Stack " + vfModuleName + " does not exist in " + cloudSiteId + "/" + tenantId;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_NOT_EXIST.toString(), vfModuleName, cloudSiteId,
+ String error = "Update VF: Stack " + vfModuleName + " does not exist in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_NOT_EXIST.toString(), vfModuleName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), error);
- throw new VnfNotFound (cloudSiteId, tenantId, vfModuleName);
+ throw new VnfNotFound (cloudSiteId, cloudOwner, tenantId, vfModuleName);
} else {
logger.debug("Found Existing stack, status={}", heatStack.getStatus());
// Populate the outputs from the existing stack.
if (nestedStackId != null) {
try {
logger.debug("Querying for nestedStackId = {}", nestedStackId);
- nestedHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedStackId);
+ nestedHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("UpdateVFModule");
- String error = "Update VF: Attached heatStack ID Query " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Update VF: Attached heatStack ID Query " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), "Exception - " + error,
me);
logger.debug("ERROR trying to query nested stack= {}", error);
throw new VnfException (me);
}
if (nestedHeatStack == null || nestedHeatStack.getStatus() == HeatStatus.NOTFOUND) {
- String error = "Update VFModule: Attached volume heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Update VFModule: Attached volume heatStack ID DOES NOT EXIST " + nestedStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR" ;
+ logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, error, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(), error);
logger.debug(error);
throw new VnfException (error, MsoExceptionCategory.USERDATA);
long queryStackStarttime3 = System.currentTimeMillis ();
try {
logger.debug("Querying for nestedBaseStackId = {}", nestedBaseStackId);
- nestedBaseHeatStack = heat.queryStack(cloudSiteId, tenantId, nestedBaseStackId);
+ nestedBaseHeatStack = heat.queryStack(cloudSiteId, cloudOwner, tenantId, nestedBaseStackId);
} catch (MsoException me) {
// Failed to query the Stack due to an openstack exception.
// Convert to a generic VnfException
me.addContext ("UpdateVfModule");
- String error = "Update VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
+ String error = "Update VFModule: Attached baseHeatStack ID Query " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
logger
- .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudOwner, cloudSiteId,
tenantId, "OpenStack", "QueryStack", ErrorCode.DataError.getValue(),
"Exception - " + error, me);
logger.debug("ERROR trying to query nested base stack= {}", error);
throw new VnfException (me);
}
if (nestedBaseHeatStack == null || nestedBaseHeatStack.getStatus() == HeatStatus.NOTFOUND) {
- String error = "Update VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- logger.error ("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
- cloudSiteId, tenantId, error, "OpenStack",
+ String error = "Update VFModule: Attached base heatStack ID DOES NOT EXIST " + nestedBaseStackId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR" ;
+ logger.error ("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, error, "OpenStack",
"QueryStack", ErrorCode.DataError.getValue(), error);
logger.debug(error);
throw new VnfException (error, MsoExceptionCategory.USERDATA);
if (parsedVfModuleName == null || parsedVfModuleName.isEmpty()) {
parsedVfModuleName = "unknown";
}
- sendResponseToValet = this.valetUpdateRequest(cloudSiteId, tenantId, heatFilesObjects,
+ sendResponseToValet = this.valetUpdateRequest(cloudSiteId, cloudOwner, tenantId, heatFilesObjects,
nestedTemplatesChecked, parsedVfModuleName, false, heatTemplate, newEnvironmentString, (HashMap<String, Object>) goldenInputs,
msoRequest, inputs, failRequestOnValetFailure, valetModifiedParamsHolder);
if (sendResponseToValet) {
try {
heatStack = heatU.updateStack(
cloudSiteId,
+ cloudOwner,
tenantId,
vfModuleName,
template,
);
} catch (MsoException me) {
me.addContext ("UpdateVFModule");
- String error = "Update VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
+ String error = "Update VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger
- .error("{} {} {} {} {} {} {}", MessageEnum.RA_UPDATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_UPDATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, "OpenStack", ErrorCode.DataError.getValue(), "Exception - " + error, me);
if (isValetEnabled && sendResponseToValet) {
logger.debug("valet is enabled, the orchestration failed - now sending rollback to valet");
/*
* Valet Create request
*/
- private boolean valetCreateRequest(String cloudSiteId, String tenantId, Map<String, Object> heatFilesObjects, Map<String, Object> nestedTemplatesChecked,
+ private boolean valetCreateRequest(String cloudSiteId, String cloudOwner, String tenantId, Map<String, Object> heatFilesObjects, Map<String, Object> nestedTemplatesChecked,
String vfModuleName, boolean backout, HeatTemplate heatTemplate, String newEnvironmentString, Map<String, Object> goldenInputs,
MsoRequest msoRequest, Map<String, Object> inputs, boolean failRequestOnValetFailure, Holder<Map<String, Object>> valetModifiedParamsHolder) throws VnfException {
boolean valetSucceeded = false;
HeatRequest heatRequest = new HeatRequest(vfModuleName, backout, heatTemplate.getTimeoutMinutes(),
heatTemplate.getTemplateBody(), newEnvironmentString, files, goldenInputs);
GenericValetResponse<ValetCreateResponse> createReq = this.vci.callValetCreateRequest(msoRequest.getRequestId(),
- cloudSiteId, tenantId, msoRequest.getServiceInstanceId(), (String)inputs.get("vnf_id"),
+ cloudSiteId, cloudOwner, tenantId, msoRequest.getServiceInstanceId(), (String)inputs.get("vnf_id"),
(String)inputs.get("vnf_name"), (String)inputs.get("vf_module_id"), (String)inputs.get("vf_module_name"), keystoneUrl,
heatRequest);
ValetCreateResponse vcr = createReq.getReturnObject();
* Valet update request
*/
- private boolean valetUpdateRequest(String cloudSiteId, String tenantId,
+ private boolean valetUpdateRequest(String cloudSiteId, String cloudOwnerId, String tenantId,
Map<String, Object> heatFilesObjects, Map<String, Object> nestedTemplatesChecked, String vfModuleName,
boolean backout, HeatTemplate heatTemplate, String newEnvironmentString,
Map<String, Object> goldenInputs, MsoRequest msoRequest, Map<String, Object> inputs,
heatTemplate.getTemplateBody(), newEnvironmentString, files, goldenInputs);
// vnf name is not sent to MSO on update requests - so we will set it to the vf module name for now
GenericValetResponse<ValetUpdateResponse> updateReq = this.vci.callValetUpdateRequest(msoRequest.getRequestId(),
- cloudSiteId, tenantId, msoRequest.getServiceInstanceId(), (String)inputs.get("vnf_id"),
+ cloudSiteId, cloudOwnerId, tenantId, msoRequest.getServiceInstanceId(), (String)inputs.get("vnf_id"),
vfModuleName, (String)inputs.get("vf_module_id"), vfModuleName, keystoneUrl,
heatRequest);
ValetUpdateResponse vur = updateReq.getReturnObject();
/*
* Valet delete request
*/
- private boolean valetDeleteRequest(String cloudSiteId, String tenantId, String vnfName,
+ private boolean valetDeleteRequest(String cloudSiteId, String cloudOwnerId, String tenantId, String vnfName,
MsoRequest msoRequest, boolean failRequestOnValetFailure) {
boolean valetDeleteRequestSucceeded = false;
String valetErrorMessage = "more detail not available";
logger.error("An exception occurred trying to call MsoVnfAdapterImpl.valetDeleteRequest() method", e);
}
GenericValetResponse<ValetDeleteResponse> deleteReq = this.vci.callValetDeleteRequest(msoRequest.getRequestId(),
- cloudSiteId, tenantId, vfModuleId, vfModuleName);
+ cloudSiteId, cloudOwnerId, tenantId, vfModuleId, vfModuleName);
ValetDeleteResponse vdr = deleteReq.getReturnObject();
if (vdr != null && deleteReq.getStatusCode() == 200) {
ValetStatus status = vdr.getStatus();
*/
@Override
public void createVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
*/
@Override
public void updateVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
* The input "vnfName" will also be reflected back as its ID.
*
* @param cloudSiteId CLLI code of the cloud site in which to query
+ * @param cloudOwner cloud owner of the cloud site in which to query
* @param tenantId Openstack tenant identifier - ignored for Cloudify
* @param vnfName VNF Name (should match a deployment ID)
* @param msoRequest Request tracking information for logs
*/
@Override
public void queryVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest,
// Failed to query the Deployment due to a cloudify exception.
// Convert to a generic VnfException
me.addContext("QueryVNF");
- String error = "Query VNF (Cloudify): " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
+ String error = "Query VNF (Cloudify): " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger
- .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId, tenantId,
+ .error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId, tenantId,
CLOUDIFY, "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryDeployment", me);
logger.debug(error);
throw new VnfException(me);
*/
@Override
public void deleteVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest) throws VnfException {
// Get the elements of the VnfRollback object for easier access
String cloudSiteId = rollback.getCloudSiteId ();
+ String cloudOwner = rollback.getCloudOwner();
String tenantId = rollback.getTenantId ();
String vfModuleId = rollback.getVfModuleStackId ();
- logger.debug("Rolling Back VF Module {} in {}", vfModuleId, cloudSiteId + "/" + tenantId);
+ logger.debug("Rolling Back VF Module {} in {}", vfModuleId, cloudOwner + "/" + cloudSiteId + "/" + tenantId);
DeploymentInfo deployment = null;
// Failed to rollback the VNF due to a cloudify exception.
// Convert to a generic VnfException
me.addContext ("RollbackVNF");
- String error = "Rollback VF Module: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ String error = "Rollback VF Module: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
tenantId, CLOUDIFY, "DeleteDeployment", ErrorCode.DataError.getValue(),
"Exception - DeleteDeployment", me);
logger.debug(error);
* is successfully created but the orchestration fails on a subsequent step.
*
* @param cloudSiteId CLLI code of the cloud site in which to create the VNF
+ * @param cloudOwner cloud owner of the cloud site in which to create the VNF
* @param tenantId Openstack tenant identifier
* @param vfModuleType VF Module type key, should match a VNF definition in catalog DB.
* Deprecated - should use modelCustomizationUuid
*/
@Override
public void createVfModule(String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vfModuleType,
String vnfVersion,
// Build a default rollback object (no actions performed)
VnfRollback vfRollback = new VnfRollback();
vfRollback.setCloudSiteId(cloudSiteId);
+ vfRollback.setCloudOwner(cloudOwner);
vfRollback.setTenantId(tenantId);
vfRollback.setMsoRequest(msoRequest);
vfRollback.setRequestType(requestType);
}
catch (MsoException me) {
// Failed to query the Deployment due to a cloudify exception.
- String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
+ String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName, cloudSiteId,
tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
"Exception - queryDeployment", me);
if (status == DeploymentStatus.INSTALLED) {
// fail - it exists
if (failIfExists != null && failIfExists) {
- String error = "Create VF: Deployment " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
+ String error = "Create VF: Deployment " + vfModuleName + " already exists in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
"Deployment " + vfModuleName + " already exists");
logger.debug(error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ throw new VnfAlreadyExists (vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId());
} else {
// Found existing deployment and client has not requested "failIfExists".
// Populate the outputs from the existing deployment.
// Check through various detailed error cases
if (status == DeploymentStatus.INSTALLING || status == DeploymentStatus.UNINSTALLING) {
// fail - it's in progress - return meaningful error
- String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
+ String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
"Deployment " + vfModuleName + " already exists");
logger.debug(error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ throw new VnfAlreadyExists (vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId());
}
else if (status == DeploymentStatus.FAILED) {
// fail - it exists and is in a FAILED state
- String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
+ String error = "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
"Deployment " + vfModuleName + " already " + "exists and is in FAILED state");
logger.debug(error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ throw new VnfAlreadyExists (vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId());
}
else if (status == DeploymentStatus.UNKNOWN || status == DeploymentStatus.CREATED) {
// fail - it exists and is in a UNKNOWN state
- String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
+ String error = "Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
"Deployment " + vfModuleName + " already " + "exists and is in " + status.toString() + " state");
logger.debug(error);
- throw new VnfAlreadyExists (vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ throw new VnfAlreadyExists (vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId());
}
else {
// Unexpected, since all known status values have been tested for
String error =
"Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status
- .toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
+ .toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment", ErrorCode.DataError.getValue(),
"Deployment " + vfModuleName + " already " + "exists and is in an unknown state");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, cloudifyDeployment.getId());
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, cloudifyDeployment.getId());
}
}
}
catch (MsoException me) {
// Failed to query the Volume GroupDeployment due to a cloudify exception.
- String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(volume)",
+ String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(volume)",
ErrorCode.DataError.getValue(), "Exception - queryDeployment(volume)", me);
logger.debug(error);
// Convert to a generic VnfException
catch (MsoException me) {
// Failed to query the Volume GroupDeployment due to a cloudify exception.
String error =
- "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + ": "
+ "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": "
+ me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
- cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(Base)",
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudOwner, cloudSiteId, tenantId, CLOUDIFY, "queryDeployment(Base)",
ErrorCode.DataError.getValue(), "Exception - queryDeployment(Base)", me);
logger.debug(error);
// Convert to a generic VnfException
} catch (MsoException me) {
me.addContext ("CreateVFModule");
- String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
+ String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
logger
- .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, CLOUDIFY, ErrorCode.DataError.getValue(), "MsoException - createDeployment",
me);
logger.debug(error);
throw new VnfException (me);
} catch (NullPointerException npe) {
- String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
+ String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + npe;
logger
- .error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ .error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, CLOUDIFY, ErrorCode.DataError.getValue(),
"NullPointerException - createDeployment", npe);
logger.debug(error);
}
public void deleteVfModule (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest,
Holder <Map <String, String>> outputs) throws VnfException {
-
- logger.debug ("Deleting VF " + vnfName + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug ("Deleting VF " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
} catch (MsoException me) {
// Failed to query the deployment. Convert to a generic VnfException
me.addContext ("DeleteVFModule");
- String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Delete VFModule: Query to get outputs: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, CLOUDIFY, "QueryDeployment", ErrorCode.DataError.getValue(),
"Exception - QueryDeployment", me);
logger.debug(error);
} catch (MsoException me) {
me.addContext("DeleteVfModule");
// Convert to a generic VnfException
- String error = "Delete VF: " + vnfName + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudSiteId,
+ String error = "Delete VF: " + vnfName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vnfName, cloudOwner, cloudSiteId,
tenantId, "DeleteDeployment", "DeleteDeployment", ErrorCode.DataError.getValue(),
"Exception - DeleteDeployment: " + me.getMessage());
logger.debug(error);
// TODO: Should Update be supported for Cloudify? What would this look like?
@Override
public void updateVfModule (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
*/
@Override
public void createVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
*/
@Override
public void updateVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
*/
@Override
public void queryVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfNameOrId,
MsoRequest msoRequest,
Holder <Map <String, String>> outputs)
throws VnfException
{
- logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Querying VNF " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
long subStartTime = System.currentTimeMillis ();
VduInstance vduInstance = null;
- CloudInfo cloudInfo = new CloudInfo(cloudSiteId, tenantId, null);
+ CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null);
- VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+ VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
try {
vduInstance = vduPlugin.queryVdu (cloudInfo, vnfNameOrId);
// Failed to query the VDU due to a plugin exception.
// Convert to a generic VnfException
e.addContext("QueryVNF");
- String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfNameOrId, cloudSiteId,
+ String error = "Query VNF (VDU): " + vnfNameOrId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + e;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vnfNameOrId, cloudOwner, cloudSiteId,
tenantId, "VDU", "QueryVNF", ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
logger.debug(error);
throw new VnfException(e);
*/
@Override
public void deleteVnf (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfName,
MsoRequest msoRequest) throws VnfException {
// Get the elements of the VnfRollback object for easier access
String cloudSiteId = rollback.getCloudSiteId ();
+ String cloudOwner = rollback.getCloudOwner();
String tenantId = rollback.getTenantId ();
- CloudInfo cloudInfo = new CloudInfo (cloudSiteId, tenantId, null);
+ CloudInfo cloudInfo = new CloudInfo (cloudSiteId, cloudOwner, tenantId, null);
String vfModuleId = rollback.getVfModuleStackId ();
- logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Rolling Back VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
VduInstance vduInstance = null;
// Use the VduPlugin to delete the VF Module.
- VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+ VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
long subStartTime = System.currentTimeMillis ();
try {
// Failed to rollback the VF Module due to a plugin exception.
// Convert to a generic VnfException
ve.addContext ("RollbackVFModule");
- String error = "Rollback VF Module: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + ve;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ String error = "Rollback VF Module: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + ve;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
tenantId, "VDU", "DeleteVdu", ErrorCode.DataError.getValue(), "Exception - DeleteVdu", ve);
logger.debug(error);
throw new VnfException (ve);
* is successfully created but the orchestration fails on a subsequent step.
*
* @param cloudSiteId CLLI code of the cloud site in which to create the VNF
+ * @param cloudOwner cloud owner of the cloud site in which to create the VNF
* @param tenantId Openstack tenant identifier
* @param vfModuleType VF Module type key, should match a VNF definition in catalog DB.
* Deprecated - should use modelCustomizationUuid
*/
@Override
public void createVfModule(String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vfModuleType,
String vnfVersion,
// Build a default rollback object (no actions performed)
VnfRollback vfRollback = new VnfRollback();
vfRollback.setCloudSiteId(cloudSiteId);
+ vfRollback.setCloudOwner(cloudOwner);
vfRollback.setTenantId(tenantId);
vfRollback.setMsoRequest(msoRequest);
vfRollback.setRequestType(requestType);
VduInstance vduInstance = null;
- CloudInfo cloudInfo = new CloudInfo (cloudSiteId, tenantId, null);
+ CloudInfo cloudInfo = new CloudInfo (cloudSiteId, cloudOwner, tenantId, null);
// Use the VduPlugin.
- VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+ VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
// First, look up to see if the VF already exists, unless using multicloud adapter
}
catch (VduException me) {
// Failed to query the VDU due to a plugin exception.
- String error = "Create VF Module: Query " + vfModuleName + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
- cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
+ String error = "Create VF Module: Query " + vfModuleName + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
"Exception - queryVdu", me);
logger.debug(error);
// Convert to a generic VnfException
if (failIfExists != null && failIfExists) {
// fail - it exists
String error =
- "Create VF: Deployment " + vfModuleName + " already exists in " + cloudSiteId + "/" + tenantId;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
+ "Create VF: Deployment " + vfModuleName + " already exists in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
"VF Module " + vfModuleName + " already exists");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
} else {
// Found existing deployment and client has not requested "failIfExists".
// Populate the outputs from the existing deployment.
// fail - it's in progress - return meaningful error
String error =
"Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString()
- + " in " + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
+ + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; please wait for it to complete, or fix manually.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
"VF Module " + vfModuleName + " already exists");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
} else if (status == VduStateType.FAILED) {
// fail - it exists and is in a FAILED state
String error =
- "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudSiteId
+ "Create VF: Deployment " + vfModuleName + " already exists and is in FAILED state in " + cloudOwner + "/" + cloudSiteId
+ "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
"VF Module " + vfModuleName + " already exists and is in FAILED state");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
} else if (status == VduStateType.UNKNOWN) {
// fail - it exists and is in a UNKNOWN state
String error =
"Create VF: Deployment " + vfModuleName + " already exists and has status " + status.toString()
- + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
+ + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
"VF Module " + vfModuleName + " already exists and is in " + status.toString() + " state");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
} else {
// Unexpected, since all known status values have been tested for
String error =
"Create VF: Deployment " + vfModuleName + " already exists with unexpected status " + status
- .toString() + " in " + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
- cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
+ .toString() + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + "; requires manual intervention.";
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_VNF_ALREADY_EXIST.toString(), vfModuleName,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu", ErrorCode.DataError.getValue(),
"VF Module " + vfModuleName + " already exists and is in an unknown state");
logger.debug(error);
- throw new VnfAlreadyExists(vfModuleName, cloudSiteId, tenantId, vduInstance.getVduInstanceId());
+ throw new VnfAlreadyExists(vfModuleName, cloudSiteId, cloudOwner, tenantId, vduInstance.getVduInstanceId());
}
}
}
catch (VduException me) {
// Failed to query the Volume Group VDU due to a plugin exception.
- String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
- cloudSiteId, tenantId, "VDU", "queryVdu(volume)", ErrorCode.DataError.getValue(),
+ String error = "Create VF Module: Query Volume Group " + volumeGroupId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu(volume)", ErrorCode.DataError.getValue(),
"Exception - queryVdu(volume)", me);
logger.debug(error);
// Convert to a generic VnfException
}
if (volumeVdu == null || volumeVdu.getStatus().getState() == VduStateType.NOTFOUND) {
- String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudSiteId + "/" + tenantId + " USER ERROR" ;
- logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
- cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)",
+ String error = "Create VFModule: Attached Volume Group DOES NOT EXIST " + volumeGroupId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + " USER ERROR" ;
+ logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), volumeGroupId,
+ cloudOwner, cloudSiteId, tenantId, error, "VDU", "queryVdu(volume)",
ErrorCode.BusinessProcesssError.getValue(),
"Create VFModule: Attached Volume Group " + "DOES NOT EXIST");
logger.debug(error);
}
catch (MsoException me) {
// Failed to query the Base VF Module due to a Vdu Plugin exception.
- String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me ;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
- cloudSiteId, tenantId, "VDU", "queryVdu(Base)", ErrorCode.DataError.getValue(),
+ String error = "Create VF Module: Query Base " + baseVfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me ;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudOwner, cloudSiteId, tenantId, "VDU", "queryVdu(Base)", ErrorCode.DataError.getValue(),
"Exception - queryVdu(Base)", me);
logger.debug(error);
// Convert to a generic VnfException
if (baseVdu == null || baseVdu.getStatus().getState() == VduStateType.NOTFOUND) {
String error =
- "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudSiteId + "/"
+ "Create VFModule: Base Module DOES NOT EXIST " + baseVfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/"
+ tenantId + " USER ERROR";
- logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
- cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)",
+ logger.error("{} {} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), baseVfModuleId,
+ cloudOwner, cloudSiteId, tenantId, error, "VDU", "queryVdu(Base)",
ErrorCode.BusinessProcesssError.getValue(),
"Create VFModule: Base Module DOES NOT EXIST");
logger.debug(error);
} catch (VduException me) {
// Failed to instantiate the VDU.
me.addContext("CreateVFModule");
- String error = "Create VF Module " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ String error = "Create VF Module " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, "VDU", ErrorCode.DataError.getValue(), "MsoException - instantiateVdu", me);
logger.debug(error);
// Convert to a generic VnfException
throw new VnfException(me);
} catch (NullPointerException npe) {
- String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + npe;
- logger.error("{} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudSiteId,
+ String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + npe;
+ logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_CREATE_VNF_ERR.toString(), vfModuleType, cloudOwner, cloudSiteId,
tenantId, "VDU", ErrorCode.DataError.getValue(), "NullPointerException - instantiateVdu",
npe);
logger.debug(error);
logger.debug("NULL POINTER EXCEPTION at vduPlugin.instantiateVdu", npe);
throw new VnfException("NullPointerException during instantiateVdu");
} catch (Exception e) {
- String error = "Create VFModule " + vfModuleType + " in " + cloudSiteId + "/" + tenantId + ": " + e;
+ String error = "Create VFModule " + vfModuleType + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + e;
logger.debug("Unhandled exception at vduPlugin.instantiateVdu", e);
logger.debug(error);
throw new VnfException("Exception during instantiateVdu: " + e.getMessage());
public void deleteVfModule (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vfModuleId,
MsoRequest msoRequest,
Holder <Map <String, String>> outputs) throws VnfException
{
- logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudSiteId + "/" + tenantId);
+ logger.debug("Deleting VF Module " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId);
// Will capture execution time for metrics
long startTime = System.currentTimeMillis ();
// Capture the output parameters on a delete, so need to query first
VduInstance vduInstance = null;
- CloudInfo cloudInfo = new CloudInfo(cloudSiteId, tenantId, null);
+ CloudInfo cloudInfo = new CloudInfo(cloudSiteId, cloudOwner, tenantId, null);
// Use the VduPlugin.
- VduPlugin vduPlugin = getVduPlugin(cloudSiteId);
+ VduPlugin vduPlugin = getVduPlugin(cloudSiteId, cloudOwner);
try {
vduInstance = vduPlugin.queryVdu (cloudInfo, vfModuleId);
// Failed to query the VDU due to a plugin exception.
// Convert to a generic VnfException
e.addContext("QueryVFModule");
- String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + e;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ String error = "Query VfModule (VDU): " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + e;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_QUERY_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
tenantId, "VDU", "QueryVFModule", ErrorCode.DataError.getValue(), "Exception - queryVDU", e);
logger.debug(error);
throw new VnfException(e);
} catch (VduException me) {
me.addContext ("DeleteVfModule");
// Convert to a generic VnfException
- String error = "Delete VF: " + vfModuleId + " in " + cloudSiteId + "/" + tenantId + ": " + me;
- logger.error("{} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudSiteId,
+ String error = "Delete VF: " + vfModuleId + " in " + cloudOwner + "/" + cloudSiteId + "/" + tenantId + ": " + me;
+ logger.error("{} {} {} {} {} {} {} {} {}", MessageEnum.RA_DELETE_VNF_ERR.toString(), vfModuleId, cloudOwner, cloudSiteId,
tenantId, "VDU", "DeleteVdu", ErrorCode.DataError.getValue(),
"Exception - DeleteVdu: " + me.getMessage());
logger.debug(error);
// Update VF Module not yet implemented for generic VDU plug-in model.
@Override
public void updateVfModule (String cloudSiteId,
+ String cloudOwner,
String tenantId,
String vnfType,
String vnfVersion,
* defined for the target cloud. Should really be looking at the VNF Model (ochestration_mode)
* but we don't currently have access to that in Query and Delete cases.
*/
- private VduPlugin getVduPlugin (String cloudSiteId) {
+ private VduPlugin getVduPlugin (String cloudSiteId, String cloudOwner) {
Optional<CloudSite> cloudSiteOp = cloudConfig.getCloudSite(cloudSiteId);
if (cloudSiteOp.isPresent()) {
CloudSite cloudSite = cloudSiteOp.get();
Holder<Map<String, String>> outputs = new Holder <> ();
if (cloudsite != null && !cloudsite.equals(TESTING_KEYWORD)) {
//vnfAdapter.deleteVnf (req.getCloudSiteId(), req.getTenantId(), req.getVfModuleStackId(), req.getMsoRequest());
- vnfAdapter.deleteVfModule (req.getCloudSiteId(), req.getTenantId(), req.getVfModuleStackId(), req.getMsoRequest(), outputs);
+ vnfAdapter.deleteVfModule (req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), req.getVfModuleStackId(), req.getMsoRequest(), outputs);
}
response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, req.getMessageId(), outputs.value);
} catch (VnfException e) {
@PathParam("aaiVfModuleId") String aaiVfModuleId,
@ApiParam(value = "cloudSiteId", required = true)
@QueryParam("cloudSiteId") String cloudSiteId,
- @ApiParam(value = "tenantId", required = true)
+ @ApiParam(value = "cloudOwner", required = true)
+ @QueryParam("cloudOwner") String cloudOwner,
+ @ApiParam(value = "tenantId", required = true)
@QueryParam("tenantId") String tenantId,
@ApiParam(value = "vfModuleName", required = true)
@QueryParam("vfModuleName") String vfModuleName, //RAA? Id in doc
Holder<String> vfModuleId = new Holder<>();
Holder<VnfStatus> status = new Holder<>();
Holder<Map<String, String>> outputs = new Holder <> ();
- vnfAdapter.queryVnf (cloudSiteId, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, outputs);
+ vnfAdapter.queryVnf (cloudSiteId, cloudOwner, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, outputs);
if (!vnfExists.value) {
logger.debug("vfModule not found");
respStatus = HttpStatus.SC_NOT_FOUND;
String completeVnfVfModuleType = req.getVnfType() + "::" + req.getVfModuleType();
logger.debug("completeVnfVfModuleType=" + completeVnfVfModuleType);
String cloudsite = req.getCloudSiteId();
+ String cloudOwner = req.getCloudOwner();
if (cloudsite != null && cloudsite.equals(TESTING_KEYWORD)) {
String tenant = req.getTenantId();
if (tenant != null && tenant.equals(TESTING_KEYWORD)) {
throw new VnfException("testing.");
}
- vnfRollback.value = new VnfRollback(req.getVnfId(), tenant, cloudsite,
+ vnfRollback.value = new VnfRollback(req.getVnfId(), tenant, cloudOwner, cloudsite,
true, false, new MsoRequest("reqid", "svcid"),
req.getVolumeGroupId(), req.getVolumeGroupId(), req.getRequestType(), req.getModelCustomizationUuid());
vfModuleStackId.value = "479D3D8B-6360-47BC-AB75-21CC91981484";
// outputs,
// vnfRollback);
vnfAdapter.createVfModule(req.getCloudSiteId(),
+ req.getCloudOwner(),
req.getTenantId(),
//req.getVnfType(),
completeVnfVfModuleType,
logger.debug("in updateVf - completeVnfVfModuleType=" + completeVnfVfModuleType);
vnfAdapter.updateVfModule (req.getCloudSiteId(),
+ req.getCloudOwner(),
req.getTenantId(),
//req.getVnfType(),
completeVnfVfModuleType,
try {
VfModuleRollback vmr = req.getVfModuleRollback();
VnfRollback vrb = new VnfRollback(
- vmr.getVfModuleStackId(), vmr.getTenantId(), vmr.getCloudSiteId(), true, true,
+ vmr.getVfModuleStackId(), vmr.getTenantId(), vmr.getCloudOwner(), vmr.getCloudSiteId(), true, true,
vmr.getMsoRequest(), null, null, null, null);
vnfAdapter.rollbackVnf (vrb);
response = new RollbackVfModuleResponse(Boolean.TRUE, req.getMessageId());
//vnfAdapter.deleteVnf (req.getCloudSiteId(), req.getTenantId(), req.getVfModuleStackId(), req.getMsoRequest());
// Support different Adapter Implementations
MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsite);
- adapter.deleteVfModule (req.getCloudSiteId(), req.getTenantId(), req.getVfModuleStackId(), req.getMsoRequest(), outputs);
+ adapter.deleteVfModule (req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), req.getVfModuleStackId(), req.getMsoRequest(), outputs);
}
response = new DeleteVfModuleResponse(req.getVnfId(), req.getVfModuleId(), Boolean.TRUE, req.getMessageId(), outputs.value);
} catch (VnfException e) {
@PathParam("aaiVfModuleId") String aaiVfModuleId,
@ApiParam(value = "cloudSiteId", required = true)
@QueryParam("cloudSiteId") String cloudSiteId,
+ @ApiParam(value = "cloudOwner", required = true)
+ @QueryParam("cloudOwner") String cloudOwner,
@ApiParam(value = "tenantId", required = true)
@QueryParam("tenantId") String tenantId,
@ApiParam(value = "vfModuleName", required = true)
// Support different Adapter Implementations
MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudSiteId);
- adapter.queryVnf (cloudSiteId, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, outputs);
+ adapter.queryVnf (cloudSiteId, cloudOwner, tenantId, vfModuleName, msoRequest, vnfExists, vfModuleId, status, outputs);
if (!vnfExists.value) {
logger.debug("vfModule not found");
logger.debug("completeVnfVfModuleType=" + completeVnfVfModuleType);
String cloudsiteId = req.getCloudSiteId();
+ String cloudOwner = req.getCloudOwner();
if (cloudsiteId != null && cloudsiteId.equals(TESTING_KEYWORD)) {
String tenant = req.getTenantId();
if (tenant != null && tenant.equals(TESTING_KEYWORD)) {
throw new VnfException("testing.");
}
- vnfRollback.value = new VnfRollback(req.getVnfId(), tenant, cloudsiteId,
+ vnfRollback.value = new VnfRollback(req.getVnfId(), tenant, cloudOwner, cloudsiteId,
true, false, new MsoRequest("reqid", "svcid"),
req.getVolumeGroupId(), req.getVolumeGroupId(), req.getRequestType(), req.getModelCustomizationUuid());
vfModuleStackId.value = "479D3D8B-6360-47BC-AB75-21CC91981484";
// Support different Adapter Implementations
MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsiteId);
adapter.createVfModule(req.getCloudSiteId(),
+ req.getCloudOwner(),
req.getTenantId(),
completeVnfVfModuleType,
req.getVnfVersion(),
// Support different Adapter Implementations
MsoVnfAdapter adapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsiteId);
adapter.updateVfModule (req.getCloudSiteId(),
+ req.getCloudOwner(),
req.getTenantId(),
completeVnfVfModuleType,
req.getVnfVersion(),
try {
VfModuleRollback vmr = req.getVfModuleRollback();
VnfRollback vrb = new VnfRollback(
- vmr.getVfModuleStackId(), vmr.getTenantId(), vmr.getCloudSiteId(), true, vmr.isVfModuleCreated(),
+ vmr.getVfModuleStackId(), vmr.getTenantId(), vmr.getCloudOwner(), vmr.getCloudSiteId(), true, vmr.isVfModuleCreated(),
vmr.getMsoRequest(), null, null, null, null);
// Support multiple adapter implementations
// vnfRollback);
vnfAdapter.createVfModule(
req.getCloudSiteId(), //cloudSiteId,
+ req.getCloudOwner(), //cloudOwner,
req.getTenantId(), //tenantId,
//req.getVnfType(), //vnfType,
completeVnfVfModuleType,
stackId.value,
true, // TODO boolean volumeGroupCreated, when would it be false?
req.getTenantId(),
+ req.getCloudOwner(),
req.getCloudSiteId(),
req.getMsoRequest(),
req.getMessageId());
logger.debug("DeleteVNFVolumesTask start");
try {
if (!req.getCloudSiteId().equals(TESTING_KEYWORD)) {
- vnfAdapter.deleteVnf(req.getCloudSiteId(), req.getTenantId(), req.getVolumeGroupStackId(), req.getMsoRequest());
+ vnfAdapter.deleteVnf(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), req.getVolumeGroupStackId(), req.getMsoRequest());
}
response = new DeleteVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
try {
VolumeGroupRollback vgr = req.getVolumeGroupRollback();
VnfRollback vrb = new VnfRollback(
- vgr.getVolumeGroupStackId(), vgr.getTenantId(), vgr.getCloudSiteId(), true, true,
+ vgr.getVolumeGroupStackId(), vgr.getTenantId(), vgr.getCloudOwnerId(), vgr.getCloudSiteId(), true, true,
vgr.getMsoRequest(), null, null, null, null);
vnfAdapter.rollbackVnf(vrb);
response = new RollbackVolumeGroupResponse(true, req.getMessageId());
// outputs,
// vnfRollback);
vnfAdapter.updateVfModule (req.getCloudSiteId(),
+ req.getCloudOwner(),
req.getTenantId(),
//req.getVnfType(),
completeVnfVfModuleType,
@PathParam("aaiVolumeGroupId") String aaiVolumeGroupId,
@ApiParam(value = "cloudSiteId", required = true)
@QueryParam("cloudSiteId") String cloudSiteId,
+ @ApiParam(value = "cloudOwner", required = true)
+ @QueryParam("cloudOwner") String cloudOwner,
@ApiParam(value = "tenantId", required = true)
@QueryParam("tenantId") String tenantId,
@ApiParam(value = "volumeGroupStackId", required = true)
status.value = VnfStatus.ACTIVE;
outputs.value = testMap();
} else {
- vnfAdapter.queryVnf(cloudSiteId, tenantId, volumeGroupStackId, msoRequest, vnfExists, vfModuleId, status, outputs);
+ vnfAdapter.queryVnf(cloudSiteId, cloudOwner, tenantId, volumeGroupStackId, msoRequest, vnfExists, vfModuleId, status, outputs);
}
if (!vnfExists.value) {
logger.debug("VNFVolumes not found");
MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudsiteId);
vnfAdapter.createVfModule(
req.getCloudSiteId(), //cloudSiteId,
+ req.getCloudOwner(), //cloudOwner,
req.getTenantId(), //tenantId,
completeVnfVfModuleType, //vnfType,
req.getVnfVersion(), //vnfVersion,
stackId.value,
vnfRollback.value.getVnfCreated(),
req.getTenantId(),
+ req.getCloudOwner(),
req.getCloudSiteId(),
req.getMsoRequest(),
req.getMessageId());
if (! cloudSiteId.equals(TESTING_KEYWORD)) {
// Support different Adapter Implementations
MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudSiteId);
- vnfAdapter.deleteVnf(req.getCloudSiteId(), req.getTenantId(), req.getVolumeGroupStackId(), req.getMsoRequest());
+ vnfAdapter.deleteVnf(req.getCloudSiteId(), req.getCloudOwner(), req.getTenantId(), req.getVolumeGroupStackId(), req.getMsoRequest());
}
response = new DeleteVolumeGroupResponse(true, req.getMessageId());
} catch (VnfException e) {
try {
VolumeGroupRollback vgr = req.getVolumeGroupRollback();
VnfRollback vrb = new VnfRollback(
- vgr.getVolumeGroupStackId(), vgr.getTenantId(), vgr.getCloudSiteId(), true, true,
+ vgr.getVolumeGroupStackId(), vgr.getTenantId(), vgr.getCloudOwnerId(), vgr.getCloudSiteId(), true, true,
vgr.getMsoRequest(), null, null, null, null);
// Support different Adapter Implementations
// Support different Adapter Implementations
MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, req.getCloudSiteId());
vnfAdapter.updateVfModule (req.getCloudSiteId(),
+ req.getCloudOwner(),
req.getTenantId(),
//req.getVnfType(),
completeVnfVfModuleType,
@PathParam("aaiVolumeGroupId") String aaiVolumeGroupId,
@ApiParam(value = "cloudSiteId", required = true)
@QueryParam("cloudSiteId") String cloudSiteId,
+ @ApiParam(value = "cloudOwner", required = true)
+ @QueryParam("cloudOwner") String cloudOwner,
@ApiParam(value = "tenantId", required = true)
@QueryParam("tenantId") String tenantId,
@ApiParam(value = "volumeGroupStackId", required = true)
} else {
// Support different Adapter Implementations
MsoVnfAdapter vnfAdapter = vnfAdapterRestUtils.getVnfAdapterImpl(mode, cloudSiteId);
- vnfAdapter.queryVnf(cloudSiteId, tenantId, volumeGroupStackId, msoRequest, vnfExists, vfModuleId, status, outputs);
+ vnfAdapter.queryVnf(cloudSiteId, cloudOwner, tenantId, volumeGroupStackId, msoRequest, vnfExists, vfModuleId, status, outputs);
}
if (!vnfExists.value) {
logger.debug("VNFVolumes not found");
private static final long serialVersionUID = 1L;
- public VnfAlreadyExists (String name, String cloudId, String tenantId, String vnfId) {
- super("Resource " + name + " already exists in cloud/tenant " + cloudId + "/" + tenantId + " with ID " + vnfId);
+ public VnfAlreadyExists (String name, String cloudId, String cloudOwner, String tenantId, String vnfId) {
+ super("Resource " + name + " already exists in owner/cloud/tenant " + cloudOwner + "/" + cloudId + "/" + tenantId + " with ID " + vnfId);
}
}
private static final long serialVersionUID = 1L;
- public VnfNotFound (String cloudId, String tenantId, String vnfName) {
- super("Resource " + vnfName + " not found in cloud/tenant " + cloudId + "/" + tenantId);
+ public VnfNotFound (String cloudId, String cloudOwner, String tenantId, String vnfName) {
+ super("Resource " + vnfName + " not found in owner/cloud/tenant " + cloudOwner + "/" + cloudId + "/" + tenantId);
}
}
mockValetCreatePostResponse_200("requestId", mapper.writeValueAsString(vcr));
- GenericValetResponse<ValetCreateResponse> actual = client.callValetCreateRequest("requestId", "regionId", "tenantId", "serviceInstanceId", "vnfId", "vnfName", "vfModuleId", "vfModuleName", "keystoneUrl", null);
+ GenericValetResponse<ValetCreateResponse> actual = client.callValetCreateRequest("requestId", "regionId", "ownerId", "tenantId", "serviceInstanceId", "vnfId", "vnfName", "vfModuleId", "vfModuleName", "keystoneUrl", null);
assertThat(actual, sameBeanAs(expected));
}
mockValetCreatePutResponse_200("requestId", mapper.writeValueAsString(vur));
- GenericValetResponse<ValetUpdateResponse> actual = client.callValetUpdateRequest("requestId", "regionId", "tenantId", "serviceInstanceId", "vnfId", "vnfName", "vfModuleId", "vfModuleName", "keystoneUrl", null);
+ GenericValetResponse<ValetUpdateResponse> actual = client.callValetUpdateRequest("requestId", "regionId", "ownerId", "tenantId", "serviceInstanceId", "vnfId", "vnfName", "vfModuleId", "vfModuleName", "keystoneUrl", null);
assertThat(actual, sameBeanAs(expected));
}
mockValetDeleteDeleteResponse_200("requestId", mapper.writeValueAsString(vdr));
- GenericValetResponse<ValetDeleteResponse> actual = client.callValetDeleteRequest("requestId", "regionId", "tenantId", "vfModuleId", "vfModuleName");
+ GenericValetResponse<ValetDeleteResponse> actual = client.callValetDeleteRequest("requestId", "regionId", "ownerId", "tenantId", "vfModuleId", "vfModuleName");
assertThat(actual, sameBeanAs(expected));
}
String vnfName = "DEV-VF-1802-it3-pwt3-v6-vSAMP10a-addon2-Replace-1001/stackId";
String notificationUrl = "http://localhost:"+wireMockPort+"/notify/adapterNotify/updateVnfNotificationRequest";
- instance.createVnfA("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.createVnfA("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId|1", new HashMap<String, Object>(), Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, "messageId",
msoRequest, notificationUrl);
@Test
public void createVNFTest_Exception() throws Exception {
String notificationUrl = "http://localhost:"+wireMockPort+"/notify/adapterNotify/updateVnfNotificationRequest";
- instance.createVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ instance.createVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
"volumeGroupHeatStackId|1", new HashMap<String, Object>(), Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, "messageId",
null, notificationUrl);
(containing("messageId"))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
String notificationUrl = "http://localhost:"+wireMockPort+"/notify/adapterNotify/updateVnfNotificationRequest";
- instance.updateVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ instance.updateVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
"volumeGroupHeatStackId|1", map, "messageId", msoRequest,
notificationUrl);
}
(containing("messageId"))
.willReturn(aResponse().withStatus(HttpStatus.SC_OK)));
String notificationUrl = "http://localhost:"+wireMockPort+"/notify/adapterNotify/updateVnfNotificationRequest";
- instance.updateVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ instance.updateVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
"volumeGroupHeatStackId|1", map, "messageId", msoRequest,
notificationUrl);
verify(1,postRequestedFor(urlEqualTo("/notify/adapterNotify/updateVnfNotificationRequest")));
MsoRequest msoRequest = new MsoRequest();
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.queryVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest,
+ instance.queryVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest,
"http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest");
}
MsoRequest msoRequest = new MsoRequest();
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.deleteVnfA("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest,
+ instance.deleteVnfA("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", "messageId", msoRequest,
"http://org.onap.so/notify/adapterNotify/updateVnfNotificationRequest");
}
public void rollbackVnfTest() {
VnfRollback vnfRollBack = new VnfRollback();
vnfRollBack.setCloudSiteId("mdt1");
+ vnfRollBack.setCloudOwner("CloudOwner");
vnfRollBack.setTenantId("88a6ca3ee0394ade9403f075db23167e");
vnfRollBack.setVnfId("ff5256d1-5a33-55df-13ab-12abad84e7ff");
instance.rollbackVnfA(vnfRollBack, "messageId",
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("MTN13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("MTN13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.TRUE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "XVFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "XVFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", null, map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ instance.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ instance.updateVfModule("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
mockOpenStackResponseAccess(wireMockPort);
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
.withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR)));
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
.withStatus(HttpStatus.SC_NOT_FOUND)));
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
mockOpenstackGetWithResponse("/mockPublicUrl/stacks/baseVfHeatStackId",HttpStatus.SC_INTERNAL_SERVER_ERROR,"OpenstackResponse_Stack_Created_VfModule.json");
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
mockOpenstackGetWithResponse("/mockPublicUrl/stacks/baseVfHeatStackId",HttpStatus.SC_NOT_FOUND,"OpenstackResponse_Stack_Created_VfModule.json");
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
mockOpenstackGetWithResponse("/mockPublicUrl/stacks/baseVfHeatStackId",HttpStatus.SC_OK,"OpenstackResponse_Stack_Created_VfModule.json");
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
vfModuleCustomization.getVfModule().getModuleHeatTemplate().setParameters(new HashSet<>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"88a6ca3ee0394ade9403f075db23167e", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
vfModuleCustomization.getVfModule().getModuleHeatTemplate().setParameters(new HashSet<>());
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- instance.updateVfModule("MTN13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
+ instance.updateVfModule("MTN13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", vnfName, "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "vfModuleStackId",
"b4ea86b4-253f-11e7-93ae-92361f002671", map, msoRequest, new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
Map<String, Object> outputs = new HashMap<>();
outputs.put("Key1", "value1");
- when(heatUtils.queryStackForOutputs("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12")).thenReturn(outputs);
+ when(heatUtils.queryStackForOutputs("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12")).thenReturn(outputs);
MsoVnfAdapterImpl instance = new MsoVnfAdapterImpl();
MsoRequest msoRequest = getMsoRequest();
try {
- instance.deleteVfModule("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
+ instance.deleteVfModule("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
new Holder<Map<String, String>>());
} catch (Exception e) {
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.queryVnf("siteid", "1234", "vfname",
+ instance.queryVnf("siteid", "CloudOwner", "1234", "vfname",
msoRequest, new Holder<>(), new Holder<>(), new Holder<>(),
new Holder<>());
}
.withBodyFile("OpenstackResponse_Access.json")
.withStatus(HttpStatus.SC_OK)));
- instance.queryVnf("mtn13", "1234", "vfname",
+ instance.queryVnf("mtn13", "CloudOwner", "1234", "vfname",
msoRequest, new Holder<>(), new Holder<>(), new Holder<>(),
new Holder<>());
}
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.deleteVfModule("mtn13", "1234", "vfname", msoRequest, new Holder<>());
+ instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>());
}
@Test
.withBodyFile("OpenstackResponse_Access.json")
.withStatus(HttpStatus.SC_OK)));
- instance.deleteVfModule("mtn13", "1234", "vfname", msoRequest, new Holder<>());
+ instance.deleteVfModule("mtn13", "CloudOwner", "1234", "vfname", msoRequest, new Holder<>());
}
@Test
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.deleteVnf("12344", "234", "vnfname", msoRequest);
+ instance.deleteVnf("12344", "CloudOwner", "234", "vnfname", msoRequest);
}
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.createVfModule("123", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", "123", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
+ instance.createVfModule("123", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", "123", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
}
@Test
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.createVfModule("123", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", null, new
+ instance.createVfModule("123", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", null, new
HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
}
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.createVfModule("123", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
+ instance.createVfModule("123", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
}
@Test
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.createVfModule("mtn13", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
+ instance.createVfModule("mtn13", "CloudOwner", "123", "vf", "v1", "", "module-005", "", "create", "3245", "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
}
@Test
.withBodyFile("OpenstackResponse_Access.json")
.withStatus(HttpStatus.SC_OK)));
- instance.createVfModule("mtn13", "123", "vf", "v1", "", "vfname", "", "create", "3245", "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
+ instance.createVfModule("mtn13", "CloudOwner", "123", "vf", "v1", "", "vfname", "", "create", "3245", "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", new HashMap<>(), true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
}
@Test
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
- instance.updateVfModule("123", "1234", "fw", "v2", "vnf1", "create", "123", "12", "233", "234", new HashMap<>(), msoRequest, new Holder<>(), new Holder<>());
+ instance.updateVfModule("123", "CloudOwner", "1234", "fw", "v2", "vnf1", "create", "123", "12", "233", "234", new HashMap<>(), msoRequest, new Holder<>(), new Holder<>());
}
@Test
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
try {
- instance.createVnf("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ instance.createVnf("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
"volumeGroupHeatStackId|1", map,
Boolean.FALSE, Boolean.TRUE, Boolean.TRUE, msoRequest, new Holder<>(), new Holder<>(),
new Holder<>());
map.put("key1", "value1");
try {
- instance.updateVnf("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
+ instance.updateVnf("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "vSAMP12", "VFMOD",
"volumeGroupHeatStackId|1", map, msoRequest, new Holder<>(),
new Holder<>());
} catch (Exception e) {
msoRequest.setRequestId("12345");
msoRequest.setServiceInstanceId("12345");
try {
- instance.deleteVnf("mdt1", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest);
+ instance.deleteVnf("mdt1", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest);
} catch (Exception e) {
}
.withBodyFile("MulticloudResponse_Stack_Create.json")
.withStatus(HttpStatus.SC_CREATED)));
- instance.createVfModule("MTN13", "123", "vf", "v1", "genericVnfId", "vfname", "vfModuleId", "create", null, "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", stackInputs, true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
+ instance.createVfModule("MTN13", "CloudOwner", "123", "vf", "v1", "genericVnfId", "vfname", "vfModuleId", "create", null, "234", "9b339a61-69ca-465f-86b8-1c72c582b8e8", stackInputs, true, true, true, msoRequest, new Holder<>(), new Holder<>(), new Holder<>());
}
@Test
stubFor(delete(urlPathEqualTo("/api/multicloud/v1/cloud_owner/cloud_region_id/infra_workload/workload-id")).willReturn(aResponse()
.withStatus(HttpStatus.SC_NO_CONTENT)));
- instance.deleteVfModule("MTN13", "123", "workload-id", msoRequest, new Holder<>());
+ instance.deleteVfModule("MTN13", "CloudOwner", "123", "workload-id", msoRequest, new Holder<>());
}
@Test
.withBodyFile("MulticloudResponse_Stack.json")
.withStatus(HttpStatus.SC_OK)));
- instance.queryVnf("MTN13", "123", "workload-id", msoRequest, new Holder<>(), new Holder<>(), new Holder<>(), new Holder<>());
+ instance.queryVnf("MTN13", "CloudOwner", "123", "workload-id", msoRequest, new Holder<>(), new Holder<>(), new Holder<>(), new Holder<>());
}
// TODO Error Tests
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- msoVnfPluginAdapter.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", null, map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- msoVnfPluginAdapter.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "88a6ca3ee0394ade9403f075db23167e", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- msoVnfPluginAdapter.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "9b339a61-69ca-465f-86b8-1c72c582b8e8", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- msoVnfPluginAdapter.createVfModule("MTN13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ msoVnfPluginAdapter.createVfModule("MTN13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
null, "baseVfHeatStackId", "9b339a61-69ca-465f-86b8-1c72c582b8e8", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- msoVnfPluginAdapter.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId|1", "baseVfHeatStackId", "9b339a61-69ca-465f-86b8-1c72c582b8e8", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
MsoRequest msoRequest = getMsoRequest();
Map<String, Object> map = new HashMap<>();
map.put("key1", "value1");
- msoVnfPluginAdapter.createVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
+ msoVnfPluginAdapter.createVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vnf", "1", "", vnfName, "", "VFMOD",
"volumeGroupHeatStackId", "baseVfHeatStackId", "9b339a61-69ca-465f-86b8-1c72c582b8e8", map,
Boolean.FALSE, Boolean.TRUE, Boolean.FALSE, msoRequest, new Holder<>(), new Holder<Map<String, String>>(),
new Holder<VnfRollback>());
public void deleteVfModule_QueryVduException() throws Exception {
expectedException.expect(VnfException.class);
MsoRequest msoRequest = getMsoRequest();
- msoVnfPluginAdapter.deleteVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
+ msoVnfPluginAdapter.deleteVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
new Holder<Map<String, String>>());
}
.willReturn(aResponse().withHeader("Content-Type", "application/json")
.withStatus(HttpStatus.SC_INTERNAL_SERVER_ERROR)));
MsoRequest msoRequest = getMsoRequest();
- msoVnfPluginAdapter.deleteVfModule("mtn13", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
+ msoVnfPluginAdapter.deleteVfModule("mtn13", "CloudOwner", "88a6ca3ee0394ade9403f075db23167e", "vSAMP12", msoRequest,
new Holder<Map<String, String>>());
}
@Test
public void testQueryCreatedVnf() throws VnfException, MsoException {
StackInfo info = new StackInfo("stackName", HeatStatus.CREATED);
- when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(info);
+ when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(info);
String cloudId = "MT";
+ String cloudOwner = "CloudOwner";
String tenantId = "MSO_Test";
String vnfName = "VNF_TEST1";
Holder<Boolean> vnfExists = new Holder<>();
Holder<VnfStatus> status = new Holder<>();
Holder<Map<String, String>> outputs = new Holder<>();
- vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null, vnfExists, vnfId, status, outputs);
+ vnfAdapter.queryVnf(cloudId, cloudOwner, tenantId, vnfName, null, vnfExists, vnfId, status, outputs);
assertTrue(vnfExists.value);
}
@Test
public void testQueryNotFoundVnf() throws VnfException, MsoException {
StackInfo info = new StackInfo("stackName", HeatStatus.NOTFOUND);
- when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(info);
+ when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenReturn(info);
String cloudId = "MT";
+ String cloudOwner = "CloudOwner";
String tenantId = "MSO_Test";
String vnfName = "VNF_TEST1";
Holder<Boolean> vnfExists = new Holder<>();
Holder<VnfStatus> status = new Holder<>();
Holder<Map<String, String>> outputs = new Holder<>();
- vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null, vnfExists, vnfId, status, outputs);
+ vnfAdapter.queryVnf(cloudId, cloudOwner, tenantId, vnfName, null, vnfExists, vnfId, status, outputs);
assertFalse(vnfExists.value);
}
// @Ignore // 1802 merge
public void testQueryVnfWithException() throws VnfException, MsoException {
String cloudId = "MT";
+ String cloudOwner = "CloudOwner";
String tenantId = "MSO_Test";
String vnfName = "VNF_TEST1";
Holder<Boolean> vnfExists = new Holder<>();
Holder<Map<String, String>> outputs = new Holder<>();
thrown.expect(VnfException.class);
thrown.expectCause(hasProperty("context", is("QueryVNF")));
- when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any())).thenThrow(new MsoOpenstackException(1, "test messsage", "test detail"));
- vnfAdapter.queryVnf(cloudId, tenantId, vnfName, null, vnfExists, vnfId, status, outputs);
+ when(heat.queryStack(Mockito.any(), Mockito.any(), Mockito.any(), Mockito.any())).thenThrow(new MsoOpenstackException(1, "test messsage", "test detail"));
+ vnfAdapter.queryVnf(cloudId, cloudOwner, tenantId, vnfName, null, vnfExists, vnfId, status, outputs);
}
}
private static final String MSO_REQUEST_ID = "62265093-277d-4388-9ba6-449838ade586";
private static final String MSO_SERVICE_INSTANCE_ID = "4147e06f-1b89-49c5-b21f-4faf8dc9805a";
private static final String CLOUDSITE_ID = "mtn13";
+ private static final String CLOUD_OWNER = "CloudOwner";
private static final String TENANT_ID = "0422ffb57ba042c0800a29dc85ca70f8";
private static final String VNF_TYPE = "MSOTADevInfra_vSAMP10a_Service/vSAMP10a 1";
private static final String VNF_NAME = "MSO-DEV-VNF-1802-it3-pwt3-vSAMP10a-1XXX-Replace";
msoRequest.setServiceInstanceId(MSO_SERVICE_INSTANCE_ID);
VfModuleRollback vfModuleRollback = new VfModuleRollback(AAI_VNF_ID, VF_MODULE_ID,
- "StackId", false, TENANT_ID, CLOUDSITE_ID, msoRequest, "messageId");
+ "StackId", false, TENANT_ID, CLOUD_OWNER, CLOUDSITE_ID, msoRequest, "messageId");
RollbackVfModuleRequest request = new RollbackVfModuleRequest();
request.setVfModuleRollback(vfModuleRollback);
<volumeGroupId>8a07b246-155e-4b08-b56e-76e98a3c2d66</volumeGroupId>
<volumeGroupStackId>phmaz401me6-vpevre-VOLUMEGROUP/dbd560b6-b03f-4a17-92e7-8942459a60c1</volumeGroupStackId>
<cloudSiteId>mtrnj1b</cloudSiteId>
+ <cloudOwnerId>CloudOwner</cloudOwnerId>
<tenantId>cfb5e0a790374c9a98a1c0d2044206a7</tenantId>
<volumeGroupCreated>true</volumeGroupCreated>
<msoRequest>
* <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
* <sequence>
* <element name="cloudSiteId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
+ * <element name="cloudOwner" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
* <element name="msoRequest" type="{http://org.onap.so/vnfNotify}msoRequest" minOccurs="0"/>
* <element name="tenantCreated" type="{http://www.w3.org/2001/XMLSchema}boolean"/>
* <element name="tenantId" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "vnfRollback", propOrder = {
"cloudSiteId",
+ "cloudOwner",
"msoRequest",
"tenantCreated",
"tenantId",
public class VnfRollback {
protected String cloudSiteId;
+ protected String cloudOwner;
protected MsoRequest msoRequest;
protected boolean tenantCreated;
protected String tenantId;
this.cloudSiteId = value;
}
+ /**
+ * Gets the value of the cloudOwner property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCloudOwner() {
+ return cloudOwner;
+ }
+
+ /**
+ * Sets the value of the cloudOwner property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setCloudOwner(String value) {
+ this.cloudOwner = value;
+ }
+
/**
* Gets the value of the msoRequest property.
*
return
"<cloudSiteId>"+cloudSiteId+"</cloudSiteId>" + '\n' +
+ "<cloudOwner>"+cloudOwner+"</cloudOwner>" + '\n' +
msoRequestElement +
"<tenantCreated>"+tenantCreated+"</tenantCreated>" + '\n' +
"<tenantId>"+tenantId+"</tenantId>" + '\n' +
private final String CREATE_VF_MODULE_REQUEST =
"<createVfModuleRequest>" + EOL +
" <cloudSiteId>cloudSiteId</cloudSiteId>" + EOL +
+ " <cloudOwner>cloudOwner</cloudOwner>" + EOL +
" <tenantId>tenantId</tenantId>" + EOL +
" <vnfId>vnfId</vnfId>" + EOL +
" <vfModuleName>vfModuleName</vfModuleName>" + EOL +
private final String UPDATE_VF_MODULE_REQUEST =
"<updateVfModuleRequest>" + EOL +
" <cloudSiteId>cloudSiteId</cloudSiteId>" + EOL +
+ " <cloudOwner>cloudOwner</cloudOwner>" + EOL +
" <tenantId>tenantId</tenantId>" + EOL +
" <vnfId>vnfId</vnfId>" + EOL +
" <vfModuleName>vfModuleName</vfModuleName>" + EOL +
private final String DELETE_VF_MODULE_REQUEST =
"<deleteVfModuleRequest>" + EOL +
" <cloudSiteId>cloudSiteId</cloudSiteId>" + EOL +
+ " <cloudOwner>cloudOwner</cloudOwner>" + EOL +
" <tenantId>tenantId</tenantId>" + EOL +
" <vnfId>vnfId</vnfId>" + EOL +
" <vfModuleId>vfModuleId</vfModuleId>" + EOL +
" <skipAAI>true</skipAAI>" + EOL +
" <vfModuleRollback>" + EOL +
" <cloudSiteId>cloudSiteId</cloudSiteId>" + EOL +
+ " <cloudOwner>cloudOwner</cloudOwner>" + EOL +
" <tenantId>tenantId</tenantId>" + EOL +
" <vnfId>vnfId</vnfId>" + EOL +
" <vfModuleId>vfModuleId</vfModuleId>" + EOL +
" <vfModuleStackId>vfModuleStackId</vfModuleStackId>" + EOL +
" <vfModuleCreated>true</vfModuleCreated>" + EOL +
" <tenantId>tenantId</tenantId>" + EOL +
+ " <cloudOwner>cloudOwner</cloudOwner>" + EOL +
" <cloudSiteId>cloudSiteId</cloudSiteId>" + EOL +
" <msoRequest>" + EOL +
" <requestId>requestId</requestId>" + EOL +
"/tns:createVnfNotification/tns:rollback/tns:cloudSiteId/text()");
rollback.setCloudSiteId(cloudSiteId);
+ String cloudOwner = xpathTool.evaluate(
+ "/tns:createVnfNotification/tns:rollback/tns:cloudOwner/text()");
+ rollback.setCloudOwner(cloudOwner);
+
String requestId = xpathTool.evaluate(
"/tns:createVnfNotification/tns:rollback/tns:msoRequest/tns:requestId/text()");
String serviceInstanceId = xpathTool.evaluate(
"/tns:updateVnfNotification/tns:rollback/tns:cloudSiteId/text()");
rollback.setCloudSiteId(cloudSiteId);
+ String cloudOwner = xpathTool.evaluate(
+ "/tns:updateVnfNotification/tns:rollback/tns:cloudOwner/text()");
+ rollback.setCloudOwner(cloudOwner);
+
String requestId = xpathTool.evaluate(
"/tns:updateVnfNotification/tns:rollback/tns:msoRequest/tns:requestId/text()");
String serviceInstanceId = xpathTool.evaluate(
execution.setVariable('DELVfModVol_vnfType', null)
execution.setVariable('DELVfModVol_serviceId', null)
execution.setVariable('DELVfModVol_cloudRegion', null)
+ execution.setVariable('DELVfModVol_cloudOwner', null)
execution.setVariable('DELVfModVol_tenantId', null)
execution.setVariable('DELVfModVol_volumeParams', null)
execution.setVariable('DELVfModVol_volumeGroupHeatStackId', null)
execution.setVariable('DELVfModVol_volumeOutputs', utils.getNodeXml(request, 'volume-outputs', false))
execution.setVariable('DELVfModVol_volumeParams', utils.getNodeXml(request, 'volume-params'))
execution.setVariable('DELVfModVol_cloudRegion', utils.getNodeText(request, 'aic-cloud-region'))
+ execution.setVariable('DELVfModVol_cloudOwner', utils.getNodeText(request, 'cloud-owner'))
setBasicDBAuthHeader(execution, isDebugLogEnabled)
public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) {
def cloudRegion = execution.getVariable('DELVfModVol_cloudRegion')
+ def cloudOwner = execution.getVariable('DELVfModVol_cloudOwner')
def tenantId = execution.getVariable('DELVfModVol_tenantId')
def volumeGroupId = execution.getVariable('DELVfModVol_volumeGroupId')
def volumeGroupHeatStackId = execution.getVariable('DELVfModVol_volumeGroupHeatStackId')
String vnfAdapterRestRequest = """
<deleteVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
<volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId>
//Get variables
//cloudSiteId
def cloudSiteId = execution.getVariable("DCVFM_cloudSiteId")
+ //cloudOwner
+ def cloudOwner = execution.getVariable("DCVFM_cloudOwner")
//tenantId
def tenantId = execution.getVariable("DCVFM_tenantId")
//vnfType
String createVnfARequest = """
<createVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudSiteId)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
def vfModuleModelName = execution.getVariable("DCVFM_vfModuleModelName")
def vnfId = execution.getVariable("DCVFM_vnfId")
def cloudSiteId = execution.getVariable("DCVFM_cloudSiteId")
+ def cloudOwner = execution.getVariable("DCVFM_cloudOwner")
def sdncVersion = execution.getVariable("DCVFM_sdncVersion")
def serviceModelInfo = execution.getVariable("serviceModelInfo")
def vnfModelInfo = execution.getVariable("vnfModelInfo")
execution.setVariable("DCVFMR_vfModuleModelName", vfModuleModelName)
String cloudSiteId = rollbackData.get("VFMODULE", "aiccloudregion")
execution.setVariable("DCVFMR_cloudSiteId", cloudSiteId)
+ String cloudOwner = rollbackData.get("VFMODULE", "cloudowner")
+ execution.setVariable("DCVFMR_cloudOwner", cloudOwner)
String heatStackId = rollbackData.get("VFMODULE", "heatstackid")
execution.setVariable("DCVFMR_heatStackId", heatStackId)
String requestId = rollbackData.get("VFMODULE", "msorequestid")
String origRequestId = execution.getVariable("DCVFMR_requestId")
String srvInstId = execution.getVariable("DCVFMR_serviceInstanceId")
String aicCloudRegion = execution.getVariable("DCVFMR_cloudSiteId")
+ String cloudOwner = execution.getVariable("DCVFMR_cloudOwner")
String vnfId = execution.getVariable("DCVFMR_vnfId")
String vfModuleId = execution.getVariable("DCVFMR_vfModuleId")
String vfModuleStackId = execution.getVariable("DCVFMR_heatStackId")
String request = """
<deleteVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
execution.setVariable("tenantId", tenantId)
String cloudSiteId = jsonUtil.getJsonValue(cloudConfiguration, "lcpCloudRegionId")
execution.setVariable("cloudSiteId", cloudSiteId)
+ String cloudOwner = jsonUtil.getJsonValue(cloudConfiguration, "cloudOwner")
+ execution.setVariable("cloudOwner", cloudOwner)
// Source is HARDCODED
String source = "VID"
execution.setVariable("source", source)
execution.setVariable("vfModuleModelName", vfModuleModelName)
String cloudSiteId = utils.getNodeText(xml, "aic-cloud-region")
execution.setVariable("cloudSiteId", cloudSiteId)
+ String cloudOwner = utils.getNodeText(xml, "cloud-owner")
+ execution.setVariable("cloudOwner", cloudOwner)
}
// formulate the request for PrepareUpdateAAIVfModule
def origRequestId = execution.getVariable('requestId')
def srvInstId = execution.getVariable("serviceInstanceId")
def aicCloudRegion = execution.getVariable("cloudSiteId")
+ def cloudOwner = execution.getVariable("cloudOwner")
def vnfId = execution.getVariable("vnfId")
def vfModuleId = execution.getVariable("vfModuleId")
def vfModuleStackId = execution.getVariable('DoDVfMod_heatStackId')
String request = """
<deleteVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
String cloudSiteId = execution.getVariable("lcpCloudRegionId")
execution.setVariable("cloudSiteId", cloudSiteId)
logger.debug("cloudSiteId: " + cloudSiteId)
+ String cloudOwner = execution.getVariable("cloudOwner")
+ execution.setVariable("cloudOwner", cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
// Source is HARDCODED
String source = "VID"
execution.setVariable("source", source)
def origRequestId = execution.getVariable('requestId')
def srvInstId = execution.getVariable("serviceInstanceId")
def aicCloudRegion = execution.getVariable("cloudSiteId")
+ def cloudOwner = execution.getVariable("cloudOwner")
def vnfId = execution.getVariable("vnfId")
def vfModuleId = execution.getVariable("vfModuleId")
def vfModuleStackId = execution.getVariable('DDVMFV_heatStackId')
String request = """
<deleteVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
*/
public void prepareVnfAdapterDeleteRequest(DelegateExecution execution, isDebugLogEnabled) {
def cloudRegion = execution.getVariable(prefix+'aicCloudRegion')
+ def cloudOwner = execution.getVariable(prefix+'cloudOwner')
def tenantId = execution.getVariable('tenantId') // input parameter (optional) - see preProcessRequest
def volumeGroupId = execution.getVariable('volumeGroupId') // input parameter (required)
def volumeGroupHeatStackId = execution.getVariable(prefix+'volumeGroupHeatStackId') // from AAI query volume group
String vnfAdapterRestRequest = """
<deleteVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
<volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId>
execution.setVariable("DOUPVfMod_aicCloudRegion", cloudSiteId)
logger.debug("cloudSiteId: " + cloudSiteId)
+
+ //cloudOwner
+ def cloudOwner = execution.getVariable("cloudOwner")
+ execution.setVariable("DOUPVfMod_cloudOwner", cloudOwner)
+ logger.debug("cloudOwner: " + cloudOwner)
+
//vnfType
def vnfType = execution.getVariable("vnfType")
execution.setVariable("DOUPVfMod_vnfType", vnfType)
execution.setVariable('DOUPVfMod_modelCustomizationUuid', getNodeTextForce(vnfInputs, 'model-customization-id'))
execution.setVariable('DOUPVfMod_serviceId', getRequiredNodeText(execution, vnfInputs, 'service-id'))
execution.setVariable('DOUPVfMod_aicCloudRegion', getRequiredNodeText(execution, vnfInputs, 'aic-cloud-region'))
+ execution.setVariable('DOUPVfMod_cloudOwner', getRequiredNodeText(execution, vnfInputs, 'cloud-owner'))
execution.setVariable('DOUPVfMod_tenantId', getRequiredNodeText(execution, vnfInputs, 'tenant-id'))
//isBaseVfModule
def isBaseVfModule = "false"
heatStackId = vfModule.getHeatStackId()
}
def cloudId = execution.getVariable('DOUPVfMod_aicCloudRegion')
+ def cloudOwner = execution.getVariable('DOUPVfMod_cloudOwner')
def vnfType = execution.getVariable('DOUPVfMod_vnfType')
def vnfName = execution.getVariable('DOUPVfMod_vnfName')
def vfModuleModelName = execution.getVariable('DOUPVfMod_vfModuleModelName')
String vnfAdapterRestRequest = """
<updateVfModuleRequest>
<cloudSiteId>${MsoUtils.xmlEscape(cloudId)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vfModuleId>${MsoUtils.xmlEscape(vfModuleId)}</vfModuleId>
execution.setVariable('UPDVfModVol_vnfType', getRequiredNodeText(execution, volumeInputs, 'vnf-type'))
execution.setVariable('UPDVfModVol_serviceId', getRequiredNodeText(execution, volumeInputs, 'service-id'))
execution.setVariable('UPDVfModVol_aicCloudRegion', getRequiredNodeText(execution, volumeInputs, 'aic-cloud-region'))
+ execution.setVariable('UPDVfModVol_cloudOwner', getRequiredNodeText(execution, volumeInputs, 'cloud-owner'))
execution.setVariable('UPDVfModVol_tenantId', getRequiredNodeText(execution, volumeInputs, 'tenant-id'))
def volumeParams = utils.getNodeXml(request, 'volume-params')
String vnfAdapterRestRequest = """
<updateVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<volumeGroupId>${MsoUtils.xmlEscape(volumeGroupId)}</volumeGroupId>
<volumeGroupStackId>${MsoUtils.xmlEscape(volumeGroupHeatStackId)}</volumeGroupStackId>
execution.setVariable('UPDVfModVol_vnfVersion', getRequiredNodeText(execution, volumeInputs, 'asdc-service-model-version'))
execution.setVariable('UPDVfModVol_serviceId', utils.getNodeText(volumeInputs, 'service-id'))
execution.setVariable('UPDVfModVol_aicCloudRegion', getRequiredNodeText(execution, volumeInputs, 'aic-cloud-region'))
+ execution.setVariable('UPDVfModVol_cloudRegion', getRequiredNodeText(execution, volumeInputs, 'cloud-owner'))
execution.setVariable('UPDVfModVol_tenantId', getRequiredNodeText(execution, volumeInputs, 'tenant-id'))
//execution.setVariable('UPDVfModVol_modelCustomizationId', getRequiredNodeText(execution, volumeInputs, 'model-customization-id'))
String vnfAdapterRestRequest = """
<updateVolumeGroupRequest>
<cloudSiteId>${MsoUtils.xmlEscape(aicCloudRegion)}</cloudSiteId>
+ <cloudOwner>${MsoUtils.xmlEscape(cloudOwner)}</cloudOwner>
<tenantId>${MsoUtils.xmlEscape(tenantId)}</tenantId>
<vnfId>${MsoUtils.xmlEscape(vnfId)}</vnfId>
<vnfName>${MsoUtils.xmlEscape(vnfName)}</vnfName>
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("DCVFM_cloudSiteId")).thenReturn("12345")
+ when(mockExecution.getVariable("DCVFM_cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable("rollbackData")).thenReturn(new RollbackData())
List fqdnList = new ArrayList()
fqdnList.add("test")
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("DCVFM_cloudSiteId")).thenReturn("12345")
+ when(mockExecution.getVariable("DCVFM_cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable("rollbackData")).thenReturn(new RollbackData())
List fqdnList = new ArrayList()
fqdnList.add("test")
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable("DCVFM_cloudSiteId")).thenReturn("12345")
+ when(mockExecution.getVariable("DCVFM_cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable("rollbackData")).thenReturn(new RollbackData())
List fqdnList = new ArrayList()
fqdnList.add("test")
ExecutionEntity mockExecution = setupMock()
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable(prefix + "aicCloudRegion")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(prefix + "cloudRegion")).thenReturn("CloudOwner")
when(mockExecution.getVariable(prefix + "vfModuleId")).thenReturn("cb510af0-5b21-4bc7-86d9-323cb396ce32")
when(mockExecution.getVariable(prefix + "volumeGroupStackId")).thenReturn("12345")
when(mockExecution.getVariable(prefix + "vfModuleName")).thenReturn("PCRF::module-0-2")
when(mockExecution.getVariable("prefix")).thenReturn(prefix)
when(mockExecution.getVariable("isDebugLogEnabled")).thenReturn("true")
when(mockExecution.getVariable(prefix + "aicCloudRegion")).thenReturn("RDM2WAGPLCP")
+ when(mockExecution.getVariable(prefix + "cloudOwner")).thenReturn("CloudOwner")
when(mockExecution.getVariable(prefix + "tenantId")).thenReturn("")
VolumeGroup volumeGroup = new VolumeGroup();
volumeGroup.setHeatStackId("heatStackId")
CreateVfModuleRequest createVfModuleRequest = new CreateVfModuleRequest();
createVfModuleRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId());
+ createVfModuleRequest.setCloudOwner(cloudRegion.getCloudOwner());
createVfModuleRequest.setTenantId(cloudRegion.getTenantId());
createVfModuleRequest.setVfModuleId(vfModule.getVfModuleId());
createVfModuleRequest.setVfModuleName(vfModule.getVfModuleName());
VfModule vfModule) throws IOException {
DeleteVfModuleRequest deleteVfModuleRequest = new DeleteVfModuleRequest();
deleteVfModuleRequest.setCloudSiteId(cloudRegion.getLcpCloudRegionId());
+ deleteVfModuleRequest.setCloudOwner(cloudRegion.getCloudOwner());
deleteVfModuleRequest.setTenantId(cloudRegion.getTenantId());
deleteVfModuleRequest.setVnfId(genericVnf.getVnfId());
deleteVfModuleRequest.setVfModuleId(vfModule.getVfModuleId());
}
return baseVfModule;
}
-}
\ No newline at end of file
+}