Search in sources :

Example 1 with AAIEntityNotFound

use of org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound in project so by onap.

the class BpmnRequestBuilder method buildVFModuleDeleteRequest.

public ServiceInstancesRequest buildVFModuleDeleteRequest(String vnfId, String vfModuleId, ModelType modelType) throws AAIEntityNotFound {
    GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
    if (vnf == null) {
        throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
    }
    VfModule vfModule = aaiDataRet.getAAIVfModule(vnfId, vfModuleId);
    if (vfModule == null) {
        throw new AAIEntityNotFound(VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId + " vfModuleId: " + vfModuleId);
    }
    return createServiceInstancesRequest(vnf, vfModule, modelType);
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf) AAIEntityNotFound(org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound) VfModule(org.onap.aai.domain.yang.VfModule)

Example 2 with AAIEntityNotFound

use of org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound in project so by onap.

the class BpmnRequestBuilder method buildVolumeGroupDeleteRequest.

public ServiceInstancesRequest buildVolumeGroupDeleteRequest(String vnfId, String volumeGroupId) throws AAIEntityNotFound {
    GenericVnf vnf = aaiDataRet.getGenericVnf(vnfId);
    if (vnf == null) {
        throw new AAIEntityNotFound(GENERIC_VNF_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId);
    }
    VolumeGroup volumeGroup = aaiDataRet.getVolumeGroup(vnfId, volumeGroupId);
    if (volumeGroup == null) {
        throw new AAIEntityNotFound(VF_MODULE_NOT_FOUND_IN_INVENTORY_VNF_ID + vnfId + " volumeGroupId: " + volumeGroupId);
    }
    return createServiceInstancesRequest(vnf, volumeGroup);
}
Also used : GenericVnf(org.onap.aai.domain.yang.GenericVnf) VolumeGroup(org.onap.aai.domain.yang.VolumeGroup) AAIEntityNotFound(org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound)

Aggregations

GenericVnf (org.onap.aai.domain.yang.GenericVnf)2 AAIEntityNotFound (org.onap.so.apihandlerinfra.infra.rest.exception.AAIEntityNotFound)2 VfModule (org.onap.aai.domain.yang.VfModule)1 VolumeGroup (org.onap.aai.domain.yang.VolumeGroup)1