TOSCAImporter#

class eclypse.io.defaults.tosca.TOSCAImporter[source]#

Bases: GraphImporter[AssetGraph, dict[str, Any]]

Importer for TOSCA Simple Profile YAML service templates.

Methods

from_data(data, *[, kind, context])

Convert TOSCA data into an ECLYPSE graph.

read_data(source, *[, context])

Read TOSCA data from a YAML file.

read_data(source, *, context=None)[source]#

Read TOSCA data from a YAML file.

Parameters:
  • source (str | Path) – The source YAML path.

  • context (IOContext | None) – Optional import/export customisation.

Returns:

The decoded TOSCA data.

Return type:

dict[str, Any]

from_data(data, *, kind=None, context=None)[source]#

Convert TOSCA data into an ECLYPSE graph.

Parameters:
  • data (dict[str, Any]) – TOSCA Simple Profile YAML-compatible data.

  • kind (GraphKind | None) – Optional graph kind requested by the caller.

  • context (IOContext | None) – Optional import/export customisation.

Returns:

The imported graph.

Return type:

AssetGraph

Raises:

ValueError – If the requested graph kind conflicts with TOSCA metadata.