- private String versionFirstThreeOctets;
-
- public CsarUtils() {
- if(SDC_VERSION != null && !SDC_VERSION.isEmpty()){
- Matcher matcher = Pattern.compile("(?!\\.)(\\d+(\\.\\d+)+)(?![\\d\\.])").matcher(SDC_VERSION);
- matcher.find();
- setVersionFirstThreeOctets(matcher.group(0));
- } else {
- setVersionFirstThreeOctets("");
- }
- }
-
- /**
- *
- * @param component
- * @param getFromCS
- * @param isInCertificationRequest
- * @return
- */
- public Either<byte[], ResponseFormat> createCsar(Component component, boolean getFromCS, boolean isInCertificationRequest) {
- loggerSupportability.log(LoggerSupportabilityActions.GENERATE_CSAR, StatusCode.STARTED,"Starting to create Csar for component {} ",component.getName());
- final String createdBy = component.getCreatorFullName();
- String fileName;
- Map<String, ArtifactDefinition> toscaArtifacts = component.getToscaArtifacts();
- ArtifactDefinition artifactDefinition = toscaArtifacts.get(ToscaExportHandler.ASSET_TOSCA_TEMPLATE);
- fileName = artifactDefinition.getArtifactName();
-
- String toscaConformanceLevel = ConfigurationManager.getConfigurationManager().getConfiguration().getToscaConformanceLevel();
- String csarBlock0 = createCsarBlock0(CSAR_META_VERSION, toscaConformanceLevel);
- byte[] csarBlock0Byte = csarBlock0.getBytes();
-
- final String toscaBlock0 = createToscaBlock0(TOSCA_META_VERSION, CSAR_VERSION, createdBy, fileName);
- byte[] toscaBlock0Byte = toscaBlock0.getBytes();
-
- return generateCsarZip(csarBlock0Byte, toscaBlock0Byte, component, getFromCS, isInCertificationRequest)
- .left().map(responseFormat -> {
- loggerSupportability.log(LoggerSupportabilityActions.GENERATE_CSAR, StatusCode.COMPLETE,
- "Ended create Csar for component {} ", component.getName());
- return responseFormat;
- });
- }
-
- private Either<byte[], ResponseFormat> generateCsarZip(byte[] csarBlock0Byte, byte[] toscaBlock0Byte, Component component, boolean getFromCS, boolean isInCertificationRequest) {
- try (ByteArrayOutputStream out = new ByteArrayOutputStream();
- ZipOutputStream zip = new ZipOutputStream(out)) {
- zip.putNextEntry(new ZipEntry(CSAR_META_PATH_FILE_NAME));
- zip.write(csarBlock0Byte);
- zip.putNextEntry(new ZipEntry(TOSCA_META_PATH_FILE_NAME));
- zip.write(toscaBlock0Byte);
- Either<ZipOutputStream, ResponseFormat> populateZip = populateZip(component, getFromCS, zip, isInCertificationRequest);
- if (populateZip.isRight()) {
- log.debug("Failed to populate CSAR zip file {}. Please fix DB table accordingly ", populateZip.right().value());
- return Either.right(populateZip.right().value());
- }
-
- zip.finish();
- byte[] byteArray = out.toByteArray();
-
- return Either.left(byteArray);
- } catch (IOException e) {
- log.debug("Failed with IOexception to create CSAR zip for component {}. Please fix DB table accordingly ", component.getUniqueId(), e);
-
- ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR);
- return Either.right(responseFormat);
- }
-}
-
- private Either<ZipOutputStream, ResponseFormat> populateZip(Component component, boolean getFromCS, ZipOutputStream zip, boolean isInCertificationRequest) throws IOException {
-
- ArtifactDefinition artifactDef = component
- .getToscaArtifacts()
- .get(ToscaExportHandler.ASSET_TOSCA_TEMPLATE);
-
- Either<MainYamlWithDependencies, ResponseFormat> toscaRepresentation =
- fetchToscaRepresentation(component, getFromCS, artifactDef);
-
- // This should not be done but in order to keep the refactoring small enough we stop here.
- // TODO: Refactor the rest of this function
- byte[] mainYaml;
- List<Triple<String, String, Component>> dependencies;
- if(toscaRepresentation.isLeft()) {
- mainYaml = toscaRepresentation.left().value().mainYaml;
- dependencies = toscaRepresentation.left().value().dependencies.orElse(null);
- } else {
- return Either.right(toscaRepresentation.right().value());
- }
-
- String fileName = artifactDef.getArtifactName();
- zip.putNextEntry(new ZipEntry(DEFINITIONS_PATH + fileName));
- zip.write(mainYaml);
-
- //US798487 - Abstraction of complex types
- if (!ModelConverter.isAtomicComponent(component)){
- log.debug("Component {} is complex - generating abstract type for it..", component.getName());
- writeComponentInterface(component, zip, fileName, false);
- }
-
- //UID <cassandraId,filename,component>
- Map<String, ImmutableTriple<String,String, Component>> innerComponentsCache = new HashMap<>();
-
- Either<ZipOutputStream, ResponseFormat> responseFormat = getZipOutputStreamResponseFormatEither(zip, dependencies, innerComponentsCache);
- if (responseFormat != null) return responseFormat;
-
- //retrieve SDC.zip from Cassandra
- Either<byte[], ResponseFormat> latestSchemaFilesFromCassandra = getLatestSchemaFilesFromCassandra();
-
- if(latestSchemaFilesFromCassandra.isRight()){
- log.error("Error retrieving SDC Schema files from cassandra");
- return Either.right(latestSchemaFilesFromCassandra.right().value());
- }
-
- final byte[] schemaFileZip = latestSchemaFilesFromCassandra.left().value();
-
- final List<String> nodesFromPackage = findNonRootNodesFromPackage(dependencies);
-
- //add files from retrieved SDC.zip to Definitions folder in CSAR
- addSchemaFilesFromCassandra(zip, schemaFileZip, nodesFromPackage);
-
- Either<CsarDefinition, ResponseFormat> collectedComponentCsarDefinition = collectComponentCsarDefinition(component);
-
- if (collectedComponentCsarDefinition.isRight()) {
- return Either.right(collectedComponentCsarDefinition.right().value());
- }
-
- if (generators != null) {
- for (CsarEntryGenerator generator: generators) {
- log.debug("Invoking CsarEntryGenerator: {}", generator.getClass().getName());
- for (Entry<String, byte[]> pluginGeneratedFile : generator.generateCsarEntries(component).entrySet()) {
- zip.putNextEntry(new ZipEntry(pluginGeneratedFile.getKey()));
- zip.write(pluginGeneratedFile.getValue());
- }
- }
- }
-
- return writeAllFilesToCsar(component, collectedComponentCsarDefinition.left().value(), zip, isInCertificationRequest);
- }
-
- private Either<MainYamlWithDependencies, ResponseFormat> fetchToscaRepresentation(
- Component component,
- boolean getFromCS,
- ArtifactDefinition artifactDef
- ) {
- LifecycleStateEnum lifecycleState = component.getLifecycleState();
-
- boolean shouldBeFetchedFromCassandra = getFromCS ||
- !(lifecycleState == LifecycleStateEnum.NOT_CERTIFIED_CHECKIN ||
- lifecycleState == LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT);
-
- Either<MainYamlWithDependencies, ResponseFormat> toscaRepresentation =
- shouldBeFetchedFromCassandra ?
- fetchToscaRepresentation(artifactDef) :
- generateToscaRepresentation(component);
-
- return toscaRepresentation.left().bind(iff(
- myd -> !myd.dependencies.isPresent(),
- myd -> fetchToscaTemplateDependencies(myd.mainYaml, component)
- ));
- }
-
- private static <L, R> F<L, Either<L, R>> iff(Predicate<L> p, Function<L, Either<L, R>> ifTrue) {
- return l -> p.test(l) ? ifTrue.apply(l) : Either.left(l);
- }
-
- private Either<MainYamlWithDependencies, ResponseFormat> fetchToscaTemplateDependencies(
- byte[] mainYml,
- Component component
- ) {
- return toscaExportUtils.getDependencies(component).right().map(toscaError -> {
- log.debug("Failed to retrieve dependencies for component {}, error {}",
- component.getUniqueId(), toscaError);
- return componentsUtils.getResponseFormat(componentsUtils.convertFromToscaError(toscaError));
- }).left().map(tt -> MainYamlWithDependencies.make(mainYml, tt));
- }
-
- private Either<MainYamlWithDependencies, ResponseFormat> generateToscaRepresentation(Component component) {
- return toscaExportUtils.exportComponent(component).right().map(toscaError -> {
- log.debug("exportComponent failed", toscaError);
- return componentsUtils.getResponseFormat(componentsUtils.convertFromToscaError(toscaError));
- }).left().map(MainYamlWithDependencies::make);
- }
-
- private Either<MainYamlWithDependencies, ResponseFormat> fetchToscaRepresentation(ArtifactDefinition artifactDef) {
- return getFromCassandra(artifactDef.getEsId()).right().map(as -> {
- log.debug(ARTIFACT_NAME_UNIQUE_ID, artifactDef.getArtifactName(), artifactDef.getUniqueId());
- return componentsUtils.getResponseFormat(as);
- }).left().map(MainYamlWithDependencies::make);
- }
-
- // TODO: Refactor the ToscaRepresentation class in order to remove the following one
- // This will be done in a separate change
- private static class MainYamlWithDependencies {
-
- private final byte[] mainYaml;
- private final Optional<List<Triple<String, String, Component>>> dependencies;
-
- private MainYamlWithDependencies(byte[] mainYaml,
- Optional<List<Triple<String, String, Component>>> dependencies) {
- this.mainYaml = mainYaml;
- this.dependencies = dependencies;
- }
-
- public static MainYamlWithDependencies make(byte[] mainYaml) {
- return new MainYamlWithDependencies(mainYaml, Optional.empty());
- }
-
- public static MainYamlWithDependencies make(ToscaRepresentation tr) {
- return new MainYamlWithDependencies(tr.getMainYaml().getBytes(), Optional.ofNullable(tr.getDependencies()));
- }
-
- public static MainYamlWithDependencies make(byte[] mainYaml, ToscaTemplate tt) {
- return new MainYamlWithDependencies(mainYaml, Optional.ofNullable(tt.getDependencies()));
- }
- }
-
- /**
- * Create a list of all derived nodes found on the package
- *
- * @param dependencies all node dependencies
- * @return a list of nodes
- */
- private List<String> findNonRootNodesFromPackage(final List<Triple<String, String, Component>> dependencies) {
- final List<String> nodes = new ArrayList<>();
- if (CollectionUtils.isNotEmpty(dependencies)) {
- final String NATIVE_ROOT = "tosca.nodes.Root";
- dependencies.forEach(dependency -> {
- if (dependency.getRight() instanceof Resource) {
- final Resource resource = (Resource) dependency.getRight();
- if (CollectionUtils.isNotEmpty(resource.getDerivedList())) {
- resource.getDerivedList().stream()
- .filter(node -> !nodes.contains(node) && !NATIVE_ROOT.equalsIgnoreCase(node))
- .forEach(node -> nodes.add(node));
- }
- }
- });
- }
- return nodes;
- }
-
- /**
- * Writes a new zip entry
- *
- * @param zipInputStream the zip entry to be read
- * @return a map of the given zip entry
- */
- private Map<String, Object> readYamlZipEntry(final ZipInputStream zipInputStream) throws IOException {
- final int initSize = 2048;
- final StringBuilder zipEntry = new StringBuilder();
- final byte[] buffer = new byte[initSize];
- int read = 0;
- while ((read = zipInputStream.read(buffer, 0, initSize)) >= 0) {
- zipEntry.append(new String(buffer, 0, read));
- }
-
- return (Map<String, Object>) new Yaml().load(zipEntry.toString());
- }
-
- /**
- * Filters and removes all duplicated nodes found
- *
- * @param nodesFromPackage a List of all derived nodes found on the given package
- * @param nodesFromArtifactFile represents the nodes.yml file stored in Cassandra
- * @return a nodes Map updated
- */
- private Map<String, Object> updateNodeYml(final List<String> nodesFromPackage,
- final Map<String, Object> nodesFromArtifactFile) {
-
- if (MapUtils.isNotEmpty(nodesFromArtifactFile)) {
- final String nodeTypeBlock = ToscaTagNamesEnum.NODE_TYPES.getElementName();
- final Map<String, Object> nodeTypes = (Map<String, Object>) nodesFromArtifactFile.get(nodeTypeBlock);
- nodesFromPackage.stream()
- .filter(nodeTypes::containsKey)
- .forEach(nodeTypes::remove);
-
- nodesFromArtifactFile.replace(nodeTypeBlock, nodeTypes);
- }
-
- return nodesFromArtifactFile;
- }
-
- /**
- * Updates the zip entry from the given parameters
- *
- * @param byteArrayOutputStream an output stream in which the data is written into a byte array.
- * @param nodesYaml a Map of nodes to be written
- */
- private void updateZipEntry(final ByteArrayOutputStream byteArrayOutputStream,
- final Map<String, Object> nodesYaml) throws IOException {
- if (MapUtils.isNotEmpty(nodesYaml)) {
- byteArrayOutputStream.write(new YamlUtil().objectToYaml(nodesYaml).getBytes());
- }
- }
-
- private Either<ZipOutputStream, ResponseFormat> getZipOutputStreamResponseFormatEither(
- ZipOutputStream zip,
- List<Triple<String, String, Component>> dependencies,
- Map<String, ImmutableTriple<String, String, Component>> innerComponentsCache
- ) throws IOException {
- if (dependencies != null && !dependencies.isEmpty()) {
- for (Triple<String, String, Component> d : dependencies) {
- String cassandraId = d.getMiddle();
- Component childComponent = d.getRight();
-
- Either<byte[], ResponseFormat> entryData = getEntryData(cassandraId, childComponent)
- .right().map(x -> componentsUtils.getResponseFormat(x));
-
- if (entryData.isRight()) {
- return Either.right(entryData.right().value());
- }
-
- //fill innerComponentsCache
- String fileName = d.getLeft();
- // TODO: Extract the cache related functions to their own class
- addComponentToCache(innerComponentsCache, cassandraId, fileName, childComponent);
- addInnerComponentsToCache(innerComponentsCache, childComponent);
- }
-
- //add inner components to CSAR
- Either<ZipOutputStream, ResponseFormat> responseFormat = addInnerComponentsToCSAR(zip, innerComponentsCache);
- if (responseFormat != null) return responseFormat;
- }
- return null;
- }
-
- private Either<ZipOutputStream, ResponseFormat> addInnerComponentsToCSAR(ZipOutputStream zip, Map<String, ImmutableTriple<String, String, Component>> innerComponentsCache) throws IOException {
- for (Entry<String, ImmutableTriple<String, String, Component>> innerComponentTripleEntry : innerComponentsCache.entrySet()) {
-
- ImmutableTriple<String, String, Component> innerComponentTriple = innerComponentTripleEntry.getValue();
-
- Component innerComponent = innerComponentTriple.getRight();
- String icFileName = innerComponentTriple.getMiddle();
-
- // add component to zip
- Either<byte[], ActionStatus> entryData = getEntryData(innerComponentTriple.getLeft(), innerComponent);
- if (entryData.isRight()) {
- ResponseFormat responseFormat = componentsUtils.getResponseFormat(entryData.right().value());
- log.debug("Failed adding to zip component {}, error {}", innerComponentTriple.getLeft(),
- entryData.right().value());
- return Either.right(responseFormat);
- }
- byte[] content = entryData.left().value();
- zip.putNextEntry(new ZipEntry(DEFINITIONS_PATH + icFileName));
- zip.write(content);
-
- // add component interface to zip
- if (!ModelConverter.isAtomicComponent(innerComponent)) {
- writeComponentInterface(innerComponent, zip, icFileName, true);
- }
- }
- return null;
- }
-
- private void addSchemaFilesFromCassandra(final ZipOutputStream zip,
- final byte[] schemaFileZip,
- final List<String> nodesFromPackage) {
- final int initSize = 2048;
- log.debug("Starting copy from Schema file zip to CSAR zip");
- try (final ZipInputStream zipStream = new ZipInputStream(new ByteArrayInputStream(schemaFileZip));
- final ByteArrayOutputStream out = new ByteArrayOutputStream();
- final BufferedOutputStream bos = new BufferedOutputStream(out, initSize)) {
-
- ZipEntry entry;
- while ((entry = zipStream.getNextEntry()) != null) {
- ZipUtils.checkForZipSlipInRead(entry);
- final String entryName = entry.getName();
- int readSize = initSize;
- final byte[] entryData = new byte[initSize];
- if (entryName.equalsIgnoreCase("nodes.yml")) {
- handleNode(zipStream, out, nodesFromPackage);
- } else {
- while ((readSize = zipStream.read(entryData, 0, readSize)) != -1) {
- bos.write(entryData, 0, readSize);
- }
- bos.flush();
- }
- out.flush();
- zip.putNextEntry(new ZipEntry(DEFINITIONS_PATH + entryName));
- zip.write(out.toByteArray());
- zip.flush();
- out.reset();
- }
- } catch (final Exception e) {
- log.error("Error while writing the SDC schema file to the CSAR", e);
- throw new ByResponseFormatComponentException(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
- }
- log.debug("Finished copy from Schema file zip to CSAR zip");
- }
-
- /**
- * Handles the nodes.yml zip entry, updating the nodes.yml to avoid duplicated nodes on it.
- *
- * @param zipInputStream the zip entry to be read
- * @param byteArrayOutputStream an output stream in which the data is written into a byte array.
- * @param nodesFromPackage list of all nodes found on the onboarded package
- */
- private void handleNode(final ZipInputStream zipInputStream,
- final ByteArrayOutputStream byteArrayOutputStream,
- final List<String> nodesFromPackage) throws IOException {
-
- final Map<String, Object> nodesFromArtifactFile = readYamlZipEntry(zipInputStream);
- final Map<String, Object> nodesYaml = updateNodeYml(nodesFromPackage, nodesFromArtifactFile);
- updateZipEntry(byteArrayOutputStream, nodesYaml);
- }
-
- private void addInnerComponentsToCache(Map<String, ImmutableTriple<String, String, Component>> componentCache,
- Component childComponent) {
-
- List<ComponentInstance> instances = childComponent.getComponentInstances();
-
- if(instances != null) {
- instances.forEach(ci -> {
- ImmutableTriple<String, String, Component> componentRecord = componentCache.get(ci.getComponentUid());
- if (componentRecord == null) {
- // all resource must be only once!
- Either<Resource, StorageOperationStatus> resource = toscaOperationFacade.getToscaElement(ci.getComponentUid());
- Component componentRI = checkAndAddComponent(componentCache, ci, resource);
-
- //if not atomic - insert inner components as well
- if(!ModelConverter.isAtomicComponent(componentRI)) {
- addInnerComponentsToCache(componentCache, componentRI);
- }
- }
- });
- }
- }
-
- private Component checkAndAddComponent(Map<String, ImmutableTriple<String, String, Component>> componentCache, ComponentInstance ci, Either<Resource, StorageOperationStatus> resource) {
- if (resource.isRight()) {
- log.debug("Failed to fetch resource with id {} for instance {}", ci.getComponentUid(), ci.getName());
- }
- Component componentRI = resource.left().value();
-
- Map<String, ArtifactDefinition> childToscaArtifacts = componentRI.getToscaArtifacts();
- ArtifactDefinition childArtifactDefinition = childToscaArtifacts.get(ToscaExportHandler.ASSET_TOSCA_TEMPLATE);
- if (childArtifactDefinition != null) {
- //add to cache
- addComponentToCache(componentCache, childArtifactDefinition.getEsId(), childArtifactDefinition.getArtifactName(), componentRI);
- }
- return componentRI;
- }
-
- private void addComponentToCache(Map<String, ImmutableTriple<String, String, Component>> componentCache,
- String id, String fileName, Component component) {
-
- String uuid = component.getInvariantUUID();
- String version = component.getVersion();
-
- Supplier<ImmutableTriple<String, String, Component>> sup =
- () -> new ImmutableTriple<>(id, fileName, component);
-
- componentCache.put(uuid, updateWith(componentCache, uuid,
- cc -> overwriteIfSameVersions(id, version, cc, sup),
- sup
- ));
- }
-
- private static <K, V> V updateWith(Map<K, V> kvs, K k, Function<V, V> f, Supplier<V> orElse) {
- return Optional.ofNullable(kvs.get(k)).map(f).orElseGet(orElse);
- }
-
- private ImmutableTriple<String, String, Component> overwriteIfSameVersions(
- String id, String version,
- ImmutableTriple<String, String, Component> cc,
- Supplier<ImmutableTriple<String, String, Component>> newValue
- ) {
- if (CommonBeUtils.compareAsdcComponentVersions(version, cc.getRight().getVersion())) {
- log.warn("Overwriting component invariantID {} of version {} with a newer version {}", id,
- cc.getRight().getVersion(),
- version);
- return newValue.get();
- }
- return cc;
- }
-
- private Either<ZipOutputStream, ResponseFormat> writeComponentInterface(
- Component component,
- ZipOutputStream zip,
- String fileName,
- boolean isAssociatedComponent
- ) {
- try {
- Either<String, ToscaError> mainYaml = toscaExportUtils
- .exportComponentInterface(component, isAssociatedComponent)
- .left().map(ToscaRepresentation::getMainYaml);
-
- // TODO: This should be done outside this function to keep this testable.
- // We can probably achieve this once the other refactorings related to SDC-2812 are merged
- String interfaceFileName = DEFINITIONS_PATH + ToscaExportHandler.getInterfaceFilename(fileName);
- zip.putNextEntry(new ZipEntry(interfaceFileName));
- zip.write(mainYaml.left().value().getBytes());
-
- } catch (Exception e) {
- log.error("#writeComponentInterface - zip writing failed with error: ", e);
- return Either.right(componentsUtils.getResponseFormat(ActionStatus.GENERAL_ERROR));
- }
- return Either.left(zip);
- }
-
- private Either<byte[], ActionStatus> getEntryData(String cassandraId, Component childComponent) {
- if (cassandraId == null || cassandraId.isEmpty()) {
- return toscaExportUtils.exportComponent(childComponent)
- .right().map(toscaErrorToActionStatus(childComponent))
- .left().map(toscaRepresentation -> toscaRepresentation.getMainYaml().getBytes());
- } else {
- return getFromCassandra(cassandraId);
- }
- }
-
- private F<ToscaError, ActionStatus> toscaErrorToActionStatus(Component childComponent) {
- return toscaError -> {
- log.debug("Failed to export tosca template for child component {} error {}",
- childComponent.getUniqueId(), toscaError);
- return componentsUtils.convertFromToscaError(toscaError);
- };
- }
-
- private Either<byte[], ResponseFormat> getLatestSchemaFilesFromCassandra() {
- String fto = getVersionFirstThreeOctets();
- return sdcSchemaFilesCassandraDao.getSpecificSchemaFiles(fto, CONFORMANCE_LEVEL)
- .right().map(schemaFilesFetchDBError(fto))
- .left().bind(iff(
- List::isEmpty,
- () -> schemaFileFetchError(fto),
- s -> Either.left(s.iterator().next().getPayloadAsArray())
- )
- );
- }
-
- private static <A, B> F<A, B> iff(Predicate<A> p, Supplier<B> s, Function<A, B> orElse) {
- return a -> p.test(a) ? s.get() : orElse.apply(a);
- }
-
- private F<CassandraOperationStatus, ResponseFormat> schemaFilesFetchDBError(String firstThreeOctets) {
- return cos -> {
- log.debug(
- "Failed to get the schema files SDC-Version: {} Conformance-Level {}. Please fix DB table accordingly.",
- firstThreeOctets, CONFORMANCE_LEVEL);
- StorageOperationStatus sos = DaoStatusConverter.convertCassandraStatusToStorageStatus(cos);
- return componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(sos));
- };
- }
-
- private Either<byte[], ResponseFormat> schemaFileFetchError(String firstThreeOctets) {
- log.debug("Failed to get the schema files SDC-Version: {} Conformance-Level {}",
- firstThreeOctets, CONFORMANCE_LEVEL);
- return Either.right(
- componentsUtils.getResponseFormat(
- ActionStatus.TOSCA_SCHEMA_FILES_NOT_FOUND, firstThreeOctets, CONFORMANCE_LEVEL
- )
- );
- }
-
- private Either<byte[], ActionStatus> getFromCassandra(String cassandraId) {
- return artifactCassandraDao.getArtifact(cassandraId)
- .right().map(cos -> {
- log.debug("Failed to fetch artifact from Cassandra by id {} error {} ", cassandraId, cos);
- StorageOperationStatus storageStatus = DaoStatusConverter.convertCassandraStatusToStorageStatus(cos);
- return componentsUtils.convertFromStorageResponse(storageStatus);
- }).left().map(DAOArtifactData::getDataAsArray);
- }
-
- private String createCsarBlock0(String metaFileVersion, String toscaConformanceLevel) {
- return String.format(BLOCK_0_TEMPLATE, metaFileVersion, toscaConformanceLevel);
- }