type unique-id;\r
}\r
\r
+ typedef constraint-segment-id {\r
+ description\r
+ "A unique ID for a segment of the constraint in an operation.";\r
+ type unique-id;\r
+ }\r
+\r
typedef query-condition-id {\r
description\r
"A unique ID for a condition of the advanced query.";\r
type unique-id;\r
}\r
\r
+ typedef template-instance-id {\r
+ description\r
+ "A unique ID for a template instance.";\r
+ type unique-id;\r
+ }\r
+\r
// *********************\r
// * Names\r
// *********************\r
type name;\r
}\r
\r
+ typedef constraint-parameter-name {\r
+ description\r
+ "A name for a parameter of constraint.";\r
+ type name;\r
+ }\r
+\r
typedef user-name {\r
description\r
"A name for a user.";\r
type string;\r
}\r
\r
+ typedef template-name {\r
+ description\r
+ "A unique name for a template";\r
+ type name;\r
+ }\r
+\r
+ typedef template-instance-name {\r
+ description\r
+ "A unique name for a template instance.";\r
+ type name;\r
+ }\r
+\r
// *********************\r
// * Types\r
// *********************\r
}\r
}\r
\r
+ container constraint-parameter-definitions {\r
+ list constraint-parameter-definition {\r
+ description\r
+ "Defines the constraint parameter with its metadata.";\r
+\r
+ key "parameter-name";\r
+ leaf parameter-name {\r
+ description\r
+ "A name for the constraint parameter.";\r
+ type nemo-common:parameter-name;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf parameter-value-type {\r
+ description\r
+ "A type of value for the constraint parameter.";\r
+ type enumeration {\r
+ enum string {\r
+ description\r
+ "A string-valued parameter.";\r
+ }\r
+ enum int {\r
+ description\r
+ "An integer-valued parameter.";\r
+ }\r
+ enum range {\r
+ description\r
+ "An integer-range parameter.";\r
+ }\r
+ }\r
+ }\r
+\r
+ container parameter-match-patterns {\r
+ description\r
+ "Defines the match patterns of the constraint parameter.";\r
+\r
+ leaf-list parameter-match-pattern {\r
+ type enumeration {\r
+ enum less-than;\r
+ enum not-less-than;\r
+ enum equal;\r
+ enum not-equal;\r
+ enum greater-than;\r
+ enum not-greater-than;\r
+ enum between;\r
+ enum periodical;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
container action-definitions {\r
list action-definition {\r
description\r
}\r
}\r
\r
+ grouping constraint-instance {\r
+ description\r
+ "Specific a instance of constraint whose metadata has been filled in.";\r
+\r
+ list constraint-segment {\r
+ description\r
+ "The segment entities will be composed into a whole constraint entity.\r
+ Each segment will be a sub expression of the constraint.";\r
+\r
+ key "constraint-segment-id";\r
+ leaf constraint-segment-id {\r
+ description\r
+ "A unique ID for a constraint segment.";\r
+ type nemo-common:constraint-segment-id;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf constraint-parameter-name {\r
+ description\r
+ "A name for a constraint parameter.";\r
+ type nemo-common:constraint-parameter-name;\r
+ }\r
+\r
+ leaf constraint-parameter-match-pattern {\r
+ description\r
+ "The operator for the constraint parameter and it's target value.";\r
+ type enumeration {\r
+ enum less-than;\r
+ enum not-less-than;\r
+ enum equal;\r
+ enum not-equal;\r
+ enum greater-than;\r
+ enum not-greater-than;\r
+ enum between;\r
+ enum periodical;\r
+ }\r
+ }\r
+\r
+ container constraint-parameter-target-value {\r
+ description\r
+ "The target value of constraint parameter.";\r
+\r
+ leaf string-value {\r
+ type string;\r
+ }\r
+\r
+ leaf int-value {\r
+ type int64;\r
+ }\r
+\r
+ container range-value {\r
+ leaf min {\r
+ type int64;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf max {\r
+ type int64;\r
+ mandatory true;\r
+ }\r
+\r
+ }\r
+ }\r
+\r
+ leaf precursor-relation-operator {\r
+ description\r
+ "The logical operator between current segment and the next segment.";\r
+ type enumeration {\r
+ enum none;\r
+ enum and;\r
+ enum or;\r
+ enum not;\r
+ }\r
+ }\r
+\r
+ leaf order {\r
+ description\r
+ "The order of the segment in the whole constraint entity.";\r
+ type uint32;\r
+ }\r
+ }\r
+ }\r
+\r
grouping action-instance {\r
description\r
"Specific a action instance whose metadata has been filled in.";\r
}\r
\r
uses condition-instance;\r
+ uses constraint-instance;\r
\r
list action {\r
description\r
--- /dev/null
+/*\r
+ * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.\r
+ *\r
+ * This program and the accompanying materials are made available under the\r
+ * terms of the Eclipse Public License v1.0 which accompanies this distribution,\r
+ * and is available at http://www.eclipse.org/legal/epl-v10.html\r
+ */\r
+\r
+module nemo-template {\r
+ yang-version 1;\r
+\r
+ namespace "urn:opendaylight:params:xml:ns:yang:nemo:template";\r
+ prefix "nemo-template";\r
+\r
+ import nemo-common {prefix nemo-common;}\r
+ import nemo-object {prefix nemo-object;}\r
+ import nemo-operation {prefix nemo-operation;}\r
+\r
+ revision "2015-12-01" {\r
+ description\r
+ "Initial revision.";\r
+ }\r
+\r
+ grouping template-definition {\r
+ description\r
+ "It represents the node model instance and its metadata.\r
+ A node model defines a reusable function or template\r
+ which could be used many times.";\r
+\r
+ leaf template-name {\r
+ description\r
+ "A unique name for a template.";\r
+ type nemo-common:template-name;\r
+ mandatory true;\r
+ }\r
+\r
+ container abstract-intents {\r
+ description\r
+ "All abstract intents included in this template.";\r
+\r
+ container abstract-objects {\r
+ description\r
+ "The element could be operated and managed by users.\r
+ It includes resources to construct users' virtual networks,\r
+ and the services in this network. In NEMO project, it is\r
+ abstracted into node, connection and flow.";\r
+\r
+ list abstract-node {\r
+ key "node-id";\r
+ uses nemo-object:node-instance;\r
+ }\r
+\r
+ list abstract-connection {\r
+ key "connection-id";\r
+ uses nemo-object:connection-instance;\r
+ }\r
+\r
+ list abstract-flow {\r
+ key "flow-id";\r
+ uses nemo-object:flow-instance;\r
+ }\r
+ }\r
+\r
+ container abstract-operations {\r
+ description\r
+ "The operation is to dynamically adjust the behavior of network,\r
+ and it is applied on objects, that is, node, connection and flow.";\r
+\r
+ list abstract-operation {\r
+ key "operation-id";\r
+ uses nemo-operation:operation-instance;\r
+ }\r
+ }\r
+\r
+ container abstract-results {\r
+ // TBD\r
+ }\r
+ }\r
+\r
+ list template-parameter {\r
+ description\r
+ "List all the parameters included in the template. That is,\r
+ other instance could have different values when instancing the\r
+ template.";\r
+\r
+ key "parameter-name";\r
+ leaf parameter-name {\r
+ description\r
+ "The name of the parameter.";\r
+ type nemo-common:parameter-name;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf parameter-value-type {\r
+ description\r
+ "List all value types could exist in the parameters.";\r
+ default string;\r
+ type enumeration {\r
+ enum string {\r
+ description\r
+ "An string-valued property.";\r
+ }\r
+ enum int {\r
+ description\r
+ "An integer-valued property.";\r
+ }\r
+ enum range {\r
+ description\r
+ "An integer-range property.";\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+\r
+ grouping template-instance {\r
+ description\r
+ "A template instance which put specific values in the parameter list.";\r
+\r
+ leaf template-instance-id {\r
+ description\r
+ "A unique identifier for the template instance.";\r
+ type nemo-common:template-instance-id;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf template-instance-name {\r
+ description\r
+ "A unique name for the template instance.";\r
+ type nemo-common:template-instance-name;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf template-name {\r
+ description\r
+ "The template name instanced by this template instance.";\r
+ type nemo-common:template-name;\r
+ mandatory true;\r
+ }\r
+\r
+ list template-parameter {\r
+ description\r
+ "All specific parameters putted by this instance.";\r
+\r
+ key "parameter-name";\r
+ leaf parameter-name {\r
+ description\r
+ "The name of the parameter.";\r
+ type nemo-common:parameter-name;\r
+ mandatory true;\r
+ }\r
+\r
+ container parameter-values {\r
+ description\r
+ "The values for the parameter.";\r
+\r
+ list string-value {\r
+ key "value order";\r
+ leaf value {\r
+ type string;\r
+ }\r
+\r
+ leaf order {\r
+ type uint32;\r
+ }\r
+ }\r
+\r
+ list int-value {\r
+ key "value order";\r
+ leaf value {\r
+ type int64;\r
+ }\r
+\r
+ leaf order {\r
+ type uint32;\r
+ }\r
+ }\r
+\r
+ container range-value {\r
+ leaf min {\r
+ type int64;\r
+ mandatory true;\r
+ }\r
+\r
+ leaf max {\r
+ type int64;\r
+ mandatory true;\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+}\r