summaryrefslogtreecommitdiffstats
path: root/javatoscachecker/checker/src/test
diff options
context:
space:
mode:
authorSerban Jora <jora@research.att.com>2017-08-29 15:52:57 -0400
committerSerban Jora <jora@research.att.com>2017-09-01 00:07:55 -0400
commit5699eb248346eb6dd59f42605aeb56af41b15cab (patch)
tree81bf4a4ce2d05022612cd00254fdfd37a765be43 /javatoscachecker/checker/src/test
parentdb87c4f77a730e571338c2bf7bfcc9fdc5272185 (diff)
Add initial ATT tosca checker tool
Addressed license headers and copyright owner issues Addressed project folder name Issue-ID: MODELING-7 Change-Id: I150784c5871bb6093ff0a6615639088bc2e0c496 Signed-off-by: Serban Jora <jora@research.att.com>
Diffstat (limited to 'javatoscachecker/checker/src/test')
-rw-r--r--javatoscachecker/checker/src/test/java/org/onap/tosca/checker/test/CSAR.java35
-rw-r--r--javatoscachecker/checker/src/test/tosca/dcae_uservice_tosca.yaml653
-rw-r--r--javatoscachecker/checker/src/test/tosca/mini_ceil_tosca.yaml108
-rw-r--r--javatoscachecker/checker/src/test/tosca/ucpe_schema.yml403
-rw-r--r--javatoscachecker/checker/src/test/tosca/workflow_1.yaml46
5 files changed, 1245 insertions, 0 deletions
diff --git a/javatoscachecker/checker/src/test/java/org/onap/tosca/checker/test/CSAR.java b/javatoscachecker/checker/src/test/java/org/onap/tosca/checker/test/CSAR.java
new file mode 100644
index 0000000..aeeef20
--- /dev/null
+++ b/javatoscachecker/checker/src/test/java/org/onap/tosca/checker/test/CSAR.java
@@ -0,0 +1,35 @@
+package org.onap.tosca.checker.test;
+
+import java.net.URI;
+
+import org.onap.tosca.checker.Checker;
+import org.onap.tosca.checker.Target;
+import org.onap.tosca.checker.Catalog;
+import org.onap.tosca.checker.CSARRepository;
+
+public class CSAR {
+
+ public static void main(String[] theArgs) {
+
+ if (theArgs.length == 0) {
+ System.err.println("You need to specify a CSAR archive to process");
+ return;
+ }
+
+ try {
+ CSARRepository repo = new CSARRepository(theArgs[0], new URI(theArgs[0]));
+ Checker checker = new Checker();
+ checker.setTargetLocator(repo.getTargetLocator());
+ checker.check(repo.mainTarget());
+
+ Catalog cat = checker.catalog();
+ for (Target t: cat.targets()) {
+ System.err.println(t.getLocation() + "\n" + cat.importString(t) + "\n" + t.getReport());
+ }
+ }
+ catch (Exception x) {
+ x.printStackTrace();
+ }
+ }
+
+}
diff --git a/javatoscachecker/checker/src/test/tosca/dcae_uservice_tosca.yaml b/javatoscachecker/checker/src/test/tosca/dcae_uservice_tosca.yaml
new file mode 100644
index 0000000..2c5c028
--- /dev/null
+++ b/javatoscachecker/checker/src/test/tosca/dcae_uservice_tosca.yaml
@@ -0,0 +1,653 @@
+# First attempt at microservice definitions in tosca-yaml.
+# Ted Johnson, Dec. 2015
+## Ralph Knag, config additions , Feb. 2016
+
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+metadata:
+ template_version: 1.0.2
+
+
+data_types:
+########################################################
+### data types related to schemas
+
+ baseFieldDefinition:
+ description: base class for field definitions
+ properties:
+ name:
+ required: true
+ type: string
+ type:
+ required: true
+ type: string
+ constraints:
+ - valid_values: [ string, int, float, ipv4, ipv6, date, date_time, list, map, other]
+ format:
+ required: false
+ type: string
+ default_value:
+ required: false
+ type: string
+ comment:
+ required: false
+ type: string
+ constraints:
+ description: Properties that the field must satisfy
+ required: false
+ type: list
+ entry_schema:
+ type: string
+ constraints:
+ list_delimiter:
+ description: delimiter when list data packed into a string type.
+ required: false
+ type: string
+# subtype can be used for policy override allowed?
+ subType:
+ required: false
+ type : string
+ constraints:
+ - valid_values: [ policyOveride, noPolicyOverride ]
+
+ positionalFieldDefinition:
+ derived_from: baseFieldDefinition
+ description: fields with a fixed-position schema
+ properties:
+ position:
+ required: true
+ type: integer
+ constraints:
+ - greater_or_equal: 0
+
+ pathFieldDefinition:
+ derived_from: baseFieldDefinition
+ description: fields accessed via navigation
+ properties:
+ path:
+ required: true
+ type: string
+
+ fieldDefinition:
+ derived_from: baseFieldDefinition
+ description: positional or path field
+ properties:
+ path:
+ required: false
+ type: string
+ position:
+ required: false
+ type: integer
+ constraints:
+ - greater_or_equal: 0
+ comment:
+ required: false
+ type: string
+ length:
+ required: false
+ type: integer
+ constraints:
+ - greater_than: 0
+
+ fieldList:
+ description: fields in a schema
+ properties:
+ fieldList:
+ required: true
+ type: list
+ entry_schema:
+ type: fieldDefinition
+
+
+
+########################################################
+### data types related to data properties
+
+ sortedBy:
+ description: sorting properties of a data set
+ properties:
+ fields:
+ required: true
+ type: list
+ entry_schema:
+ type: fieldDefinition
+ sorting:
+ required: true
+ type: string
+ default: fullySorted
+ constraints:
+ - valid_values: [ fullySorted, partiallySorted ]
+ lag:
+ description: maximum disorder in a partially sorted
+ required: false
+ type: integer
+ constraints:
+ - greater_or_equal: 0
+
+ keyFields:
+ description: key fields of a data set
+ properties:
+ fields:
+ required: true
+ type: list
+ entry_schema:
+ type: fieldDefinition
+ timestamp:
+ required: false
+ type: integer
+
+###############################################################
+###############################################################
+
+node_types:
+
+ dcaeCatalogNodes:
+ derived_from: tosca.nodes.Root
+ properties:
+ UUID:
+ required: true
+ type: string
+ name:
+ required: true
+ type: string
+ version:
+ required: true
+ type: string
+ constraints:
+ - pattern: \d+[.]\d+[.]\d+
+ schemaVersion:
+ required: false
+ type: integer
+ default: 1
+
+
+########################################################
+### node types related to schemas
+
+
+ baseDataFormat:
+ description: base data format
+ derived_from: dcaeCatalogNodes
+ properties:
+ fieldList:
+ required: true
+ type: list
+ entry_schema:
+ type: fieldDefinition
+ formatType:
+ type: string
+ required: true
+ constraints:
+ - valid_values: [ fixed_format, variable_format, json ]
+ formatSubType:
+ required: true
+ type: string
+ fullList:
+ type: string
+ required: true
+ constraints:
+ - valid_values: [ yes, no ]
+ default: yes
+ capabilities:
+ dataProperties:
+ type: dcaeCatalog.capabilities.dataFormat
+
+ baseVariableDataFormat:
+ derived_from: baseDataFormat
+ description: base class for fixed-position data formats
+ properties:
+ formatType:
+ type: string
+ required: true
+ constraints:
+ - equal: variable_format
+
+
+# probably more needed here - not sure baseDataFormat is sufficient...rhk
+ jsonDataFormat:
+ derived_from: baseVariableDataFormat
+ description: JSON format
+ properties:
+ formatSubType:
+ required: true
+ type: string
+ default: json
+ constraints:
+ - equal: json
+ endOfRecord:
+ required: false
+ type: string
+ numFields:
+ required: false
+ type: integer
+
+ baseFixedDataFormat:
+ derived_from: baseDataFormat
+ description: base class for fixed-position data formats
+ properties:
+ formatType:
+ type: string
+ required: true
+ constraints:
+ - equal: fixed_format
+
+ delimitedAsciiDataFormat:
+ derived_from: baseFixedDataFormat
+ description: delimited ascii format
+ properties:
+ formatSubType:
+ required: true
+ type: string
+ default: delimitedAscii
+ constraints:
+ - equal: delimitedAscii
+ delimiter:
+ required: true
+ type: string
+ default: |
+ endOfRecord:
+ required: false
+ type: string
+ numFields:
+ required: false
+ type: integer
+
+ fixedWidthAsciiDataFormat:
+ derived_from: baseFixedDataFormat
+ description: delimited ascii format
+ properties:
+ formatSubType:
+ required: true
+ type: string
+ default: fixedWidthAscii
+ constraints:
+ - equal: fixedWidthAscii
+ endOfRecord:
+ required: false
+ type: string
+ numFields:
+ required: false
+ type: integer
+
+ fixedBinaryDataFormat:
+ derived_from: baseFixedDataFormat
+ description: binary data, e.g. thrift messages, protocol buffers
+ properties:
+ formatSubType:
+ required: true
+ type: string
+ default: fixedBinaryData
+ constraints:
+ - equal: fixedBinaryData
+ binaryFormat:
+ required: true
+ type: string
+
+
+###############################################
+### Node types related to data properties
+
+ dataProperties:
+ description: Essential non-schema information about a data set
+ derived_from: dcaeCatalogNodes
+ properties:
+ sort:
+ required: false
+ type: sortedBy
+ keys:
+ required: false
+ type: keyFields
+ timestamp:
+ description: the field indicating the time when corresponding event occurred
+ required: false
+ type: string
+ duration:
+ description: the field indicating the length of the described measurement
+ required: false
+ type: string
+ period:
+ description: how often the data is generated. 0 means continuously.
+ required: true
+ type: integer
+ default: 0
+ constraints:
+ - greater_or_equal: 0
+ capabilities:
+ dataProperties:
+ type: dcaeCatalog.capabilities.dataProperties
+
+
+ keyedDataProperties:
+ derived_from: dataProperties
+ description: Data sets that are required to hav a key
+ properties:
+ keys:
+ required: true
+ type: keyFields
+
+ referenceDataProperties:
+ derived_from: dataProperties
+ description: data set from external source that is joined against streaming data
+ properties:
+ updateType:
+ description: how the reference data is refreshed - snapshots, incremental, or both
+ required: true
+ type: string
+
+ keyedReferenceDataProperties:
+ derived_from: referenceDataProperties
+ description: reference data that maps a key to a value, generally with a valid time interval
+ properties:
+ keys:
+ required: true
+ type: keyFields
+ startTimeField:
+ description: the time when the key --> value mapping became valid
+ required: false
+ type: string
+ endTimeField:
+ description: time when the key --> value mapping ceased to be valid
+ required: false
+ type: string
+
+
+#######################################################################
+#### Things which describe how a data source can be accessed
+
+
+
+ dataDelivery:
+ description: the means of connecting to a data source. very incomplete.
+ derived_from: dcaeCatalogNodes
+ properties:
+ deliveryMechanism:
+ description: the general method by which data is delivered from a source.
+ required: true
+ type: string
+ constraints:
+ - valid_values: [stream, file, database, table ]
+ polling:
+ description: push vs. pull
+ required: true
+ type: string
+ constraints:
+ - valid_values: [ push, pull]
+ capabilities:
+ dataDelivery:
+ type: dcaeCatalog.capabilities.dataDelivery
+
+ streamDataDelivery:
+ description: a data source that is a streaming source.
+ derived_from: dataDelivery
+ properties:
+ deliveryMechanism:
+ description: the general method by which data is delivered from a source.
+ required: true
+ type: string
+ constraints:
+ - equal: stream
+ polling:
+ description: push vs. pull
+ required: true
+ type: string
+ constraints:
+ - equal: push
+
+
+ genericCDAPDelivery:
+ description: a streaming data source delivered via the CDAP generic
+ derived_from: streamDataDelivery
+
+
+
+# A UEB stream is kafka plus security TBD
+ dmaapMessageDelivery:
+ description: a streaming data source delivered via a kafka queue
+ derived_from: streamDataDelivery
+ properties:
+ servers:
+ description: the servers to contact to access the kafka queue.
+ required: true
+ type: list
+ entry_schema:
+ type: string
+ constraints:
+ topic:
+ description: the stream identifier (topic in kafka terminology)
+ required: true
+ type: string
+ numPartitions:
+ description: the number of partitions for the kafka topic
+ required: false
+ default: 1
+ type: integer
+ PartitioningMethod:
+ description: the mechanism that assigns records to partitions
+ required: false
+ type: string
+ partitionSubscriptions:
+ description: if specified, the set of partitions that contain a particular substream
+ required: false
+ type: list
+ entry_schema:
+ type: integer
+
+
+ dmaapDataRouterDelivery:
+ description: a data source that is delivered via files.
+ derived_from: dataDelivery
+ properties:
+ deliveryMechanism:
+ description: the general method by which data is delivered from a source.
+ required: true
+ type: string
+ constraints:
+ - valid_values: [file]
+ fileName:
+ description: a name (or naming scheme) of the file
+ required: true
+ type: string
+
+ fileDataDelivery:
+ description: a data source that is delivered via files.
+ derived_from: dataDelivery
+ properties:
+ deliveryMechanism:
+ description: the general method by which data is delivered from a source.
+ required: true
+ type: string
+ constraints:
+ - valid_values: [file]
+ fileName:
+ description: a name (or naming scheme) of the file
+ required: true
+ type: string
+
+ pulledFileDelivery:
+ description: a data source that is delivered via files pulled from an external source
+ derived_from: fileDataDelivery
+ properties:
+ uri:
+ description: the thing to access to get a new file
+ required: true
+ type: string
+ trigger:
+ description: a description of the thing that triggers pulling a new file.
+ required: true
+ type: string
+
+
+
+####################################
+### Description of a data source (data output)
+
+ dataSource:
+ description: a generic data source description, link to schema, properties, delivery
+ derived_from: dcaeCatalogNodes
+# properties:
+ requirements:
+ - dataFormat:
+ capability: dcaeCatalog.capabilities.dataFormat
+ - dataDelivery:
+ capability: dcaeCatalog.capabilities.dataDelivery
+ - dataProperties:
+ capability: dcaeCatalog.capabilities.dataProperties
+ capabilities:
+ dataSource:
+ type: dcaeCatalog.capabilities.dataSource
+ occurrences: [0, UNBOUNDED]
+
+##########################
+### Description of a data requirement (data input)
+ dataRequirement:
+ description: a generic data source description, link to schema, properties, delivery
+ derived_from: dcaeCatalogNodes
+# properties:
+ requirements:
+ - dataFormat:
+ capability: dcaeCatalog.capabilities.dataFormat
+ occurrences: [1, UNBOUNDED]
+ - dataProperties:
+ capability: dcaeCatalog.capabilities.dataProperties
+ - dataDelivery:
+ capability: dcaeCatalog.capabilities.dataDelivery
+ capabilities:
+ dataRequirement:
+ type: dcaeCatalog.capabilities.dataRequirement
+ occurrences: [0, UNBOUNDED]
+
+
+
+
+
+####################################
+### Description of a processingModuleParameters (module parameters excluding input/output descriptions
+### allows any baseDataFormat derived input
+ processingModuleParameters:
+ description:
+ derived_from: baseDataFormat
+ properties:
+ dataType:
+ required: true
+ type: string
+ capabilities:
+ moduleParameters:
+ type: dcaeCatalog.capabilities.processingModuleParameters
+
+
+################################
+### Module Dependencies
+
+ instantiationDependency:
+ description: code dependencies (possible transitive)
+ derived_from: dcaeCatalogNodes
+ properties:
+ dependencyType:
+ required: false
+ type: string
+ constraints:
+ - valid_values: [R, Python, CDAP]
+ dependencyValue:
+ required: true
+ type: string
+ capabilities:
+ dataProperties:
+ type: dcaeCatalog.capabilities.instantiationDependency
+ occurrences: [0, UNBOUNDED]
+ requirements:
+ - dependencies:
+ capability: dcaeCatalog.capabilities.instantiationDependency
+ occurrences: [0, UNBOUNDED]
+
+####################################
+### Description of a processingModuleDeployment - deployment attributes
+
+ processingModuleDeployment:
+ description: deployment attributes
+ derived_from: dcaeCatalogNodes
+ properties:
+ language:
+ required: true
+ type: string
+ version:
+ type: string
+ required: true
+ deploymentType:
+ required: true
+ type: string
+ capabilities:
+ moduleDeployment:
+ type: dcaeCatalog.capabilities.processingModuleDeployment
+ occurrences: [0, UNBOUNDED]
+ requirements:
+ - dependencies:
+ capability: dcaeCatalog.capabilities.instantiationDependency
+ occurrences: [0, UNBOUNDED]
+
+####################################
+### Description of a processingModuleMetaData - search tags
+
+ processingModuleMetadata:
+ description: metadata tags
+ derived_from: dcaeCatalogNodes
+ properties:
+ metaDataList:
+ required: true
+ type: list
+ entry_schema:
+ type: string
+ constraints:
+ capabilities:
+ metadata:
+ type: dcaeCatalog.capabilities.processingModuleMetadata
+ occurrences: [0, UNBOUNDED]
+
+
+####################################
+### Description of a processingModule
+
+ processingModule:
+ description: full processing module description
+ derived_from: dcaeCatalogNodes
+ properties:
+ moduleDescription:
+ required: true
+ type: string
+ requirements:
+ - processingModuleparameters:
+ capability: dcaeCatalog.capabilities.processingModuleParameters
+ occurrences: [0, UNBOUNDED]
+ - processingModuleDeployment:
+ capability: dcaeCatalog.capabilities.processingModuleDeployment
+ occurrences: [1, UNBOUNDED]
+ - processingModuleMetadata:
+ capability: dcaeCatalog.capabilities.processingModuleMetadata
+ occurrences: [1, UNBOUNDED]
+ - dataRequirementsList:
+ capability: dcaeCatalog.capabilities.dataRequirement
+ occurrences: [1, UNBOUNDED]
+ - dataSourcesList:
+ capability: dcaeCatalog.capabilities.dataSource
+ occurrences: [1, UNBOUNDED]
+
+capability_types:
+ dcaeCatalog.capabilities.dataFormat:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.dataProperties:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.dataDelivery:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.instantiationDependency:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.processingModuleMetadata:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.processingModuleParameters:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.processingModuleDeployment:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.dataRequirement:
+ derived_from: tosca.capabilities.Root
+ dcaeCatalog.capabilities.dataSource:
+ derived_from: tosca.capabilities.Root
+
+
diff --git a/javatoscachecker/checker/src/test/tosca/mini_ceil_tosca.yaml b/javatoscachecker/checker/src/test/tosca/mini_ceil_tosca.yaml
new file mode 100644
index 0000000..9879746
--- /dev/null
+++ b/javatoscachecker/checker/src/test/tosca/mini_ceil_tosca.yaml
@@ -0,0 +1,108 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+
+imports:
+ - dcae_uservice_tosca.yaml
+
+topology_template:
+
+ node_templates:
+
+ HostComputeStats_Ceilometer:
+ type: delimitedAsciiDataFormat
+ properties:
+ name: HostComputeStats_Ceilometer
+ UUID: HostComputeStats_Ceilometer
+ version: 1.0.0
+ delimiter: "|"
+ fieldList:
+ -
+ name: DATETIME_FTP_COLLECTION
+ type: date_time
+# subType: 1.0
+ subType: "yyyymmddhhmmss"
+ -
+ name: DATETIME_OSS
+ type: date_time
+ subType: "yyyymmddhhmmss"
+ -
+ name: DATETIMEUTC
+ type: date_time
+ subType: "yyyymmddhhmmss"
+ -
+ name: DATETIMEZONE
+ type: date_time
+ subType: "yyyymmddhhmmss zzz"
+ -
+ name: EMS_NAME
+ type: string
+ comment: "Element Manager System Name?"
+ -
+ name: NE_VERSION
+ type: string
+ comment: "Network Element Version????"
+ -
+ name: PERIOD
+ type: int
+ comment: "Sample period in seconds"
+ -
+ name: SUSPECTFLAG
+ type: string
+ comment: "Data suspect? Null means ok?"
+ -
+ name: SERVICE
+ type: string
+ -
+ name: resourceid
+ type: string
+ -
+ name: hardware.cpu.load.1min
+ type: float
+ comment: "CPU load in in the last one minute"
+ -
+ name: hardware.cpu.load.5min
+ type: float
+ comment: "CPU load in in the last five minutes"
+ -
+ name: hardware.cpu.load.15min
+ type: float
+ comment: "CPU load in in the last fifteen minutes"
+ -
+ name: hardware.cpu.memory.total
+ type: float
+ comment: "Total memory size in KB"
+ -
+ name: hardware.cpu.memory.avail
+ type: float
+ comment: "Memory available in KB"
+ -
+ name: hardware.cpu.swap.total
+ type: float
+ comment: "Total swap size in KB"
+ -
+ name: hardware.cpu.swap.avail
+ type: float
+ comment: "Swap available in KB"
+ -
+ name: hardware.network.ip.incoming.datagrams
+ type: float
+ comment: "Cumulative incoming datagrams"
+ -
+ name: hardware.network.ip.outgoing.datagrams
+ type: float
+ comment: "Cumulative outgoing datagrams"
+ -
+ name: hardware.network.ip.incoming.blocks
+ type: float
+ comment: "Cumulative incoming blocks"
+ -
+ name: hardware.network.ip.outgoing.blocks
+ type: float
+ comment: "Cumulative outgoing blocks"
+ -
+ name: hardware.system_states.cpu.idle
+ type: float
+ comment: "CPU Percent idle"
+ formatType: fixed_format
+ formatSubType: delimitedAscii
+ fullList: true
+ numFields: 22
diff --git a/javatoscachecker/checker/src/test/tosca/ucpe_schema.yml b/javatoscachecker/checker/src/test/tosca/ucpe_schema.yml
new file mode 100644
index 0000000..5c5ac5a
--- /dev/null
+++ b/javatoscachecker/checker/src/test/tosca/ucpe_schema.yml
@@ -0,0 +1,403 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0
+description: CCD uCPE specific data types
+
+metadata:
+ template_name: uCPE_schema
+ template_version: "0.1"
+
+imports:
+ - tosca/tosca-network-types.yaml
+
+data_types:
+
+ routing-rule:
+ properties:
+ logical-interface-name:
+ type: string
+ ip-version:
+ type: string
+ mtu:
+ type: integer
+ is-unnumbered:
+ type: boolean
+ unnumbered-local-address:
+ type: string
+ unnumbered-remote-address:
+ type: string
+ cos-model:
+ type: string
+ pe-shaping:
+ type: string
+ bgp-v4-neighbor-address:
+ type: string
+ bgp-v4-peer-as:
+ type: string
+ bgp-v4-md5-key:
+ type: string
+ bgp-v4-my-as:
+ type: string
+ bgp-v6-neighbor-address:
+ type: string
+ bgp-v6-peer-as:
+ type: string
+ bgp-v6-md5-key:
+ type: string
+ bgp-v6-my-as:
+ type: string
+ bgp-v4-keep-alive-timer:
+ type: string
+ bgp-v6-keep-alive-timer:
+ type: string
+ bgp-v4-hold-timer:
+ type: string
+ bgp-v6-hold-timer:
+ type: string
+ v4-isp-lan-ip-blocks:
+ type: list
+ entry_schema: string
+ v6-isp-lan-ip-blocks:
+ type: list
+ entry_schema: string
+
+node_types:
+
+ com.att.d2.resource.ucpe.networkInterface:
+ derived_from: tosca.nodes.Root
+ properties:
+ service_port_name:
+ type: string
+ physical_port_name:
+ type: string
+ physical_speed:
+ type: integer
+ physical_speed_units:
+ type: string
+ default: "Gbps"
+ requirements:
+ - host:
+ capability: com.att.d2.capabilities.hostedOn
+# node: com.att.d2.resource.uCPE
+ capabilities:
+ link: tosca.capabilities.network.Linkable
+
+#do not know to what degree we still need the two specalized versions below
+ com.att.d2.resource.ucpe.lan_networkInterface:
+ derived_from: com.att.d2.resource.ucpe.networkInterface
+ requirements:
+ - host:
+ capability: com.att.d2.capabilities.hostedOn
+ node: com.att.d2.resource.uCPE
+
+ com.att.d2.resource.ucpe.wan_networkInterface:
+ derived_from: com.att.d2.resource.ucpe.networkInterface
+ properties:
+ internet_connection_type:
+ type: string
+ default: "AVPN"
+ constraints:
+ - valid_values: ["AVPN", "AVPNIVLAN", "3RDPARTYINTERNET", "MIS", "GMIS", "ASE", "ASEOD", "3RDPARTYETHERNET", "3RDPARTYMPLS", "HSIA-E"]
+ requirements:
+ - host:
+ capability: com.att.d2.capabilities.hostedOn
+ node: com.att.d2.resource.uCPE
+
+
+#the participation of a network interface in a VLAN needs to carry a 'tag' attribute (tagged/untagged values)
+#previously we attached this attribute to the Port
+# com.att.d2.resource.ucpe.lan_port:
+# properties:
+# tag:
+# type: string
+# default: "tagged"
+# constraints:
+# - valid_values: [tagged, untagged]
+#
+# now it has to go in the relationship between the networkInterface and the VLAN, i.e. LinksTo
+#
+
+ com.att.d2.resource.ucpe.vlan:
+# can't use as a base type anymore as it has a Linkable capability
+# derived_from: tosca.nodes.network.Network
+ properties:
+ vlan_id:
+ type: string
+ requirements:
+ - link:
+ capability: tosca.capabilities.network.Linkable
+ node: com.att.d2.resource.ucpe.networkInterface
+ relationship: tosca.relationships.network.LinksTo
+ - binding:
+ capability: tosca.capabilities.network.Bindable
+ node: com.att.d2.resource.ucpe.VNF
+ relationship: tosca.relationships.network.BindsTo
+
+
+ #virtual network functions to be hosted by a uCPE
+ com.att.d2.resource.ucpe.VNF:
+ derived_from: tosca.nodes.Root
+ properties:
+ att-part-number:
+ type: string
+ constraints:
+ - max_length: 255
+
+ vendor-name:
+ type: string
+ constraints:
+ - max_length: 255
+ vendor-part-number:
+ type: string
+ constraints:
+ - max_length: 255
+ vendor-model:
+ type: string
+ constraints:
+ - max_length: 255
+ vendor-model-description:
+ type: string
+ constraints:
+ - max_length: 255
+
+ vcpu-default:
+ type: integer
+ constraints:
+ - less_or_equal: 16
+ vcpu-min:
+ type: integer
+ constraints:
+ - less_or_equal: 16
+ vcpu-max:
+ type: integer
+ constraints:
+ - less_or_equal: 16
+
+ vmemory-default:
+ type: integer
+ vmemory-units:
+ type: string
+ default: "GB"
+ vmemory-min:
+ type: integer
+ constraints:
+ - less_or_equal: 16
+ vmemory-max:
+ type: integer
+ constraints:
+ - less_or_equal: 16
+
+ vdisk-default:
+ type: integer
+ vdisk-units:
+ type: string
+ default: "GB"
+ vdisk-min:
+ type: integer
+ constraints:
+ - less_or_equal: 16
+ vdisk-max:
+ type: integer
+ constraints:
+ - less_or_equal: 128
+
+#what is this guy??
+ vnf-type:
+ type: string
+
+ software-version:
+ type: version
+ software-version-state:
+ type: integer
+ software-file-name:
+ type: string
+ constraints:
+ - max_length: 255
+
+ vnf-feature:
+ type: list
+ entry_schema: string
+
+ vnf-instance-id:
+ type: string
+ constraints:
+ - max_length: 255
+
+ management-option:
+ type: string
+ default: ATT
+ constraints:
+ - valid_values: ["CUSTOMER", "ATT"]
+
+ requirements:
+ - host:
+ capability: com.att.d2.capabilities.hostedOn
+
+ capabilities:
+ binding:
+ type: tosca.capabilities.network.Bindable
+ occurrences: [1,UNBOUNDED]
+
+
+ com.att.d2.resource.uCPE: # base node type for uCPE
+ derived_from: tosca.nodes.Root
+ properties:
+ att-part-number:
+ type: string
+ vendor-name:
+ type: string
+ required: true
+ vendor-model:
+ type: string
+ required: true
+
+ total-vcpu:
+ type: integer
+ description: number of vCPUs
+ total-memory:
+ type: integer
+ description: GB
+ total-disk:
+ type: integer
+ description: GB
+
+ base-system-image-file-name:
+ type: string
+ linux-host-vendor:
+ type: string
+ linux-host-os-version:
+ type: version
+ base-system-software:
+ type: string
+ jdm-vcpu:
+ type: integer
+ jdm-memory:
+ type: integer
+ description: GB
+ jdm-disk:
+ type: integer
+ description: GB
+ jdm-version:
+ type: string
+ jcp-vcpu:
+ type: integer
+ jcp-memory:
+ type: integer
+ description: GB
+ jcp-disk:
+ type: integer
+ description: GB
+ jcp-version:
+ type: version
+
+ capabilities:
+ vnf_hosting:
+ type: com.att.d2.capabilities.hostedOn
+ valid_source_types: [com.att.d2.resource.ucpe.VNF]
+ description: Provides hosting capability for VNFs
+ WAN_connectivity:
+ type: com.att.d2.capabilities.hostedOn
+ valid_source_types: [com.att.d2.resource.ucpe.wan_networkInterface]
+ description: external WAN1 n/w interface
+ occurrences: [1,2]
+ LAN_connectivity:
+ type: com.att.d2.capabilities.hostedOn
+ valid_source_types: [com.att.d2.resource.ucpe.lan_networkInterface]
+ description: external LAN n/w interface
+ occurrences: [1,8]
+
+# specific VNFs
+
+ com.att.d2.resource.vRouter:
+ derived_from: com.att.d2.resource.ucpe.VNF
+ properties:
+ management-v6-address:
+ type: string
+ nm-lan-v6-address:
+ type: string
+ nm-lan-v6-prefix-length:
+ type: string
+ management-v4-address:
+ type: string
+ nm-lan-v4-address:
+ type: string
+ nm-lan-v4-prefix-length:
+ type: string
+
+ routing-instance-name:
+ type: string
+ routing-instances:
+ type: map
+ entry_schema:
+ type: routing-rule
+
+ com.att.d2.resource.vWANx:
+ derived_from: com.att.d2.resource.ucpe.VNF
+ properties:
+# att-part-number:
+# type: string
+# default: "VCX-SUB-00255-U"
+ vendor-name:
+ type: string
+ default: "VendorX"
+ vendor-model:
+ type: string
+ default: "WANx-VM00"
+
+ vcpu-default:
+ type: integer
+ default: 1
+ vcpu-min:
+ type: integer
+ default: 1
+ vcpu-max:
+ type: integer
+ default: 1
+
+ vmemory-default:
+ type: integer
+ default: 1
+ vmemory-min:
+ type: integer
+ default: 1
+ vmemory-max:
+ type: integer
+ default: 1
+
+ vdisk-default:
+ type: integer
+ default: 20
+ vdisk-min:
+ type: integer
+ default: 2
+ vdisk-max:
+ type: integer
+ default: 20
+
+ vnf-type:
+ type: string
+ default: "Advanced WANx"
+ software-version:
+ description: "The WANx software version. The value must match the AT&T part number."
+ type: version
+ default: 9.2.0
+
+ software-file-name:
+ type: string
+ default: "vnfImageFilename"
+
+ vnf-instance-id:
+ type: string
+ description: "The WANx hostname."
+
+ com.att.d2.resource.vFW:
+ derived_from: com.att.d2.resource.ucpe.VNF
+
+
+
+############################
+# Customized capability types definitions
+############################
+capability_types:
+
+ com.att.d2.capabilities.hostedOn:
+ derived_from: tosca.capabilities.Root
+
diff --git a/javatoscachecker/checker/src/test/tosca/workflow_1.yaml b/javatoscachecker/checker/src/test/tosca/workflow_1.yaml
new file mode 100644
index 0000000..fda6a27
--- /dev/null
+++ b/javatoscachecker/checker/src/test/tosca/workflow_1.yaml
@@ -0,0 +1,46 @@
+tosca_definitions_version: tosca_simple_yaml_1_1_0
+
+imports:
+ - example: tosca/tosca-examples-types.yaml
+
+topology_template:
+
+ inputs:
+ software_version:
+ type: version
+ default: 0.1
+ management_option:
+ type: string
+ default: ATT
+ constraints:
+ - valid_values: [ ATT, CUSTOMER ]
+
+ node_templates:
+ my_server:
+ type: tosca.nodes.Compute
+ mysql:
+ type: tosca.nodes.DBMS.MySQL
+ requirements:
+ - host: my_server
+ interfaces:
+ tosca.interfaces.nodes.custom.Backup:
+# operations:
+ backup: backup.sh
+ workflows:
+ backup:
+ description: Performs a snapshot of the MySQL data.
+ preconditions:
+ - target: my_server
+ condition:
+ - assert:
+ - state: [{equal: available}]
+ - target: mysql
+ condition:
+ - assert:
+ - state: [{valid_values: [started, available]}]
+ - my_attribute: [{equal: ready }]
+ steps:
+ my_step:
+ target: mysql
+ activities:
+ - call_operation: tosca.interfaces.nodes.custom.Backup.backup