diff options
Diffstat (limited to 'adapters')
23 files changed, 646 insertions, 503 deletions
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java index 14aee2f4f2..20498cb694 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatUtils.java @@ -103,13 +103,6 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ protected static final String CREATE_STACK = "CreateStack"; - // Cache Heat Clients statically. Since there is just one MSO user, there is no - // benefit to re-authentication on every request (or across different flows). The - // token will be used until it expires. - // - // The cache key is "tenantId:cloudId" - private static Map <String, HeatCacheEntry> heatClientCache = new HashMap <> (); - // Fetch cloud configuration each time (may be cached in CloudConfig class) @Autowired protected CloudConfig cloudConfig; @@ -859,19 +852,6 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ String cloudId = cloudSite.getId(); // For DCP/LCP, the region should be the cloudId. String region = cloudSite.getRegionId (); - - // Check first in the cache of previously authorized clients - String cacheKey = cloudId + ":" + tenantId; - if (heatClientCache.containsKey (cacheKey)) { - if (!heatClientCache.get (cacheKey).isExpired ()) { - LOGGER.debug ("Using Cached HEAT Client for " + cacheKey); - return heatClientCache.get (cacheKey).getHeatClient (); - } else { - // Token is expired. Remove it from cache. - heatClientCache.remove (cacheKey); - LOGGER.debug ("Expired Cached HEAT Client for " + cacheKey); - } - } // Obtain an MSO token for the tenant CloudIdentity cloudIdentity = cloudSite.getIdentityService(); @@ -946,38 +926,11 @@ public class MsoHeatUtils extends MsoCommonUtils implements VduPlugin{ // Catch-all throw runtimeExceptionToMsoException (e, TOKEN_AUTH); } - Heat heatClient = new Heat (heatUrl); heatClient.token (tokenId); - - heatClientCache.put (cacheKey, - new HeatCacheEntry (heatUrl, - tokenId, - expiration)); - LOGGER.debug ("Caching HEAT Client for " + cacheKey); - return heatClient; } - /** - * Forcibly expire a HEAT client from the cache. This call is for use by - * the KeystoneClient in case where a tenant is deleted. In that case, - * all cached credentials must be purged so that fresh authentication is - * done if a similarly named tenant is re-created. - * <p> - * Note: This is probably only applicable to dev/test environments where - * the same Tenant Name is repeatedly used for creation/deletion. - * <p> - * - */ - public void expireHeatClient (String tenantId, String cloudId) { - String cacheKey = cloudId + ":" + tenantId; - if (heatClientCache.containsKey (cacheKey)) { - heatClientCache.remove (cacheKey); - LOGGER.debug ("Deleted Cached HEAT Client for " + cacheKey); - } - } - /* * Query for a Heat Stack. This function is needed in several places, so * a common method is useful. This method takes an authenticated Heat Client diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java index 3936ae6496..0bd2a3931f 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoKeystoneUtils.java @@ -59,12 +59,6 @@ import com.woorea.openstack.keystone.utils.KeystoneUtils; @Component public class MsoKeystoneUtils extends MsoTenantUtils { - // Cache the Keystone Clients statically. Since there is just one MSO user, there is no - // benefit to re-authentication on every request (or across different flows). The - // token will be used until it expires. - // - // The cache key is "cloudId" - private static Map <String, KeystoneCacheEntry> adminClientCache = new HashMap<>(); private static MsoLogger LOGGER = MsoLogger.getMsoLogger (MsoLogger.Catalog.RA, MsoKeystoneUtils.class); @@ -316,10 +310,6 @@ public class MsoKeystoneUtils extends MsoTenantUtils { OpenStackRequest <Void> request = keystoneAdminClient.tenants ().delete (tenant.getId ()); executeAndRecordOpenstackRequest (request); LOGGER.debug ("Deleted Tenant " + tenant.getId () + " (" + tenant.getName () + ")"); - - // Clear any cached clients. Not really needed, ID will not be reused. - msoHeatUtils.expireHeatClient (tenant.getId (), cloudSiteId); - msoNeutronUtils.expireNeutronClient (tenant.getId (), cloudSiteId); } catch (OpenStackBaseException e) { // Convert Keystone OpenStackResponseException to MsoOpenstackException throw keystoneErrorToMsoException (e, "Delete Tenant"); @@ -369,9 +359,6 @@ public class MsoKeystoneUtils extends MsoTenantUtils { LOGGER.debug ("Deleted Tenant " + tenant.getId () + " (" + tenant.getName () + ")"); - // Clear any cached clients. Not really needed, ID will not be reused. - msoHeatUtils.expireHeatClient (tenant.getId (), cloudSiteId); - msoNeutronUtils.expireNeutronClient (tenant.getId (), cloudSiteId); } catch (OpenStackBaseException e) { // Note: It doesn't seem to matter if tenant doesn't exist, no exception is thrown. // Convert Keystone OpenStackResponseException to MsoOpenstackException @@ -407,16 +394,6 @@ public class MsoKeystoneUtils extends MsoTenantUtils { String adminTenantName = cloudIdentity.getAdminTenant (); String region = cloudSite.getRegionId (); - // Check first in the cache of previously authorized clients - KeystoneCacheEntry entry = adminClientCache.get (cloudId); - if (entry != null) { - if (!entry.isExpired ()) { - return entry.getKeystoneClient (); - } else { - // Token is expired. Remove it from cache. - adminClientCache.remove (cloudId); - } - } MsoTenantUtils tenantUtils = tenantUtilsFactory.getTenantUtilsByServerType(cloudIdentity.getIdentityServerType()); final String keystoneUrl = tenantUtils.getKeystoneUrl(region, cloudIdentity); Keystone keystone = new Keystone(keystoneUrl); @@ -462,11 +439,6 @@ public class MsoKeystoneUtils extends MsoTenantUtils { // Note: this doesn't go back to Openstack, it's just a local object. keystone = new Keystone (adminUrl); keystone.token (token); - - // Cache to avoid re-authentication for every call. - KeystoneCacheEntry cacheEntry = new KeystoneCacheEntry (adminUrl, token, access.getToken ().getExpires ()); - adminClientCache.put (cloudId, cacheEntry); - return keystone; } @@ -636,32 +608,6 @@ public class MsoKeystoneUtils extends MsoTenantUtils { return null; } - private static class KeystoneCacheEntry implements Serializable { - - private static final long serialVersionUID = 1L; - - private String keystoneUrl; - private String token; - private Calendar expires; - - public KeystoneCacheEntry (String url, String token, Calendar expires) { - this.keystoneUrl = url; - this.token = token; - this.expires = expires; - } - - public Keystone getKeystoneClient () { - Keystone keystone = new Keystone (keystoneUrl); - keystone.token (token); - return keystone; - } - - public boolean isExpired () { - // adding arbitrary guard timer of 5 minutes - return expires == null || System.currentTimeMillis() > (expires.getTimeInMillis() - 1800000); - } - } - @Override public String getKeystoneUrl(String regionId, CloudIdentity cloudIdentity) throws MsoException { return cloudIdentity.getIdentityUrl(); diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java index 7b82ad62ff..785e8606d3 100644 --- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java +++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoNeutronUtils.java @@ -67,12 +67,6 @@ import com.woorea.openstack.quantum.model.Segment; @Component public class MsoNeutronUtils extends MsoCommonUtils { - // Cache Neutron Clients statically. Since there is just one MSO user, there is no - // benefit to re-authentication on every request (or across different flows). The - // token will be used until it expires. - // - // The cache key is "tenantId:cloudId" - private static Map<String,NeutronCacheEntry> neutronClientCache = new HashMap<>(); // Fetch cloud configuration each time (may be cached in CloudConfig class) @Autowired @@ -364,24 +358,8 @@ public class MsoNeutronUtils extends MsoCommonUtils private Quantum getNeutronClient(CloudSite cloudSite, String tenantId) throws MsoException { String cloudId = cloudSite.getId(); - String region = cloudSite.getRegionId(); - - // Check first in the cache of previously authorized clients - String cacheKey = cloudId + ":" + tenantId; - if (neutronClientCache.containsKey(cacheKey)) { - if (! neutronClientCache.get(cacheKey).isExpired()) { - LOGGER.debug ("Using Cached HEAT Client for " + cacheKey); - NeutronCacheEntry cacheEntry = neutronClientCache.get(cacheKey); - Quantum neutronClient = new Quantum(cacheEntry.getNeutronUrl()); - neutronClient.token(cacheEntry.getToken()); - return neutronClient; - } - else { - // Token is expired. Remove it from cache. - neutronClientCache.remove(cacheKey); - LOGGER.debug ("Expired Cached Neutron Client for " + cacheKey); - } - } + String region = cloudSite.getRegionId(); + // Obtain an MSO token for the tenant from the identity service CloudIdentity cloudIdentity = cloudSite.getIdentityService(); @@ -454,31 +432,9 @@ public class MsoNeutronUtils extends MsoCommonUtils Quantum neutronClient = new Quantum(neutronUrl); neutronClient.token(tokenId); - - neutronClientCache.put(cacheKey, new NeutronCacheEntry(neutronUrl, tokenId, expiration)); - LOGGER.debug ("Caching Neutron Client for " + cacheKey); - return neutronClient; } - /** - * Forcibly expire a Neutron client from the cache. This call is for use by - * the KeystoneClient in case where a tenant is deleted. In that case, - * all cached credentials must be purged so that fresh authentication is - * done on subsequent calls. - * <p> - * @param tenantName - * @param cloudId - */ - public void expireNeutronClient (String tenantId, String cloudId) { - String cacheKey = cloudId + ":" + tenantId; - if (neutronClientCache.containsKey(cacheKey)) { - neutronClientCache.remove(cacheKey); - LOGGER.debug ("Deleted Cached Neutron Client for " + cacheKey); - } - } - - /* * Find a tenant (or query its existence) by its Name or Id. Check first against the * ID. If that fails, then try by name. diff --git a/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java new file mode 100644 index 0000000000..aeee279002 --- /dev/null +++ b/adapters/mso-catalog-db-adapter/src/test/java/org/onap/so/adapters/catalogdb/catalogrest/CvnfcCatalogDbQueryTest.java @@ -0,0 +1,198 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP - SO + * ================================================================================ + * Copyright (C) 2017 - 2018 AT&T Intellectual Property. All rights reserved. + * ================================================================================ + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============LICENSE_END========================================================= + */ + +package org.onap.so.adapters.catalogdb.catalogrest; + +import static com.shazam.shazamcrest.MatcherAssert.assertThat; +import static com.shazam.shazamcrest.matcher.Matchers.sameBeanAs; +import static org.junit.Assert.assertNotNull; +import static org.junit.Assert.assertTrue; + +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.junit.Assert; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; +import org.onap.so.adapters.catalogdb.CatalogDBApplication; +import org.onap.so.db.catalog.beans.ConfigurationResource; +import org.onap.so.db.catalog.beans.CvnfcCustomization; +import org.onap.so.db.catalog.beans.VfModule; +import org.onap.so.db.catalog.beans.VfModuleCustomization; +import org.onap.so.db.catalog.beans.VnfResource; +import org.onap.so.db.catalog.beans.VnfResourceCustomization; +import org.onap.so.db.catalog.beans.VnfVfmoduleCvnfcConfigurationCustomization; +import org.onap.so.db.catalog.beans.VnfcCustomization; +import org.onap.so.db.catalog.client.CatalogDbClientPortChanger; +import org.onap.so.db.catalog.data.repository.CvnfcCustomizationRepository; +import org.onap.so.logger.MsoLogger; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.web.server.LocalServerPort; +import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.ActiveProfiles; +import org.springframework.test.context.junit4.SpringRunner; + +import org.springframework.beans.BeanUtils; + +@RunWith(SpringRunner.class) +@SpringBootTest(classes = CatalogDBApplication.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT) +@ActiveProfiles("test") +public class CvnfcCatalogDbQueryTest { + + @Autowired + private CvnfcCustomizationRepository cvnfcCustomizationRepository; + + private static final MsoLogger msoLogger = MsoLogger.getMsoLogger(MsoLogger.Catalog.BPEL, CvnfcCatalogDbQueryTest.class); + + @LocalServerPort + private int port; + boolean isInitialized; + + @Autowired + CatalogDbClientPortChanger client; + + @Before + public void initialize(){ + client.wiremockPort= String.valueOf(port); + } + + @Test + public void cVnfcTest() { + + CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization("dadc2c8c-2bab-11e9-b210-d663bd873d93"); + + List<CvnfcCustomization> foundCvnfcCustomization = client.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("68dc9a92-214c-11e7-93ae-92361f002671","cb82ffd8-252a-11e7-93ae-92361f002671"); + assertNotNull(foundCvnfcCustomization); + assertTrue(foundCvnfcCustomization.size() > 0); + CvnfcCustomization found = foundCvnfcCustomization.get(0); + + CvnfcCustomization templateCvnfcCustomization = new CvnfcCustomization(); + BeanUtils.copyProperties(found, templateCvnfcCustomization, "vnfVfmoduleCvnfcConfigurationCustomization"); + + assertThat(cvnfcCustomization, sameBeanAs(templateCvnfcCustomization) + .ignoring("id") + .ignoring("created") + .ignoring("vnfVfmoduleCvnfcConfigurationCustomization") + .ignoring("vnfResourceCusteModelCustomizationUUID")); + } + + @Test + public void getLinkedVnfVfmoduleCvnfcConfigurationCustomizationTest() { + + CvnfcCustomization cvnfcCustomization = setUpCvnfcCustomization("0c042562-2bac-11e9-b210-d663bd873d93"); + + VnfcCustomization vnfcCustomization = setUpVnfcCustomization(); + vnfcCustomization.setModelCustomizationUUID("d95d704a-9ff2-11e8-98d0-529269fb1459"); + cvnfcCustomization.setVnfcCustomization(vnfcCustomization); + + ConfigurationResource configurationResource = new ConfigurationResource(); + configurationResource.setToscaNodeType("FabricConfiguration"); + configurationResource.setModelInvariantUUID("modelInvariantUUID"); + configurationResource.setModelUUID("modelUUID"); + configurationResource.setModelName("modelName"); + configurationResource.setModelVersion("modelVersion"); + configurationResource.setDescription("description"); + configurationResource.setToscaNodeType("toscaNodeTypeFC"); + + VnfResource vnfResource = new VnfResource(); + vnfResource.setModelUUID("6f19c5fa-2b19-11e9-b210-d663bd873d93"); + vnfResource.setModelVersion("modelVersion"); + vnfResource.setOrchestrationMode("orchestrationMode"); + + VfModule vfModule = new VfModule(); + vfModule.setModelUUID("98aa2a6e-2b18-11e9-b210-d663bd873d93"); + vfModule.setModelInvariantUUID("9fe57860-2b18-11e9-b210-d663bd873d93"); + vfModule.setIsBase(true); + vfModule.setModelName("modelName"); + vfModule.setModelVersion("modelVersion"); + vfModule.setVnfResources(vnfResource); + + VfModuleCustomization vfModuleCustomization = new VfModuleCustomization(); + vfModuleCustomization.setModelCustomizationUUID("bdbf984a-2b16-11e9-b210-d663bd873d93"); + vfModuleCustomization.setVfModule(vfModule); + cvnfcCustomization.setVfModuleCustomization(vfModuleCustomization); + + VnfResourceCustomization vnfResourceCustomization = new VnfResourceCustomization(); + vnfResourceCustomization.setModelCustomizationUUID("6912dd02-2b16-11e9-b210-d663bd873d93"); + vnfResourceCustomization.setModelInstanceName("testModelInstanceName"); + vnfResourceCustomization.setVnfResources(vnfResource); + cvnfcCustomization.setVnfResourceCustomization(vnfResourceCustomization); + + VnfVfmoduleCvnfcConfigurationCustomization vnfVfmoduleCvnfcConfigurationCustomization = new VnfVfmoduleCvnfcConfigurationCustomization(); + vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationFunction("configurationFunction"); + vnfVfmoduleCvnfcConfigurationCustomization.setModelCustomizationUUID("64627fec-2b1b-11e9-b210-d663bd873d93"); + vnfVfmoduleCvnfcConfigurationCustomization.setConfigurationResource(configurationResource); + vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization); + vnfVfmoduleCvnfcConfigurationCustomization.setModelInstanceName("modelInstanceName"); + vnfVfmoduleCvnfcConfigurationCustomization.setVfModuleCustomization(vfModuleCustomization); + vnfVfmoduleCvnfcConfigurationCustomization.setVnfResourceCustomization(vnfResourceCustomization); + + Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizationSet = new HashSet<VnfVfmoduleCvnfcConfigurationCustomization>(); + vnfVfmoduleCvnfcConfigurationCustomizationSet.add(vnfVfmoduleCvnfcConfigurationCustomization); + cvnfcCustomization.setVnfVfmoduleCvnfcConfigurationCustomization(vnfVfmoduleCvnfcConfigurationCustomizationSet); + + vnfVfmoduleCvnfcConfigurationCustomization.setCvnfcCustomization(cvnfcCustomization); + + cvnfcCustomizationRepository.save(cvnfcCustomization); + + List<CvnfcCustomization> foundCvnfcCustomization = client.getCvnfcCustomizationByVnfCustomizationUUIDAndVfModuleCustomizationUUID("6912dd02-2b16-11e9-b210-d663bd873d93","bdbf984a-2b16-11e9-b210-d663bd873d93"); + assertNotNull(foundCvnfcCustomization); + assertTrue(foundCvnfcCustomization.size() > 0); + CvnfcCustomization found = foundCvnfcCustomization.get(0); + + Set<VnfVfmoduleCvnfcConfigurationCustomization> vnfVfmoduleCvnfcConfigurationCustomizations = found.getVnfVfmoduleCvnfcConfigurationCustomization(); + if (vnfVfmoduleCvnfcConfigurationCustomizations.size() > 0){ + for(VnfVfmoduleCvnfcConfigurationCustomization customization : vnfVfmoduleCvnfcConfigurationCustomizations) { + Assert.assertTrue(customization.getConfigurationResource().getToscaNodeType().equalsIgnoreCase("toscaNodeTypeFC")); + } + } else { + Assert.fail("No linked VnfVfmoduleCvnfcConfigurationCustomization found for CvnfcCustomization"); + } + } + + protected CvnfcCustomization setUpCvnfcCustomization(String id){ + CvnfcCustomization cvnfcCustomization = new CvnfcCustomization(); + cvnfcCustomization.setModelCustomizationUUID(id); + cvnfcCustomization.setModelInstanceName("testModelInstanceName"); + cvnfcCustomization.setModelUUID("b25735fe-9b37-11e8-98d0-529269fb1459"); + cvnfcCustomization.setModelInvariantUUID("ba7e6ef0-9b37-11e8-98d0-529269fb1459"); + cvnfcCustomization.setModelVersion("testModelVersion"); + cvnfcCustomization.setModelName("testModelName"); + cvnfcCustomization.setToscaNodeType("testToscaNodeType"); + cvnfcCustomization.setDescription("testCvnfcCustomzationDescription"); + cvnfcCustomization.setNfcFunction("testNfcFunction"); + cvnfcCustomization.setNfcNamingCode("testNfcNamingCode"); + return cvnfcCustomization; + } + + protected VnfcCustomization setUpVnfcCustomization(){ + VnfcCustomization vnfcCustomization = new VnfcCustomization(); + vnfcCustomization.setModelInstanceName("testVnfcCustomizationModelInstanceName"); + vnfcCustomization.setModelUUID("321228a4-9f15-11e8-98d0-529269fb1459"); + vnfcCustomization.setModelInvariantUUID("c0659136-9f15-11e8-98d0-529269fb1459"); + vnfcCustomization.setModelVersion("testModelVersion"); + vnfcCustomization.setModelName("testModelName"); + vnfcCustomization.setToscaNodeType("testToscaModelType"); + vnfcCustomization.setDescription("testVnfcCustomizationDescription"); + return vnfcCustomization; + } +} diff --git a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql index 3e92b5d7ba..1223080e59 100644 --- a/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql +++ b/adapters/mso-catalog-db-adapter/src/test/resources/db/migration/afterMigrate.sql @@ -241,3 +241,55 @@ INSERT INTO northbound_request_ref_lookup(MACRO_ACTION, ACTION, REQUEST_SCOPE, I INSERT INTO orchestration_flow_reference(COMPOSITE_ACTION, SEQ_NO, FLOW_NAME, FLOW_VERSION, NB_REQ_REF_LOOKUP_ID) VALUES ('Service-Create', '1', 'AssignServiceInstanceBB', 1.0,(SELECT id from northbound_request_ref_lookup WHERE MACRO_ACTION = 'Service-Create' and CLOUD_OWNER = 'my-custom-cloud-owner' and SERVICE_TYPE = 'TRANSPORT')); + +INSERT INTO `vnfc_customization` + (`model_customization_uuid`, + `model_instance_name`, + `model_uuid`, + `model_invariant_uuid`, + `model_version`, + `model_name`, + `tosca_node_type`, + `description`, + `creation_timestamp`) +VALUES ( '9bcce658-9b37-11e8-98d0-529269fb1459', + 'testModelInstanceName', + 'b25735fe-9b37-11e8-98d0-529269fb1459', + 'ba7e6ef0-9b37-11e8-98d0-529269fb1459', + 'testModelVersion', + 'testModelName', + 'toscaNodeType', + 'testVnfcCustomizationDescription', + '2018-07-17 14:05:08'); + +INSERT INTO `cvnfc_customization` + (`id`, + `model_customization_uuid`, + `model_instance_name`, + `model_uuid`, + `model_invariant_uuid`, + `model_version`, + `model_name`, + `tosca_node_type`, + `description`, + `nfc_function`, + `nfc_naming_code`, + `creation_timestamp`, + `vnf_resource_cust_model_customization_uuid`, + `vf_module_cust_model_customization_uuid`, + `vnfc_cust_model_customization_uuid`) +VALUES ( '1', + 'dadc2c8c-2bab-11e9-b210-d663bd873d93', + 'testModelInstanceName', + 'b25735fe-9b37-11e8-98d0-529269fb1459', + 'ba7e6ef0-9b37-11e8-98d0-529269fb1459', + 'testModelVersion', + 'testModelName', + 'testToscaNodeType', + 'testCvnfcCustomzationDescription', + 'testNfcFunction', + 'testNfcNamingCode', + '2018-07-17 14:05:08', + '68dc9a92-214c-11e7-93ae-92361f002671', + 'cb82ffd8-252a-11e7-93ae-92361f002671', + '9bcce658-9b37-11e8-98d0-529269fb1459'); diff --git a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java index 7bba136da2..dfe5912fbf 100644 --- a/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java +++ b/adapters/mso-openstack-adapters/src/main/java/org/onap/so/adapters/audit/HeatStackAudit.java @@ -25,6 +25,8 @@ import java.util.HashSet; import java.util.List; import java.util.Optional; import java.util.Set; +import java.util.regex.Matcher; +import java.util.regex.Pattern; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -162,7 +164,8 @@ public class HeatStackAudit { auditVserver.setLInterfaces(new LInterfaces()); auditVserver.setVserverId(novaResource.getPhysicalResourceId()); Stream<Resource> filteredNeutronNetworks = resources.getList().stream() - .filter(network -> network.getRequiredBy().contains(novaResource.getLogicalResourceId())); + .filter(resource -> resource.getRequiredBy().contains(novaResource.getLogicalResourceId())) + .filter(resource -> "OS::Neutron::Port".equals(resource.getType())); filteredNeutronNetworks.forEach(network -> { LInterface lInterface = new LInterface(); lInterface.setInterfaceId(network.getPhysicalResourceId()); @@ -173,11 +176,13 @@ public class HeatStackAudit { return vserversToAudit; } - protected Optional<String> extractResourcePathFromHref(String href) { - URI uri; + protected Optional<String> extractResourcePathFromHref(String href) { try { - uri = new URI(href); - return Optional.of(uri.getPath().replaceFirst("/v\\d+", "")+RESOURCES); + Optional<String> stackPath = extractStackPathFromHref(href); + if (stackPath.isPresent()){ + return Optional.of(stackPath.get()+RESOURCES); + }else + return Optional.empty(); } catch (Exception e) { logger.error("Error parsing URI", e); } @@ -185,10 +190,14 @@ public class HeatStackAudit { } protected Optional<String> extractStackPathFromHref(String href) { - URI uri; try { - uri = new URI(href); - return Optional.of(uri.getPath().replaceFirst("/v\\d+", "")); + URI uri = new URI(href); + Pattern p = Pattern.compile("/stacks.*"); + Matcher m = p.matcher(uri.getPath()); + if (m.find()){ + return Optional.of(m.group()); + }else + return Optional.empty(); } catch (Exception e) { logger.error("Error parsing URI", e); } diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java index 11e54404f4..02557d8c20 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/AuditVServerTest.java @@ -79,7 +79,7 @@ public class AuditVServerTest extends AuditVServer { private AAIResourceUri ssc_1_trusted_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db").queryParam("interface-id", "dec8bdc7-5718-41dc-bfbb-561ff6eeb81c"); - private AAIResourceUri ssc_1_avpn_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, + private AAIResourceUri ssc_1_service1_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db").queryParam("interface-id", "1c56a24b-5f03-435a-850d-31cd4252de56"); private AAIResourceUri ssc_1_mgmt_port_1_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, @@ -88,7 +88,7 @@ public class AuditVServerTest extends AuditVServer { private AAIResourceUri ssc_1_mgmt_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db").queryParam("interface-id", "80baec42-ffae-425f-ad8c-3f7b2c24bfff"); - private AAIResourceUri ssc_1_mis_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, + private AAIResourceUri ssc_1_service2_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db").queryParam("interface-id", "13eddf95-4cf3-45f2-823a-2d890a6549b4"); private AAIResourceUri ssc_1_int_ha_port_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.L_INTERFACE, @@ -103,13 +103,13 @@ public class AuditVServerTest extends AuditVServer { - private AAIResourceUri mis_sub_1_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SUB_L_INTERFACE, + private AAIResourceUri service2_sub_1_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SUB_L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db","interface-name").queryParam("interface-id", "f711be16-2654-4a09-b89d-0511fda20e81"); - private AAIResourceUri avpn_sub_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SUB_L_INTERFACE, + private AAIResourceUri service1_sub_0_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SUB_L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db","interface-name").queryParam("interface-id", "0d9cd813-2ae1-46c0-9ebb-48081f6cffbb"); - private AAIResourceUri avpn_sub_1_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SUB_L_INTERFACE, + private AAIResourceUri service1_sub_1_uri = AAIUriFactory.createResourceUri(AAIObjectPlurals.SUB_L_INTERFACE, cloudOwner, cloudRegion, tenantId, "3a4c2ca5-27b3-4ecc-98c5-06804867c4db","interface-name").queryParam("interface-id", "b7019dd0-2ee9-4447-bdef-ac25676b205a"); @@ -120,25 +120,25 @@ public class AuditVServerTest extends AuditVServer { LInterface test_port_1 = new LInterface(); LInterface test_port_2 = new LInterface(); LInterface ssc_1_int_ha_port_0 = new LInterface(); - LInterface mis_sub_interface_1 = new LInterface(); - LInterface ssc_1_mis_port_0 = new LInterface(); + LInterface service2_sub_interface_1 = new LInterface(); + LInterface ssc_1_service2_port_0 = new LInterface(); LInterface ssc_1_mgmt_port_0 = new LInterface(); LInterface ssc_1_mgmt_port_1 = new LInterface(); - LInterface avpn_sub_interface_2 = new LInterface(); - LInterface avpn_sub_interface_1 = new LInterface(); - LInterface ssc_1_avpn_port_0 = new LInterface(); + LInterface service1_sub_interface_2 = new LInterface(); + LInterface service1_sub_interface_1 = new LInterface(); + LInterface ssc_1_service1_port_0 = new LInterface(); LInterface ssc_1_trusted_port_0 = new LInterface(); LInterfaces test_port_1_plural = new LInterfaces(); LInterfaces test_port_2_plural = new LInterfaces(); LInterfaces ssc_1_int_ha_port_0_plural = new LInterfaces(); - LInterfaces mis_sub_interface_1_plural = new LInterfaces(); - LInterfaces ssc_1_mis_port_0_plural = new LInterfaces(); + LInterfaces service2_sub_interface_1_plural = new LInterfaces(); + LInterfaces ssc_1_service2_port_0_plural = new LInterfaces(); LInterfaces ssc_1_mgmt_port_0_plural = new LInterfaces(); LInterfaces ssc_1_mgmt_port_1_plural = new LInterfaces(); - LInterfaces avpn_sub_interface_2_plural = new LInterfaces(); - LInterfaces avpn_sub_interface_1_plural = new LInterfaces(); - LInterfaces ssc_1_avpn_port_0_plural = new LInterfaces(); + LInterfaces service1_sub_interface_2_plural = new LInterfaces(); + LInterfaces service1_sub_interface_1_plural = new LInterfaces(); + LInterfaces ssc_1_service1_port_0_plural = new LInterfaces(); LInterfaces ssc_1_trusted_port_0_plural = new LInterfaces(); @@ -156,18 +156,18 @@ public class AuditVServerTest extends AuditVServer { vServer1.getLInterfaces().getLInterface().add(ssc_1_trusted_port_0); - ssc_1_avpn_port_0.setInterfaceId("1c56a24b-5f03-435a-850d-31cd4252de56"); - ssc_1_avpn_port_0.setInterfaceName("interface-name"); - vServer1.getLInterfaces().getLInterface().add(ssc_1_avpn_port_0); - ssc_1_avpn_port_0.setLInterfaces(new LInterfaces()); + ssc_1_service1_port_0.setInterfaceId("1c56a24b-5f03-435a-850d-31cd4252de56"); + ssc_1_service1_port_0.setInterfaceName("interface-name"); + vServer1.getLInterfaces().getLInterface().add(ssc_1_service1_port_0); + ssc_1_service1_port_0.setLInterfaces(new LInterfaces()); - avpn_sub_interface_1.setInterfaceId("0d9cd813-2ae1-46c0-9ebb-48081f6cffbb"); - ssc_1_avpn_port_0.getLInterfaces().getLInterface().add(avpn_sub_interface_1); + service1_sub_interface_1.setInterfaceId("0d9cd813-2ae1-46c0-9ebb-48081f6cffbb"); + ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_1); - avpn_sub_interface_2.setInterfaceId("b7019dd0-2ee9-4447-bdef-ac25676b205a"); - ssc_1_avpn_port_0.getLInterfaces().getLInterface().add(avpn_sub_interface_2); + service1_sub_interface_2.setInterfaceId("b7019dd0-2ee9-4447-bdef-ac25676b205a"); + ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_2); ssc_1_mgmt_port_1.setInterfaceId("12afcd28-929f-4d80-8a5a-0833bfd5e20b"); @@ -179,14 +179,14 @@ public class AuditVServerTest extends AuditVServer { vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_0); - ssc_1_mis_port_0.setLInterfaces(new LInterfaces()); - ssc_1_mis_port_0.setInterfaceId("13eddf95-4cf3-45f2-823a-2d890a6549b4"); - ssc_1_mis_port_0.setInterfaceName("interface-name"); - vServer1.getLInterfaces().getLInterface().add(ssc_1_mis_port_0); + ssc_1_service2_port_0.setLInterfaces(new LInterfaces()); + ssc_1_service2_port_0.setInterfaceId("13eddf95-4cf3-45f2-823a-2d890a6549b4"); + ssc_1_service2_port_0.setInterfaceName("interface-name"); + vServer1.getLInterfaces().getLInterface().add(ssc_1_service2_port_0); - mis_sub_interface_1.setInterfaceId("f711be16-2654-4a09-b89d-0511fda20e81"); - ssc_1_mis_port_0.getLInterfaces().getLInterface().add(mis_sub_interface_1); + service2_sub_interface_1.setInterfaceId("f711be16-2654-4a09-b89d-0511fda20e81"); + ssc_1_service2_port_0.getLInterfaces().getLInterface().add(service2_sub_interface_1); ssc_1_int_ha_port_0.setInterfaceId("9cab2903-70f7-44fd-b681-491d6ae2adb8"); @@ -215,10 +215,10 @@ public class AuditVServerTest extends AuditVServer { test_port_1_plural.getLInterface().add(test_port_1); test_port_2_plural.getLInterface().add(test_port_2); ssc_1_int_ha_port_0_plural.getLInterface().add(ssc_1_int_ha_port_0); - ssc_1_mis_port_0_plural.getLInterface().add(ssc_1_mis_port_0); + ssc_1_service2_port_0_plural.getLInterface().add(ssc_1_service2_port_0); ssc_1_mgmt_port_0_plural.getLInterface().add(ssc_1_mgmt_port_0); ssc_1_mgmt_port_1_plural.getLInterface().add(ssc_1_mgmt_port_1); - ssc_1_avpn_port_0_plural.getLInterface().add(ssc_1_avpn_port_0); + ssc_1_service1_port_0_plural.getLInterface().add(ssc_1_service1_port_0); ssc_1_trusted_port_0_plural.getLInterface().add(ssc_1_trusted_port_0); } @@ -234,17 +234,17 @@ public class AuditVServerTest extends AuditVServer { doReturn(true).when(aaiResourcesMock).exists(vserverURI); doReturn(true).when(aaiResourcesMock).exists(vserverURI2); doReturn(Optional.of(ssc_1_trusted_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_trusted_port_0_uri); - doReturn(Optional.of(ssc_1_avpn_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_avpn_port_0_uri); + doReturn(Optional.of(ssc_1_service1_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_service1_port_0_uri); doReturn(Optional.of(ssc_1_mgmt_port_1_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_mgmt_port_1_uri); doReturn(Optional.of(ssc_1_mgmt_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_mgmt_port_0_uri); - doReturn(Optional.of(ssc_1_mis_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_mis_port_0_uri); + doReturn(Optional.of(ssc_1_service2_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_service2_port_0_uri); doReturn(Optional.of(ssc_1_int_ha_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_int_ha_port_0_uri); doReturn(Optional.of(test_port_1_plural)).when(aaiResourcesMock).get(LInterfaces.class,test_port_1_uri); doReturn(Optional.of(test_port_2_plural)).when(aaiResourcesMock).get(LInterfaces.class,test_port_2_uri); - doReturn(true).when(aaiResourcesMock).exists(mis_sub_1_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_0_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri); boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion); assertEquals(true, exists); @@ -256,17 +256,17 @@ public class AuditVServerTest extends AuditVServer { doReturn(true).when(aaiResourcesMock).exists(vserverURI); doReturn(true).when(aaiResourcesMock).exists(vserverURI2); doReturn(Optional.of(ssc_1_trusted_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_trusted_port_0_uri); - doReturn(Optional.of(ssc_1_avpn_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_avpn_port_0_uri); + doReturn(Optional.of(ssc_1_service1_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_service1_port_0_uri); doReturn(Optional.of(ssc_1_mgmt_port_1_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_mgmt_port_1_uri); doReturn(Optional.empty()).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_mgmt_port_0_uri); - doReturn(Optional.of(ssc_1_mis_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_mis_port_0_uri); + doReturn(Optional.of(ssc_1_service2_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_service2_port_0_uri); doReturn(Optional.of(ssc_1_int_ha_port_0_plural)).when(aaiResourcesMock).get(LInterfaces.class,ssc_1_int_ha_port_0_uri); doReturn(Optional.of(test_port_1_plural)).when(aaiResourcesMock).get(LInterfaces.class,test_port_1_uri); doReturn(Optional.of(test_port_2_plural)).when(aaiResourcesMock).get(LInterfaces.class,test_port_2_uri); - doReturn(true).when(aaiResourcesMock).exists(mis_sub_1_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_0_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri); boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion); assertEquals(false, exists); @@ -278,16 +278,16 @@ public class AuditVServerTest extends AuditVServer { doReturn(true).when(aaiResourcesMock).exists(vserverURI); doReturn(true).when(aaiResourcesMock).exists(vserverURI2); doReturn(Optional.of(ssc_1_trusted_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_trusted_port_0_uri); - doReturn(Optional.of(ssc_1_avpn_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_avpn_port_0_uri); + doReturn(Optional.of(ssc_1_service1_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_service1_port_0_uri); doReturn(Optional.of(ssc_1_mgmt_port_1_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_mgmt_port_1_uri); doReturn(Optional.of(ssc_1_mgmt_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_mgmt_port_0_uri); - doReturn(Optional.of(ssc_1_mis_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_mis_port_0_uri); + doReturn(Optional.of(ssc_1_service2_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_service2_port_0_uri); doReturn(Optional.of(ssc_1_int_ha_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_int_ha_port_0_uri); doReturn(Optional.of(test_port_1_plural)).when(aaiResourcesMock).get(LInterface.class,test_port_1_uri); doReturn(Optional.empty()).when(aaiResourcesMock).get(LInterface.class,test_port_2_uri); - doReturn(true).when(aaiResourcesMock).exists(mis_sub_1_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_0_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri); boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion); assertEquals(false, exists); } @@ -314,16 +314,16 @@ public class AuditVServerTest extends AuditVServer { public void audit_Vserver_Second_Not_Found_Test() throws JsonParseException, JsonMappingException, IOException { doReturn(true).when(aaiResourcesMock).exists(vserverURI); doReturn(Optional.of(ssc_1_trusted_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_trusted_port_0_uri); - doReturn(Optional.of(ssc_1_avpn_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_avpn_port_0_uri); + doReturn(Optional.of(ssc_1_service1_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_service1_port_0_uri); doReturn(Optional.of(ssc_1_mgmt_port_1_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_mgmt_port_1_uri); doReturn(Optional.of(ssc_1_mgmt_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_mgmt_port_0_uri); - doReturn(Optional.of(ssc_1_mis_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_mis_port_0_uri); + doReturn(Optional.of(ssc_1_service2_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_service2_port_0_uri); doReturn(Optional.of(ssc_1_int_ha_port_0_plural)).when(aaiResourcesMock).get(LInterface.class,ssc_1_int_ha_port_0_uri); doReturn(Optional.of(test_port_1_plural)).when(aaiResourcesMock).get(LInterface.class,test_port_1_uri); doReturn(Optional.of(test_port_2_plural)).when(aaiResourcesMock).get(LInterface.class,test_port_2_uri); - doReturn(true).when(aaiResourcesMock).exists(mis_sub_1_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_0_uri); - doReturn(true).when(aaiResourcesMock).exists(avpn_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service2_sub_1_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_0_uri); + doReturn(true).when(aaiResourcesMock).exists(service1_sub_1_uri); doReturn(false).when(aaiResourcesMock).exists(vserverURI2); boolean exists = auditNova.auditVservers(vserversToAudit, tenantId, cloudOwner, cloudRegion); assertEquals(false, exists); diff --git a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java index 5df5d8200f..b3cdd467bb 100644 --- a/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java +++ b/adapters/mso-openstack-adapters/src/test/java/org/onap/so/adapters/audit/HeatStackAuditTest.java @@ -80,19 +80,19 @@ public class HeatStackAuditTest extends HeatStackAudit { @Test public void extract_proper_path_Test(){ - Optional<String> actualResult = extractStackPathFromHref("https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81"); - assertEquals("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81", actualResult.get()); + Optional<String> actualResult = extractStackPathFromHref("https://orchestration.com:8004/v1/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81"); + assertEquals("/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81", actualResult.get()); } @Test public void extract_proper_resources_path_Test(){ - Optional<String> actualResult = extractResourcePathFromHref("https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81"); - assertEquals("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81/resources", actualResult.get()); + Optional<String> actualResult = extractResourcePathFromHref("https://orchestration.com:8004/v1/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81"); + assertEquals("/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81/resources", actualResult.get()); } @Test public void extract_invalid_uri_Test(){ - Optional<String> actualResult = extractStackPathFromHref("orchestrn.com:8004/v18b44d60a6f94bdcb2738f9e/stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81"); + Optional<String> actualResult = extractStackPathFromHref("orchestrn.com:8004/v18b44d60a6f94bdcb2738f9e//stacks/test_stack/f711be16-2654-4a09-b89d-0511fda20e81"); assertEquals(false, actualResult.isPresent()); } @@ -124,67 +124,68 @@ public class HeatStackAuditTest extends HeatStackAudit { ssc_1_mgmt_port_0.setInterfaceId("8d93f63e-e972-48c7-ad98-b2122da47315"); vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_0); - LInterface ssc_1_mis_port_0 = new LInterface(); - ssc_1_mis_port_0.setLInterfaces(new LInterfaces()); - ssc_1_mis_port_0.setInterfaceId("0594a2f2-7ea4-42eb-abc2-48ea49677fca"); - vServer1.getLInterfaces().getLInterface().add(ssc_1_mis_port_0); + LInterface ssc_1_service2_port_0 = new LInterface(); + ssc_1_service2_port_0.setLInterfaces(new LInterfaces()); + ssc_1_service2_port_0.setInterfaceId("0594a2f2-7ea4-42eb-abc2-48ea49677fca"); + vServer1.getLInterfaces().getLInterface().add(ssc_1_service2_port_0); - LInterface mis_sub_interface_1 = new LInterface(); - mis_sub_interface_1.setInterfaceId("2bbfa345-33bb-495a-94b2-fb514ee1cffc"); - ssc_1_mis_port_0.getLInterfaces().getLInterface().add(mis_sub_interface_1); + LInterface service2_sub_interface_1 = new LInterface(); + service2_sub_interface_1.setInterfaceId("2bbfa345-33bb-495a-94b2-fb514ee1cffc"); + ssc_1_service2_port_0.getLInterfaces().getLInterface().add(service2_sub_interface_1); LInterface ssc_1_int_ha_port_0 = new LInterface(); ssc_1_int_ha_port_0.setInterfaceId("00bb8407-650e-48b5-b919-33b88d6f8fe3"); vServer1.getLInterfaces().getLInterface().add(ssc_1_int_ha_port_0); - LInterface ssc_1_avpn_port_0 = new LInterface(); - ssc_1_avpn_port_0.setInterfaceId("27391d94-33af-474a-927d-d409249e8fd3"); - vServer1.getLInterfaces().getLInterface().add(ssc_1_avpn_port_0); - ssc_1_avpn_port_0.setLInterfaces(new LInterfaces()); + LInterface ssc_1_service1_port_0 = new LInterface(); + ssc_1_service1_port_0.setInterfaceId("27391d94-33af-474a-927d-d409249e8fd3"); + vServer1.getLInterfaces().getLInterface().add(ssc_1_service1_port_0); + ssc_1_service1_port_0.setLInterfaces(new LInterfaces()); - LInterface avpn_sub_interface_0 = new LInterface(); - avpn_sub_interface_0.setInterfaceId("d54dfd09-75c6-4e04-b204-909455b8f933"); - ssc_1_avpn_port_0.getLInterfaces().getLInterface().add(avpn_sub_interface_0); + LInterface service1_sub_interface_0 = new LInterface(); + service1_sub_interface_0.setInterfaceId("d54dfd09-75c6-4e04-b204-909455b8f933"); + ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_0); - LInterface avpn_sub_interface_1 = new LInterface(); - avpn_sub_interface_1.setInterfaceId("f7a998c0-8939-4b07-bf4a-0862e9c325e1"); - ssc_1_avpn_port_0.getLInterfaces().getLInterface().add(avpn_sub_interface_1); + LInterface service1_sub_interface_1 = new LInterface(); + service1_sub_interface_1.setInterfaceId("f7a998c0-8939-4b07-bf4a-0862e9c325e1"); + ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_1); - LInterface avpn_sub_interface_2 = new LInterface(); - avpn_sub_interface_2.setInterfaceId("621c1fea-60b8-44ee-aede-c01b8b1aaa70"); - ssc_1_avpn_port_0.getLInterfaces().getLInterface().add(avpn_sub_interface_2); + LInterface service1_sub_interface_2 = new LInterface(); + service1_sub_interface_2.setInterfaceId("621c1fea-60b8-44ee-aede-c01b8b1aaa70"); + ssc_1_service1_port_0.getLInterfaces().getLInterface().add(service1_sub_interface_2); expectedVservers.add(vServer1); - Resources avpnQueryResponse = objectMapper.readValue(new File("src/test/resources/AVPNResourceGroupResponse.json"), Resources.class); - doReturn(avpnQueryResponse).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources", cloudRegion, tenantId, Resources.class); - Resources misQueryResponse =objectMapper.readValue(new File("src/test/resources/MISResourceGroupResponse.json"), Resources.class); - doReturn(misQueryResponse).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources", cloudRegion, tenantId, Resources.class); + Resources service1QueryResponse = objectMapper.readValue(new File("src/test/resources/Service1ResourceGroupResponse.json"), Resources.class); + doReturn(service1QueryResponse).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources", cloudRegion, tenantId, Resources.class); + Resources service2QueryResponse =objectMapper.readValue(new File("src/test/resources/Service2ResourceGroupResponse.json"), Resources.class); + doReturn(service2QueryResponse).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources", cloudRegion, tenantId, Resources.class); - Stack misStackQuerySubInt = stackObjectMapper.readValue(new File("src/test/resources/MISSubInterface0.json"), Stack.class); - doReturn(misStackQuerySubInt).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", cloudRegion,tenantId, Stack.class); - Resources misResourceQuerySubInt = objectMapper.readValue(new File("src/test/resources/MISSubInterface1Resources.json"), Resources.class); - doReturn(misResourceQuerySubInt).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources", cloudRegion,tenantId, Resources.class); - Stack avpnStackQuerySubInt1 =stackObjectMapper.readValue(new File("src/test/resources/AVPNSubInterface0.json"), Stack.class); - doReturn(avpnStackQuerySubInt1).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", cloudRegion,tenantId, Stack.class); - Resources avpnResourceQuerySubInt1 = objectMapper.readValue(new File("src/test/resources/AVPNSubInterface0Resources.json"), Resources.class); - doReturn(avpnResourceQuerySubInt1).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb/resources", cloudRegion,tenantId, Resources.class); + Stack service2StackQuerySubInt = stackObjectMapper.readValue(new File("src/test/resources/Service2SubInterface0.json"), Stack.class); + doReturn(service2StackQuerySubInt).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", cloudRegion,tenantId, Stack.class); + Resources service2ResourceQuerySubInt = objectMapper.readValue(new File("src/test/resources/Service2SubInterface1Resources.json"), Resources.class); + doReturn(service2ResourceQuerySubInt).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources", cloudRegion,tenantId, Resources.class); + + Stack service1StackQuerySubInt1 =stackObjectMapper.readValue(new File("src/test/resources/Service1SubInterface0.json"), Stack.class); + doReturn(service1StackQuerySubInt1).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", cloudRegion,tenantId, Stack.class); + Resources service1ResourceQuerySubInt1 = objectMapper.readValue(new File("src/test/resources/Service1SubInterface0Resources.json"), Resources.class); + doReturn(service1ResourceQuerySubInt1).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb/resources", cloudRegion,tenantId, Resources.class); - Stack avpnStackQuerySubInt2 =stackObjectMapper.readValue(new File("src/test/resources/AVPNSubInterface1.json"), Stack.class); - doReturn(avpnStackQuerySubInt2).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", cloudRegion,tenantId, Stack.class); - Resources avpnResourceQuerySubInt2 = objectMapper.readValue(new File("src/test/resources/AVPNSubInterface1Resources.json"), Resources.class); - doReturn(avpnResourceQuerySubInt2).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a/resources", cloudRegion,tenantId, Resources.class); - - Stack avpnStackQuerySubInt3 =stackObjectMapper.readValue(new File("src/test/resources/AVPNSubInterface2.json"), Stack.class); - doReturn(avpnStackQuerySubInt3).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", cloudRegion,tenantId, Stack.class); - Resources avpnResourceQuerySubInt3 = objectMapper.readValue(new File("src/test/resources/AVPNSubInterface2Resources.json"), Resources.class); - doReturn(avpnResourceQuerySubInt3).when(msoHeatUtilsMock).executeHeatClientRequest("/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c/resources", cloudRegion,tenantId, Resources.class); + Stack service1StackQuerySubInt2 =stackObjectMapper.readValue(new File("src/test/resources/Service1SubInterface1.json"), Stack.class); + doReturn(service1StackQuerySubInt2).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", cloudRegion,tenantId, Stack.class); + Resources service1ResourceQuerySubInt2 = objectMapper.readValue(new File("src/test/resources/Service1SubInterface1Resources.json"), Resources.class); + doReturn(service1ResourceQuerySubInt2).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a/resources", cloudRegion,tenantId, Resources.class); + + Stack service1StackQuerySubInt3 =stackObjectMapper.readValue(new File("src/test/resources/Service1SubInterface2.json"), Stack.class); + doReturn(service1StackQuerySubInt3).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", cloudRegion,tenantId, Stack.class); + Resources service1ResourceQuerySubInt3 = objectMapper.readValue(new File("src/test/resources/Service1SubInterface2Resources.json"), Resources.class); + doReturn(service1ResourceQuerySubInt3).when(msoHeatUtilsMock).executeHeatClientRequest("/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c/resources", cloudRegion,tenantId, Resources.class); Set<Vserver> vServersToAudit = heatStackAudit.createVserverSet(resources, novaResources); Set<Vserver> vserversWithSubInterfaces = heatStackAudit.processSubInterfaces(cloudRegion,tenantId,resourceGroups, vServersToAudit); @@ -210,9 +211,9 @@ public class HeatStackAuditTest extends HeatStackAudit { ssc_1_trusted_port_0.setInterfaceId("d2f51f82-0ec2-4581-bd1a-d2a82073e52b"); vServer1.getLInterfaces().getLInterface().add(ssc_1_trusted_port_0); - LInterface ssc_1_avpn_port_0 = new LInterface(); - ssc_1_avpn_port_0.setInterfaceId("27391d94-33af-474a-927d-d409249e8fd3"); - vServer1.getLInterfaces().getLInterface().add(ssc_1_avpn_port_0); + LInterface ssc_1_service1_port_0 = new LInterface(); + ssc_1_service1_port_0.setInterfaceId("27391d94-33af-474a-927d-d409249e8fd3"); + vServer1.getLInterfaces().getLInterface().add(ssc_1_service1_port_0); LInterface ssc_1_mgmt_port_1 = new LInterface(); ssc_1_mgmt_port_1.setInterfaceId("07f5b14c-147a-4d14-8c94-a9e94dbc097b"); @@ -222,9 +223,9 @@ public class HeatStackAuditTest extends HeatStackAudit { ssc_1_mgmt_port_0.setInterfaceId("8d93f63e-e972-48c7-ad98-b2122da47315"); vServer1.getLInterfaces().getLInterface().add(ssc_1_mgmt_port_0); - LInterface ssc_1_mis_port_0 = new LInterface(); - ssc_1_mis_port_0.setInterfaceId("0594a2f2-7ea4-42eb-abc2-48ea49677fca"); - vServer1.getLInterfaces().getLInterface().add(ssc_1_mis_port_0); + LInterface ssc_1_service2_port_0 = new LInterface(); + ssc_1_service2_port_0.setInterfaceId("0594a2f2-7ea4-42eb-abc2-48ea49677fca"); + vServer1.getLInterfaces().getLInterface().add(ssc_1_service2_port_0); LInterface ssc_1_int_ha_port_0 = new LInterface(); ssc_1_int_ha_port_0.setInterfaceId("00bb8407-650e-48b5-b919-33b88d6f8fe3"); diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNResourceGroupResponse.json b/adapters/mso-openstack-adapters/src/test/resources/AVPNResourceGroupResponse.json deleted file mode 100644 index 27f971b698..0000000000 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNResourceGroupResponse.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "resources": [ - { - "parent_resource": "ssc_1_subint_avpn_port_0_subinterfaces", - "resource_name": "1", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/1", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", - "rel": "stack" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", - "rel": "nested" - } - ], - "logical_resource_id": "1", - "resource_status_reason": "state changed", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [], - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", - "resource_type": "vlan_subinterface_ssc_avpn.yaml" - }, - { - "parent_resource": "ssc_1_subint_avpn_port_0_subinterfaces", - "resource_name": "0", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/0", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", - "rel": "stack" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", - "rel": "nested" - } - ], - "logical_resource_id": "0", - "resource_status_reason": "state changed", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [], - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a", - "resource_type": "vlan_subinterface_ssc_avpn.yaml" - }, - { - "parent_resource": "ssc_1_subint_avpn_port_0_subinterfaces", - "resource_name": "2", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/2", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", - "rel": "stack" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", - "rel": "nested" - } - ], - "logical_resource_id": "2", - "resource_status_reason": "state changed", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [], - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "bd0fc728-cbde-4301-a581-db56f494675c", - "resource_type": "vlan_subinterface_ssc_avpn.yaml" - } - ] -}
\ No newline at end of file diff --git a/adapters/mso-openstack-adapters/src/test/resources/GetResources.json b/adapters/mso-openstack-adapters/src/test/resources/GetResources.json index 33e282caa7..22e66d41bb 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/GetResources.json +++ b/adapters/mso-openstack-adapters/src/test/resources/GetResources.json @@ -1,14 +1,36 @@ { "resources": [ + { + "links": [ + { + "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732/resources/vlbagent_eph_aff_id", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/99cecb7b19dc4690960761abd0fe2413/stacks/zdyh3brlba05_addon/03840be2-7ce6-4e38-a748-dbd59a798732", + "rel": "stack" + } + ], + "logical_resource_id": "vlbagent_eph_aff_id", + "physical_resource_id": "zdyh3brlba05_addon-vlbagent_eph_aff_id-euhxoicxsgso", + "required_by": [ + "ssc_server_1" + ], + "resource_name": "vlbagent_eph_aff_id", + "resource_status": "CREATE_COMPLETE", + "resource_status_reason": "state changed", + "resource_type": "OS::Heat::RandomString", + "updated_time": "2019-02-07T22:56:12Z" + }, { "resource_name": "ssc_1_trusted_port_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_trusted_port_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_trusted_port_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], @@ -23,22 +45,22 @@ "resource_type": "OS::Neutron::Port" }, { - "resource_name": "ssc_1_avpn_port_0", + "resource_name": "ssc_1_service1_port_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_avpn_port_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_service1_port_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], - "logical_resource_id": "ssc_1_avpn_port_0", + "logical_resource_id": "ssc_1_service1_port_0", "resource_status": "CREATE_COMPLETE", "updated_time": "2019-01-23T19:34:15Z", "required_by": [ - "ssc_1_subint_avpn_port_0_subinterfaces", + "ssc_1_subint_service1_port_0_subinterfaces", "ssc_server_1" ], "resource_status_reason": "state changed", @@ -46,22 +68,22 @@ "resource_type": "OS::Neutron::Port" }, { - "resource_name": "ssc_1_subint_mis_port_0_subinterfaces", + "resource_name": "ssc_1_subint_service2_port_0_subinterfaces", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_mis_port_0_subinterfaces", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_service2_port_0_subinterfaces", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c", "rel": "nested" } ], - "logical_resource_id": "ssc_1_subint_mis_port_0_subinterfaces", + "logical_resource_id": "ssc_1_subint_service2_port_0_subinterfaces", "resource_status": "CREATE_COMPLETE", "updated_time": "2019-01-23T19:34:15Z", "required_by": [], @@ -73,11 +95,11 @@ "resource_name": "ssc_1_mgmt_port_1", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_1", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_1", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], @@ -95,11 +117,11 @@ "resource_name": "ssc_1_mgmt_port_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mgmt_port_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], @@ -114,22 +136,22 @@ "resource_type": "OS::Neutron::Port" }, { - "resource_name": "ssc_1_mis_port_0", + "resource_name": "ssc_1_service2_port_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_mis_port_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_service2_port_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], - "logical_resource_id": "ssc_1_mis_port_0", + "logical_resource_id": "ssc_1_service2_port_0", "resource_status": "CREATE_COMPLETE", "updated_time": "2019-01-23T19:34:15Z", "required_by": [ - "ssc_1_subint_mis_port_0_subinterfaces", + "ssc_1_subint_service2_port_0_subinterfaces", "ssc_server_1" ], "resource_status_reason": "state changed", @@ -140,11 +162,11 @@ "resource_name": "ssc_1_int_ha_port_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_int_ha_port_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_int_ha_port_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], @@ -162,11 +184,11 @@ "resource_name": "ssc_server_1", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_server_1", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_server_1", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" } ], @@ -179,22 +201,22 @@ "resource_type": "OS::Nova::Server" }, { - "resource_name": "ssc_1_subint_avpn_port_0_subinterfaces", + "resource_name": "ssc_1_subint_service1_port_0_subinterfaces", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_avpn_port_0_subinterfaces", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34/resources/ssc_1_subint_service1_port_0_subinterfaces", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001/75e046b1-cf7d-4590-91e7-a6079f83fd34", "rel": "stack" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", "rel": "nested" } ], - "logical_resource_id": "ssc_1_subint_avpn_port_0_subinterfaces", + "logical_resource_id": "ssc_1_subint_service1_port_0_subinterfaces", "resource_status": "CREATE_COMPLETE", "updated_time": "2019-01-23T19:34:15Z", "required_by": [], @@ -203,4 +225,4 @@ "resource_type": "OS::Heat::ResourceGroup" } ] -}
\ No newline at end of file +} diff --git a/adapters/mso-openstack-adapters/src/test/resources/MISResourceGroupResponse.json b/adapters/mso-openstack-adapters/src/test/resources/MISResourceGroupResponse.json deleted file mode 100644 index 2350138076..0000000000 --- a/adapters/mso-openstack-adapters/src/test/resources/MISResourceGroupResponse.json +++ /dev/null @@ -1,31 +0,0 @@ - - -{ - "resources": [ - { - "parent_resource": "ssc_1_subint_mis_port_0_subinterfaces", - "resource_name": "0", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources/0", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c", - "rel": "stack" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", - "rel": "nested" - } - ], - "logical_resource_id": "0", - "resource_status_reason": "state changed", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [], - "resource_status": "CREATE_COMPLETE", - "physical_resource_id": "f711be16-2654-4a09-b89d-0511fda20e81", - "resource_type": "vlan_subinterface_ssc_mis.yaml" - } - ] -}
\ No newline at end of file diff --git a/adapters/mso-openstack-adapters/src/test/resources/MISSubInterface1Resources.json b/adapters/mso-openstack-adapters/src/test/resources/MISSubInterface1Resources.json deleted file mode 100644 index 5fa2795462..0000000000 --- a/adapters/mso-openstack-adapters/src/test/resources/MISSubInterface1Resources.json +++ /dev/null @@ -1,70 +0,0 @@ -{ - "resources": [ - { - "parent_resource": "0", - "resource_name": "ssc_subint_mis_vmi_0", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", - "rel": "stack" - } - ], - "logical_resource_id": "ssc_subint_mis_vmi_0", - "resource_status": "CREATE_COMPLETE", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [ - "ssc_subint_mis_vmi_0_v6_ip_0", - "ssc_subint_mis_vmi_0_ip_0" - ], - "resource_status_reason": "state changed", - "physical_resource_id": "2bbfa345-33bb-495a-94b2-fb514ee1cffc", - "resource_type": "OS::ContrailV2::VirtualMachineInterface" - }, - { - "parent_resource": "0", - "resource_name": "ssc_subint_mis_vmi_0_v6_ip_0", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", - "rel": "stack" - } - ], - "logical_resource_id": "ssc_subint_mis_vmi_0_v6_ip_0", - "resource_status": "CREATE_COMPLETE", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [], - "resource_status_reason": "state changed", - "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f", - "resource_type": "OS::ContrailV2::InstanceIp" - }, - { - "parent_resource": "0", - "resource_name": "ssc_subint_mis_vmi_0_ip_0", - "links": [ - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", - "rel": "self" - }, - { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", - "rel": "stack" - } - ], - "logical_resource_id": "ssc_subint_mis_vmi_0_ip_0", - "resource_status": "CREATE_COMPLETE", - "updated_time": "2019-01-23T19:34:56Z", - "required_by": [], - "resource_status_reason": "state changed", - "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506", - "resource_type": "OS::ContrailV2::InstanceIp" - } - ] -}
\ No newline at end of file diff --git a/adapters/mso-openstack-adapters/src/test/resources/Service1ResourceGroupResponse.json b/adapters/mso-openstack-adapters/src/test/resources/Service1ResourceGroupResponse.json new file mode 100644 index 0000000000..e2e701233f --- /dev/null +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1ResourceGroupResponse.json @@ -0,0 +1,79 @@ +{ + "resources": [ + { + "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces", + "resource_name": "1", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/1", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", + "rel": "stack" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", + "rel": "nested" + } + ], + "logical_resource_id": "1", + "resource_status_reason": "state changed", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [], + "resource_status": "CREATE_COMPLETE", + "physical_resource_id": "0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", + "resource_type": "vlan_subinterface_ssc_service1.yaml" + }, + { + "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces", + "resource_name": "0", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/0", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", + "rel": "stack" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", + "rel": "nested" + } + ], + "logical_resource_id": "0", + "resource_status_reason": "state changed", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [], + "resource_status": "CREATE_COMPLETE", + "physical_resource_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a", + "resource_type": "vlan_subinterface_ssc_service1.yaml" + }, + { + "parent_resource": "ssc_1_subint_service1_port_0_subinterfaces", + "resource_name": "2", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672/resources/2", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz/31d0647a-6043-49a4-81b6-ccab29380672", + "rel": "stack" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", + "rel": "nested" + } + ], + "logical_resource_id": "2", + "resource_status_reason": "state changed", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [], + "resource_status": "CREATE_COMPLETE", + "physical_resource_id": "bd0fc728-cbde-4301-a581-db56f494675c", + "resource_type": "vlan_subinterface_ssc_service1.yaml" + } + ] +}
\ No newline at end of file diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface0.json b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface0.json index e0a2404eaf..20121e6ff9 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface0.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface0.json @@ -5,12 +5,12 @@ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-1-fmn5laetg5cs/0d9cd813-2ae1-46c0-9ebb-48081f6cffbb", "rel": "self" } ], "stack_status_reason": "Stack CREATE completed successfully", - "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", + "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1", "stack_owner": "m08699", "creation_time": "2019-01-23T19:34:57Z", @@ -23,10 +23,10 @@ "OS::project_id": "ea2d13cc98b44d60a6f94bdcb2738f9e", "port_interface": "27391d94-33af-474a-927d-d409249e8fd3", "OS::stack_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a", - "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", + "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", "vip_v6_address": "2001:1890:e005:1403::", "network_id": "1bc1c5fe-896f-4629-b499-a5a36ece4253,c2f4ad4a-0089-41fa-aba7-a80963def29b,70bc637c-ea0f-4452-8aca-01e90c842ff1", - "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_avpn", + "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1", "counter": "0", "mac_address": "02:27:39:1d:94:33", "vip_address": "12.251.1.8", diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface0Resources.json b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface0Resources.json index e0631db0b5..0f3f35418e 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface0Resources.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface0Resources.json @@ -7,11 +7,11 @@ "resource_name": "ssc_subint_mis_vmi_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], @@ -31,11 +31,11 @@ "resource_name": "ssc_subint_mis_vmi_0_v6_ip_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], @@ -52,11 +52,11 @@ "resource_name": "ssc_subint_mis_vmi_0_ip_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface1.json b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface1.json index 009533b476..788757b24e 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface1.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface1.json @@ -7,12 +7,12 @@ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m/b7019dd0-2ee9-4447-bdef-ac25676b205a", "rel": "self" } ], "stack_status_reason": "Stack CREATE completed successfully", - "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", + "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1", "stack_owner": "m08699", "creation_time": "2019-01-23T19:34:57Z", @@ -25,10 +25,10 @@ "OS::project_id": "ea2d13cc98b44d60a6f94bdcb2738f9e", "port_interface": "27391d94-33af-474a-927d-d409249e8fd3", "OS::stack_id": "b7019dd0-2ee9-4447-bdef-ac25676b205a", - "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", + "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-0-yghihziaf36m", "vip_v6_address": "2001:1890:e005:1403::", "network_id": "1bc1c5fe-896f-4629-b499-a5a36ece4253,c2f4ad4a-0089-41fa-aba7-a80963def29b,70bc637c-ea0f-4452-8aca-01e90c842ff1", - "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_avpn", + "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1", "counter": "0", "mac_address": "02:27:39:1d:94:33", "vip_address": "12.251.1.8", diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface1Resources.json b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface1Resources.json index 1b10f16d6d..cfc4d7fed6 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface1Resources.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface1Resources.json @@ -7,11 +7,11 @@ "resource_name": "ssc_subint_mis_vmi_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], @@ -31,11 +31,11 @@ "resource_name": "ssc_subint_mis_vmi_0_v6_ip_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], @@ -52,11 +52,11 @@ "resource_name": "ssc_subint_mis_vmi_0_ip_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface2.json b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface2.json index 7488ee2045..c8fab2ae80 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface2.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface2.json @@ -5,12 +5,12 @@ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbtsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675cc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbtsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675cc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv/bd0fc728-cbde-4301-a581-db56f494675c", "rel": "self" } ], "stack_status_reason": "Stack CREATE completed successfully", - "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv", + "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv", "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1", "stack_owner": "m08699", "creation_time": "2019-01-23T19:34:57Z", @@ -23,10 +23,10 @@ "OS::project_id": "ea2d13cc98b44d60a6f94bdcb2738f9e", "port_interface": "27391d94-33af-474a-927d-d409249e8fd3", "OS::stack_id": "bd0fc728-cbde-4301-a581-db56f494675c", - "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_avpn_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv", + "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service1_port_0_subinterfaces-dtmxjmny7yjz-2-y3ndsavmsymv", "vip_v6_address": "2001:1890:e005:1403::", "network_id": "1bc1c5fe-896f-4629-b499-a5a36ece4253,c2f4ad4a-0089-41fa-aba7-a80963def29b,70bc637c-ea0f-4452-8aca-01e90c842ff1", - "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_avpn", + "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service1", "counter": "2", "mac_address": "02:27:39:1d:94:33", "vip_address": "12.251.1.8", diff --git a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface2Resources.json b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface2Resources.json index 94c7c69de4..e8aa80eb6f 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/AVPNSubInterface2Resources.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service1SubInterface2Resources.json @@ -7,11 +7,11 @@ "resource_name": "ssc_subint_mis_vmi_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], @@ -31,11 +31,11 @@ "resource_name": "ssc_subint_mis_vmi_0_v6_ip_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_v6_ip_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], @@ -52,11 +52,11 @@ "resource_name": "ssc_subint_mis_vmi_0_ip_0", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_mis_vmi_0_ip_0", "rel": "self" }, { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "stack" } ], diff --git a/adapters/mso-openstack-adapters/src/test/resources/Service2ResourceGroupResponse.json b/adapters/mso-openstack-adapters/src/test/resources/Service2ResourceGroupResponse.json new file mode 100644 index 0000000000..59f315a726 --- /dev/null +++ b/adapters/mso-openstack-adapters/src/test/resources/Service2ResourceGroupResponse.json @@ -0,0 +1,31 @@ + + +{ + "resources": [ + { + "parent_resource": "ssc_1_subint_service2_port_0_subinterfaces", + "resource_name": "0", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c/resources/0", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst/447a9b41-714e-434b-b1d0-6cce8d9f0f0c", + "rel": "stack" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "rel": "nested" + } + ], + "logical_resource_id": "0", + "resource_status_reason": "state changed", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [], + "resource_status": "CREATE_COMPLETE", + "physical_resource_id": "f711be16-2654-4a09-b89d-0511fda20e81", + "resource_type": "vlan_subinterface_ssc_service2.yaml" + } + ] +}
\ No newline at end of file diff --git a/adapters/mso-openstack-adapters/src/test/resources/MISSubInterface0.json b/adapters/mso-openstack-adapters/src/test/resources/Service2SubInterface0.json index d879b3be59..d10332b76e 100644 --- a/adapters/mso-openstack-adapters/src/test/resources/MISSubInterface0.json +++ b/adapters/mso-openstack-adapters/src/test/resources/Service2SubInterface0.json @@ -5,12 +5,12 @@ "description": "HOT template to instantiate a single Contrail VLAN sub-interface with associated instance IP addresses and allowed address pairs\n", "links": [ { - "href": "https://orchestration-aic.dyh3b.cci.att.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", "rel": "self" } ], "stack_status_reason": "Stack CREATE completed successfully", - "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y", + "stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y", "stack_user_project_id": "dfffe8b2401b45368ca6e21f19796ce1", "stack_owner": "m08699", "creation_time": "2019-01-23T19:34:56Z", @@ -23,10 +23,10 @@ "OS::project_id": "ea2d13cc98b44d60a6f94bdcb2738f9e", "port_interface": "0594a2f2-7ea4-42eb-abc2-48ea49677fca", "OS::stack_id": "f711be16-2654-4a09-b89d-0511fda20e81", - "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_mis_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y", + "OS::stack_name": "tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y", "vip_v6_address": "2001:1890:1001:4a32::3", "network_id": "8be20e92-68d6-4aec-ae66-0fc0fc933546", - "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_mis", + "subinterface_name_prefix": "tsbc0005v_tsbc0005vm002_subint_untrusted_service2", "counter": "0", "mac_address": "02:05:94:a2:f2:7e", "vip_address": "32.68.12.91", diff --git a/adapters/mso-openstack-adapters/src/test/resources/Service2SubInterface1Resources.json b/adapters/mso-openstack-adapters/src/test/resources/Service2SubInterface1Resources.json new file mode 100644 index 0000000000..84ae20f43e --- /dev/null +++ b/adapters/mso-openstack-adapters/src/test/resources/Service2SubInterface1Resources.json @@ -0,0 +1,70 @@ +{ + "resources": [ + { + "parent_resource": "0", + "resource_name": "ssc_subint_service2_vmi_0", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service2_vmi_0", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "rel": "stack" + } + ], + "logical_resource_id": "ssc_subint_service2_vmi_0", + "resource_status": "CREATE_COMPLETE", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [ + "ssc_subint_service2_vmi_0_v6_ip_0", + "ssc_subint_service2_vmi_0_ip_0" + ], + "resource_status_reason": "state changed", + "physical_resource_id": "2bbfa345-33bb-495a-94b2-fb514ee1cffc", + "resource_type": "OS::ContrailV2::VirtualMachineInterface" + }, + { + "parent_resource": "0", + "resource_name": "ssc_subint_service2_vmi_0_v6_ip_0", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service2_vmi_0_v6_ip_0", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "rel": "stack" + } + ], + "logical_resource_id": "ssc_subint_service2_vmi_0_v6_ip_0", + "resource_status": "CREATE_COMPLETE", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [], + "resource_status_reason": "state changed", + "physical_resource_id": "e7f25707-12fd-454f-95ac-6a05cd70806f", + "resource_type": "OS::ContrailV2::InstanceIp" + }, + { + "parent_resource": "0", + "resource_name": "ssc_subint_service2_vmi_0_ip_0", + "links": [ + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81/resources/ssc_subint_service2_vmi_0_ip_0", + "rel": "self" + }, + { + "href": "https://orchestration.com:8004/v1/ea2d13cc98b44d60a6f94bdcb2738f9e/stacks/tsbc0005vm002ssc001-ssc_1_subint_service2_port_0_subinterfaces-hlzdigtimzst-0-upfi5nhurk7y/f711be16-2654-4a09-b89d-0511fda20e81", + "rel": "stack" + } + ], + "logical_resource_id": "ssc_subint_service2_vmi_0_ip_0", + "resource_status": "CREATE_COMPLETE", + "updated_time": "2019-01-23T19:34:56Z", + "required_by": [], + "resource_status_reason": "state changed", + "physical_resource_id": "6d23f4d3-8f7b-42c5-bb9e-4aee5797d506", + "resource_type": "OS::ContrailV2::InstanceIp" + } + ] +}
\ No newline at end of file diff --git a/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3__Add_Add_Column_To_WatchDog_Model_Id_Lookup.sql b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3__Add_Add_Column_To_WatchDog_Model_Id_Lookup.sql new file mode 100644 index 0000000000..9a5bef6cc8 --- /dev/null +++ b/adapters/mso-requests-db-adapter/src/main/resources/db/migration/V5.3__Add_Add_Column_To_WatchDog_Model_Id_Lookup.sql @@ -0,0 +1,6 @@ +use requestdb; + +ALTER TABLE watchdog_service_mod_ver_id_lookup ADD DISTRIBUTION_NOTIFICATION LONGTEXT NULL AFTER SERVICE_MODEL_VERSION_ID; +ALTER TABLE watchdog_service_mod_ver_id_lookup ADD CONSUMER_ID varchar(200) NULL AFTER DISTRIBUTION_NOTIFICATION; + +CREATE INDEX watchdog_service_mod_ver_id_lookup_serv_mod_ver_id_idx ON watchdog_service_mod_ver_id_lookup (SERVICE_MODEL_VERSION_ID ASC);
\ No newline at end of file |