2 * Copyright (c) 2015 Huawei, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
12 namespace "urn:opendaylight:params:xml:ns:yang:nemo:intent";
\r
13 prefix "nemo-intent";
\r
15 import nemo-common {prefix nemo-common;}
\r
16 import nemo-object {prefix nemo-object;}
\r
17 import nemo-operation {prefix nemo-operation;}
\r
18 import nemo-template {prefix nemo-template;}
\r
19 import nemo-user {prefix nemo-user;}
\r
21 revision "2015-10-10" {
\r
23 "Initial revision.";
\r
26 grouping user-intent {
\r
28 "User intent refers to a purpose in getting an ultimate result
\r
29 or performing some specific operation on some objects.";
\r
33 "The element could be operated and managed by users.
\r
34 It inludes resources to construct users' virtual network,
\r
35 and the services in this network.In NEMO project, it is
\r
36 abstracted into node, connection and flow";
\r
40 uses nemo-object:node-instance;
\r
44 key "connection-id";
\r
45 uses nemo-object:connection-instance;
\r
50 uses nemo-object:flow-instance;
\r
54 container operations {
\r
56 "The operation is to dynamically adjust the behavior of network,
\r
57 and it is applied on objects, that is, node, connection and flow";
\r
61 uses nemo-operation:operation-instance;
\r
69 container template-definitions {
\r
71 "Contains all templates that the user defined. A
\r
72 template defines a reusable function which could
\r
73 be used many times.";
\r
75 list template-definition {
\r
76 key "template-name";
\r
77 uses nemo-template:template-definition-grouping;
\r
81 container template-instances {
\r
83 "Contains all template instances that the user configured.
\r
84 A template instance is to put specific values in the
\r
85 parameter list of the definition.";
\r
87 list template-instance {
\r
88 key "template-instance-id";
\r
89 uses nemo-template:template-instance-grouping;
\r
96 "The list of all known users";
\r
100 "A user is an administrative domain which is
\r
101 logically separated from other users, and each
\r
102 intent is specified by a particular user.";
\r
105 uses nemo-user:user-instance;
\r
110 container query-condition-definitions {
\r
112 "Contains the definitions for all advanced query, which means
\r
113 they are the query with conditions supported by the NEMO engine.
\r
114 User will fetch all results which meet the condition.";
\r
116 list query-condition-definition {
\r
118 "Define the query with condition. For example, user may
\r
119 intent to query all connection's name whose utilization is
\r
120 beyond 80%. That is a query with condition.";
\r
122 key "query-condition-name query-intent-type";
\r
123 leaf query-condition-name {
\r
125 "A user-visible name for the query condition definition.
\r
126 The query condition name is usually to specify the
\r
127 attribute or property of some kind of intent.
\r
128 For the above example, the query-condition-name is utility.";
\r
129 type nemo-common:query-condition-name;
\r
133 leaf query-intent-type {
\r
135 "The target for the query, and its attributes will be checked out
\r
136 if meet the condition. In the above example, connection is the
\r
137 target. So, connection will be the query-intent-type here.";
\r
147 leaf query-condition-value-type {
\r
149 "The type of the target value for the query condition.
\r
150 For the above example, the target-value is 80(%),
\r
151 so the query-condition-value-type will be int.";
\r
156 "A string-valued target value.";
\r
160 "An integer-valued target value.";
\r
164 "An integer-range target value.";
\r
169 container query-condition-match-patterns {
\r
171 "The relationship between the value of query-condition-name
\r
172 and query-condition-target-value. If an intent's attribute
\r
173 or property specified by the query condition name matches
\r
174 to the target value by the match pattern, this intent meets
\r
175 the condition. For the above example, the condition's
\r
176 query-condition-match-patterns could be less-than, not-less-than,
\r
177 equal, not-equal, greater-than, not-greater-than, between.";
\r
179 leaf-list query-condition-match-pattern {
\r
182 enum not-less-than;
\r
186 enum not-greater-than;
\r
194 grouping common-rpc-result {
\r
196 "Common return result for all defined RPCs.";
\r
200 "Result code which is convenient for processing in a program.";
\r
204 "The invoked RPC was executed successfully";
\r
208 "There's an error while executing the RPC";
\r
215 "A human-readable message for an error or exception";
\r
220 grouping query-condition-instance {
\r
222 "A query condition instance generated according to
\r
223 a specified query condition definition.";
\r
225 leaf query-condition-id {
\r
227 "A unique ID for a query condition instance.";
\r
228 type nemo-common:query-condition-id;
\r
232 leaf query-condition-name {
\r
234 "The name of the query condition definition.";
\r
235 type nemo-common:query-condition-name;
\r
239 leaf query-intent-type {
\r
241 "The type of the intents that the user wants to query from through
\r
242 the condition instance.";
\r
252 leaf query-condition-match-pattern {
\r
254 "The match pattern the condition instance will use.";
\r
257 enum not-less-than;
\r
261 enum not-greater-than;
\r
266 container query-condition-target-value {
\r
268 "The target value used to compare with the attribute
\r
269 or property of the intents.";
\r
271 leaf string-value {
\r
279 container range-value {
\r
293 rpc register-user {
\r
295 "Register a user to the user repository.";
\r
298 uses nemo-user:user-instance;
\r
302 uses common-rpc-result;
\r
306 rpc begin-transaction {
\r
308 "Begin a transaction for the user";
\r
311 uses nemo-user:user-instance;
\r
315 uses common-rpc-result;
\r
319 rpc end-transaction {
\r
321 "Commit the user's current transaction";
\r
324 uses nemo-user:user-instance;
\r
328 uses common-rpc-result;
\r
332 rpc language-style-nemo-request {
\r
334 "Create, update or delete an intent of a user through an NEMO statement";
\r
337 uses nemo-user:user-instance;
\r
339 leaf nemo-statement {
\r
345 uses common-rpc-result;
\r
349 rpc structure-style-nemo-update {
\r
351 "Create or update all or a part of the user's intents,
\r
352 which are described as json or xml format.";
\r
355 uses nemo-user:user-instance;
\r
360 uses common-rpc-result;
\r
364 rpc structure-style-nemo-delete {
\r
366 "Delete some intents of a user from the user repository";
\r
369 uses nemo-user:user-instance;
\r
371 container objects {
\r
373 type nemo-common:node-id;
\r
376 leaf-list connection {
\r
377 type nemo-common:connection-id;
\r
381 type nemo-common:flow-id;
\r
385 container operations {
\r
386 leaf-list operation {
\r
387 type nemo-common:operation-id;
\r
391 container results {
\r
397 uses common-rpc-result;
\r
401 rpc advanced-nemo-query {
\r
403 "Query some intents of a user from the user repository
\r
404 according to several advanced query conditions.";
\r
407 uses nemo-user:user-instance;
\r
409 list query-condition {
\r
410 key "query-condition-id";
\r
411 uses query-condition-instance;
\r
416 uses common-rpc-result;
\r