aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Expand)AuthorFilesLines
2022-10-27Release version 2.4.1Timoney, Dan (dt5972)30-29/+34
2022-10-24Use latest released parent pomTimoney, Dan (dt5972)29-28/+33
2022-09-28Release version 2.4.0 sdnc/northbound artifactsTimoney, Dan (dt5972)30-29/+34
2022-09-20Update to use released Kohn ccsdk artifactsDan Timoney28-34/+28
2022-08-05Changes to support ODL Sulfur updateDan Timoney50-725/+705
2022-04-14Roll master to Kohn release numberingDan Timoney29-30/+30
2022-03-29Release Jakarta M4 artifactsjakartaDan Timoney30-29/+34
2022-03-28Use released parent pom 2.3.3Dan Timoney28-28/+28
2022-03-23Migrate to phosphorusDan Timoney28-28/+28
2022-01-04Update to parent version 2.3.2Dan Timoney28-28/+28
2021-11-29Remove retired committer - Dave StilwellDan Timoney1-5/+3
2021-11-18Use Silicon SR2 version of parent pomsDan Timoney28-28/+28
2021-10-28Use version 2.3.0 of parent pomsDan Timoney28-28/+28
2021-10-06Remove explicit versionsDan Timoney3-8/+0
2021-09-28Change scope of sli dependencies to providedDan Timoney8-23/+15
2021-09-24Roll versions for Jakarta releaseDan Timoney29-58/+58
2021-09-15Release version 2.2.0 (initial Istanbul)Dan Timoney30-29/+34
2021-09-14Use version 2.2.1 of parent pomDan Timoney28-28/+28
2021-09-13Update to use released parent pomDan Timoney30-2200/+2252
2021-08-26New DGs added for CCVPN scenario enhancement.chenkai2-76/+90
2021-07-27Update to support use of version rangesDan Timoney4-44/+6
2021-07-20Use host name verifier that accepts IP addressesJonathan Platt1-6/+2
2021-07-09CLeaning up moved modules and running mvn tidy:pomSingal, Kapil (ks220y)38-1014/+675
2021-06-16Adding required APIs into the generic-resource-api YANG model to support clou...Hesam Rahimi1-0/+6
2021-03-19Roll to Istanbul release versionDan Timoney65-44285/+58
2021-02-23Release version 2.1.1 and roll versionsDan Timoney39-5373/+5378
2021-02-04Upgrade to ODL AluminumDan Timoney59-5649/+5586
2021-01-26Adding Modify API into generic-resource-api.yang file to support modification...Hesam Rahimi1-0/+2
2020-12-07Roll to next snapshotDan Timoney29-29/+29
2020-12-03Release version 2.1.0 of sdnc/northboundDan Timoney1-0/+5
2020-12-02Use released 2.1.0 version of ccsdk/parent pomsDan Timoney35-35/+35
2020-11-05Removed dup module name from GRA yamlDan Timoney5-5422/+5450
2020-10-06GRAPI yang model updateCheung, Pat (kc1472)3-4650/+5425
2020-09-11Roll to initial Honolulu versionDan Timoney36-66/+66
2020-09-11Release M4 version of sdnc/northboundDan Timoney1-0/+5
2020-08-25fix for J11Michael Dürre1-2/+8
2020-08-22Roll versions to next Guilin snapshotDan Timoney39-106/+99
2020-08-11Update info.yamlKevin Smokowski1-11/+17
2020-08-07Release 2.0.0 version of sdnc/northboundDan Timoney2-0/+7
2020-08-06Merge "Adding required service actions to support Transport Slicing."Dan Timoney1-0/+8
2020-08-06Changes for the async support in MDONSMehreen Kaleem2-8/+19
2020-08-06Adding required service actions to support Transport Slicing.Hesam Rahimi1-0/+8
2020-08-05Remove deprecated VNF-API interfaceDan Timoney3-12/+0
2020-06-08Generate ODL compliant swagger models from yangDan Timoney18-145/+91738
2020-04-15Updated the yang for optical-serviceMehreen Kaleem1-44/+21
2020-03-17Roll to first Guilin snapshotDan Timoney35-68/+69
2020-03-06Release Frankfurt M4 artifactsDan Timoney1-0/+5
2020-03-06Use released Frankfurt M4 parent pomsDan Timoney33-33/+33
2020-02-24Update CCSDK parent pom version to 1.5.2-SNAPSHOTherbert33-33/+33
2020-02-19optical-service package added for service createMehreen Kaleem21-0/+1673
">RECIPE_VF_MODULE_CREATE, ImmutableList.of(TARGET_VFC)) .put(RECIPE_VF_MODULE_DELETE, ImmutableList.of(TARGET_VFC)).build(); // name of request parameters within policy payload public static final String REQ_PARAM_NM = "requestParameters"; // name of configuration parameters within policy payload public static final String CONFIG_PARAM_NM = "configurationParameters"; // used to decode configuration parameters via gson private static final Type CONFIG_TYPE = new TypeToken<List<Map<String, String>>>() {}.getType(); // Static variables required to hold the IDs of the last service item, VNF item and VF Module. // Note that in // a multithreaded deployment this WILL break private static String lastVNFItemVnfId; private static String lastServiceItemServiceInstanceId; private static String lastVfModuleItemVfModuleInstanceId; public SoActorServiceProvider() { super(SO_ACTOR); } @Override public String actor() { return SO_ACTOR; } @Override public List<String> recipes() { return ImmutableList.copyOf(recipes); } @Override public List<String> recipeTargets(String recipe) { return ImmutableList.copyOf(targets.getOrDefault(recipe, Collections.emptyList())); } @Override public List<String> recipePayloads(String recipe) { return Collections.emptyList(); } private SoModelInfo prepareSoModelInfo(Policy policy) { if (policy.getTarget() == null || policy.getTarget().getModelCustomizationId() == null || policy.getTarget().getModelInvariantId() == null) { return null; } if (policy.getTarget().getModelName() == null || policy.getTarget().getModelVersion() == null || policy.getTarget().getModelVersionId() == null) { return null; } SoModelInfo soModelInfo = new SoModelInfo(); soModelInfo.setModelCustomizationId(policy.getTarget().getModelCustomizationId()); soModelInfo.setModelInvariantId(policy.getTarget().getModelInvariantId()); soModelInfo.setModelName(policy.getTarget().getModelName()); soModelInfo.setModelVersion(policy.getTarget().getModelVersion()); soModelInfo.setModelVersionId(policy.getTarget().getModelVersionId()); soModelInfo.setModelType("vfModule"); return soModelInfo; } /** * Construct requestInfo for the SO requestDetails. * * @return SO request information */ private SoRequestInfo constructRequestInfo() { SoRequestInfo soRequestInfo = new SoRequestInfo(); soRequestInfo.setSource("POLICY"); soRequestInfo.setSuppressRollback(false); soRequestInfo.setRequestorId("policy"); return soRequestInfo; } /** * This method is needed to get the serviceInstanceId and vnfInstanceId which is used in the asyncSORestCall. * * @param requestId the request Id * @param callback callback method * @param request the request * @param url SO REST URL * @param user username * @param password password */ public static void sendRequest(String requestId, SoManager.SoCallback callback, Object request, String url, String user, String password) { SoManager soManager = new SoManager(url, user, password); soManager.asyncSoRestCall(requestId, callback, lastServiceItemServiceInstanceId, lastVNFItemVnfId, lastVfModuleItemVfModuleInstanceId, (SoRequest) request); } /** * Builds the request parameters from the policy payload. * * @param policy the policy * @param request request into which to stick the request parameters */ private void buildRequestParameters(Policy policy, SoRequestDetails request) { // assume null until proven otherwise request.setRequestParameters(null); if (policy.getPayload() == null) { return; } String json = policy.getPayload().get(REQ_PARAM_NM); if (json == null) { return; } request.setRequestParameters(Serialization.gsonPretty.fromJson(json, SoRequestParameters.class)); } /** * Builds the configuration parameters from the policy payload. * * @param policy the policy * @param request request into which to stick the configuration parameters */ private void buildConfigurationParameters(Policy policy, SoRequestDetails request) { // assume null until proven otherwise request.setConfigurationParameters(null); if (policy.getPayload() == null) { return; } String json = policy.getPayload().get(CONFIG_PARAM_NM); if (json == null) { return; } request.setConfigurationParameters(Serialization.gsonPretty.fromJson(json, CONFIG_TYPE)); } /** * This method is called to remember the last service instance ID, VNF Item VNF ID and vf module ID. Note these * fields are static, beware for multithreaded deployments * * @param vnfInstanceId update the last VNF instance ID to this value * @param serviceInstanceId update the last service instance ID to this value * @param vfModuleId update the vfModule instance ID to this value */ private static void preserveInstanceIds(final String vnfInstanceId, final String serviceInstanceId, final String vfModuleId) { lastVNFItemVnfId = vnfInstanceId; lastServiceItemServiceInstanceId = serviceInstanceId; lastVfModuleItemVfModuleInstanceId = vfModuleId; } /** * Constructs a SO request conforming to the lcm API. The actual request is constructed and then placed in a wrapper * object used to send through DMAAP. * * @param onset the event that is reporting the alert for policy to perform an action * @param operation the control loop operation specifying the actor, operation, target, etc. * @param policy the policy the was specified from the yaml generated by CLAMP or through the Policy GUI/API * @param aaiCqResponse response from A&AI custom query * @return a SO request conforming to the lcm API using the DMAAP wrapper */ public SoRequest constructRequestCq(VirtualControlLoopEvent onset, ControlLoopOperation operation, Policy policy, AaiCqResponse aaiCqResponse) { if (!SO_ACTOR.equals(policy.getActor()) || !recipes().contains(policy.getRecipe())) { return null; } // A&AI named query should have been performed by now. If not, return null if (aaiCqResponse == null) { return null; } SoModelInfo soModelInfo = prepareSoModelInfo(policy); // Report the error vf module is not found if (soModelInfo == null) { logger.error("vf module is not found."); return null; } GenericVnf vnfItem; ServiceInstance vnfServiceItem; Tenant tenantItem; CloudRegion cloudRegionItem; // Extract the items we're interested in from the response try { vnfItem = aaiCqResponse.getGenericVnfByVfModuleModelInvariantId(soModelInfo.getModelInvariantId()); //Report VNF not found if (vnfItem == null) { logger.error("Generic Vnf is not found."); return null; } } catch (Exception e) { logger.error("VNF Item not found in AAI response {}", Serialization.gsonPretty.toJson(aaiCqResponse), e); return null; } try { vnfServiceItem = aaiCqResponse.getServiceInstance(); } catch (Exception e) { logger.error("VNF Service Item not found in AAI response {}", Serialization.gsonPretty.toJson(aaiCqResponse), e); return null; } try { tenantItem = aaiCqResponse.getDefaultTenant(); } catch (Exception e) { logger.error(TENANT_NOT_FOUND, Serialization.gsonPretty.toJson(aaiCqResponse), e); return null; } try { cloudRegionItem = aaiCqResponse.getDefaultCloudRegion(); } catch (Exception e) { logger.error(TENANT_NOT_FOUND, Serialization.gsonPretty.toJson(aaiCqResponse), e); return null; } // Construct SO Request for a policy's recipe if (RECIPE_VF_MODULE_CREATE.equals(policy.getRecipe())) { return constructCreateRequestCq(aaiCqResponse, policy, tenantItem, vnfItem, vnfServiceItem, soModelInfo, cloudRegionItem); } else if (RECIPE_VF_MODULE_DELETE.equals(policy.getRecipe())) { return constructDeleteRequestCq(tenantItem, vnfItem, vnfServiceItem, policy, cloudRegionItem); } else { return null; } } /** * Construct the So request, based on Custom Query response from A&AI. * * @param aaiCqResponse Custom query response from A&AI * @param policy policy information * @param tenantItem Tenant from CQ response * @param vnfItem Generic VNF from CQ response * @param vnfServiceItem Service Instance from CQ response * @param vfModuleItem VF Module from CustomQuery response * @param cloudRegionItem Cloud Region from Custom query response * @return SoRequest well formed So Request */ private SoRequest constructCreateRequestCq(AaiCqResponse aaiCqResponse, Policy policy, Tenant tenantItem, GenericVnf vnfItem, ServiceInstance vnfServiceItem, SoModelInfo vfModuleItem, CloudRegion cloudRegionItem) { SoRequest request = new SoRequest(); request.setOperationType(SoOperationType.SCALE_OUT); // // // Do NOT send So the requestId, they do not support this field // request.setRequestDetails(new SoRequestDetails()); request.getRequestDetails().setRequestParameters(new SoRequestParameters()); request.getRequestDetails().getRequestParameters().setUserParams(null); // cloudConfiguration request.getRequestDetails().setCloudConfiguration(constructCloudConfigurationCq(tenantItem, cloudRegionItem)); // modelInfo request.getRequestDetails().setModelInfo(vfModuleItem); // requestInfo request.getRequestDetails().setRequestInfo(constructRequestInfo()); request.getRequestDetails().getRequestInfo().setInstanceName("vfModuleName"); // relatedInstanceList SoRelatedInstanceListElement relatedInstanceListElement1 = new SoRelatedInstanceListElement(); SoRelatedInstanceListElement relatedInstanceListElement2 = new SoRelatedInstanceListElement(); relatedInstanceListElement1.setRelatedInstance(new SoRelatedInstance()); relatedInstanceListElement2.setRelatedInstance(new SoRelatedInstance()); // Service Item relatedInstanceListElement1.getRelatedInstance().setInstanceId(vnfServiceItem.getServiceInstanceId()); relatedInstanceListElement1.getRelatedInstance().setModelInfo(new SoModelInfo()); relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelType("service"); relatedInstanceListElement1.getRelatedInstance().getModelInfo() .setModelInvariantId(vnfServiceItem.getModelInvariantId()); relatedInstanceListElement1.getRelatedInstance().getModelInfo() .setModelVersionId(vnfServiceItem.getModelVersionId()); relatedInstanceListElement1.getRelatedInstance().getModelInfo() .setModelName(aaiCqResponse.getModelVerByVersionId(vnfServiceItem.getModelVersionId()).getModelName()); relatedInstanceListElement1.getRelatedInstance().getModelInfo().setModelVersion( aaiCqResponse.getModelVerByVersionId(vnfServiceItem.getModelVersionId()).getModelVersion()); // VNF Item relatedInstanceListElement2.getRelatedInstance().setInstanceId(vnfItem.getVnfId()); relatedInstanceListElement2.getRelatedInstance().setModelInfo(new SoModelInfo()); relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelType("vnf"); relatedInstanceListElement2.getRelatedInstance().getModelInfo() .setModelInvariantId(vnfItem.getModelInvariantId()); relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelVersionId(vnfItem.getModelVersionId()); relatedInstanceListElement2.getRelatedInstance().getModelInfo() .setModelName(aaiCqResponse.getModelVerByVersionId(vnfItem.getModelVersionId()).getModelName()); relatedInstanceListElement2.getRelatedInstance().getModelInfo().setModelVersion( aaiCqResponse.getModelVerByVersionId(vnfItem.getModelVersionId()).getModelVersion()); relatedInstanceListElement2.getRelatedInstance().getModelInfo() .setModelCustomizationId(vnfItem.getModelCustomizationId()); // Insert the Service Item and VNF Item request.getRequestDetails().getRelatedInstanceList().add(relatedInstanceListElement1); request.getRequestDetails().getRelatedInstanceList().add(relatedInstanceListElement2); // Request Parameters buildRequestParameters(policy, request.getRequestDetails()); // Configuration Parameters buildConfigurationParameters(policy, request.getRequestDetails()); // Save the instance IDs for the VNF and service to static fields // vfModuleId is not required for the create vf-module preserveInstanceIds(vnfItem.getVnfId(), vnfServiceItem.getServiceInstanceId(), null); if (logger.isDebugEnabled()) { logger.debug(CONSTRUCTED_SO_MSG, Serialization.gsonPretty.toJson(request)); } return request; } /** * constructs delete request for So. * * @param tenantItem Tenant from A&AI CQ request * @param vnfItem Generic VNF from A&AI CQ request * @param vnfServiceItem ServiceInstance from A&AI CQ request * @param policy policy information * @param cloudRegionItem CloudRegion from A&AI CQ request * @return SoRequest deleted */ private SoRequest constructDeleteRequestCq(Tenant tenantItem, GenericVnf vnfItem, ServiceInstance vnfServiceItem, Policy policy, CloudRegion cloudRegionItem) { SoRequest request = new SoRequest(); request.setOperationType(SoOperationType.DELETE_VF_MODULE); request.setRequestDetails(new SoRequestDetails()); request.getRequestDetails().setRelatedInstanceList(null); request.getRequestDetails().setConfigurationParameters(null); // cloudConfiguration request.getRequestDetails().setCloudConfiguration(constructCloudConfigurationCq(tenantItem, cloudRegionItem)); // modelInfo request.getRequestDetails().setModelInfo(prepareSoModelInfo(policy)); // requestInfo request.getRequestDetails().setRequestInfo(constructRequestInfo()); // Save the instance IDs for the VNF, service and vfModule to static fields preserveInstanceIds(vnfItem.getVnfId(), vnfServiceItem.getServiceInstanceId(), null); if (logger.isDebugEnabled()) { logger.debug(CONSTRUCTED_SO_MSG, Serialization.gsonPretty.toJson(request)); } return request; } /** * Construct cloudConfiguration for the SO requestDetails. Overridden for custom query. * * @param tenantItem tenant item from A&AI named-query response * @return SO cloud configuration */ private SoCloudConfiguration constructCloudConfigurationCq(Tenant tenantItem, CloudRegion cloudRegionItem) { SoCloudConfiguration cloudConfiguration = new SoCloudConfiguration(); cloudConfiguration.setTenantId(tenantItem.getTenantId()); cloudConfiguration.setLcpCloudRegionId(cloudRegionItem.getCloudRegionId()); return cloudConfiguration; } }