import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.BlueprintWebClientService
import org.onap.ccsdk.cds.blueprintsprocessor.rest.service.RestLoggerService
import org.onap.ccsdk.cds.blueprintsprocessor.services.execution.AbstractScriptComponentFunction
-import org.onap.ccsdk.cds.controllerblueprints.core.BlueprintProcessorException
+import org.onap.ccsdk.cds.controllerblueprints.core.BluePrintProcessorException
import org.onap.ccsdk.cds.controllerblueprints.core.utils.ArchiveType
-import org.onap.ccsdk.cds.controllerblueprints.core.utils.BlueprintArchiveUtils
+import org.onap.ccsdk.cds.controllerblueprints.core.utils.BluePrintArchiveUtils
import org.onap.ccsdk.cds.controllerblueprints.core.utils.JacksonUtils
import org.slf4j.LoggerFactory
import org.springframework.http.HttpHeaders
val api = K8sApi(k8sApiUsername, k8sApiPassword, baseK8sApiUrl, vfModuleModelInvariantUuid, vfModuleModelUuid)
if (!api.hasDefinition()) {
- throw BlueprintProcessorException("K8s RB Definition ($vfModuleModelInvariantUuid/$vfModuleModelUuid) not found ")
+ throw BluePrintProcessorException("K8s RB Definition ($vfModuleModelInvariantUuid/$vfModuleModelUuid) not found ")
}
log.info("k8s-rb-profile-name: $k8sRbProfileName")
if (k8sRbProfileName.equals("")) {
- throw BlueprintProcessorException("K8s rb profile name is empty! Either define profile name to use or choose default")
+ throw BluePrintProcessorException("K8s rb profile name is empty! Either define profile name to use or choose default")
}
if (k8sRbProfileName.equals("default") and api.hasProfile(k8sRbProfileName)) {
log.info("Using default profile - skipping upload")
val profileFile = profileFilePath.toFile()
if (!profileFile.exists())
- throw BlueprintProcessorException("K8s Profile template file $profileFilePath does not exists")
+ throw BluePrintProcessorException("K8s Profile template file $profileFilePath does not exists")
val tempMainPath: File = createTempDir("k8s-profile-", "")
val tempProfilePath: File = createTempDir("$k8sRbProfileName-", "", tempMainPath)
log.info("Decompressing profile to $tempProfilePath")
- val decompressedProfile: File = BlueprintArchiveUtils.deCompress(
+ val decompressedProfile: File = BluePrintArchiveUtils.deCompress(
profileFilePath.toFile(),
"$tempProfilePath",
ArchiveType.TarGz
File(tmpOverrideFile).copyTo(File(destOverrideFile), true)
profileFilePath = Paths.get(tempMainPath.toString().plus(File.separator).plus("template-profile.tar.gz"))
- if (!BlueprintArchiveUtils.compress(decompressedProfile, profileFilePath.toFile(), ArchiveType.TarGz)) {
- throw BlueprintProcessorException("Profile compression has failed")
+ if (!BluePrintArchiveUtils.compress(decompressedProfile, profileFilePath.toFile(), ArchiveType.TarGz)) {
+ throw BluePrintProcessorException("Profile compression has failed")
}
log.info("$profileFilePath compression completed")
return profileFilePath
val profileFile = profileFilePath.toFile()
if (!profileFile.exists())
- throw BlueprintProcessorException("K8s Profile template file $profileFilePath does not exists")
+ throw BluePrintProcessorException("K8s Profile template file $profileFilePath does not exists")
val success = File(destPath).mkdirs()
log.info("Decompressing profile to $destPath")
- val decompressedProfile: File = BlueprintArchiveUtils.deCompress(
+ val decompressedProfile: File = BluePrintArchiveUtils.deCompress(
profileFilePath.toFile(),
"$destPath",
ArchiveType.TarGz
return false
} catch (e: Exception) {
log.info("Caught exception trying to get k8s rb definition")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
}
} catch (e: Exception) {
log.info("Caught exception trying to get k8s rb profile")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
}
} catch (e: Exception) {
log.info("Caught exception trying to create k8s rb profile ${profile.profileName}")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
}
} catch (e: Exception) {
log.info("Caught exception trying to upload k8s rb profile ${profile.profileName}")
- throw BlueprintProcessorException("${e.message}")
+ throw BluePrintProcessorException("${e.message}")
}
}
}