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
70 uses nemo-template:template-definition;
\r
73 container template-instances {
\r
74 uses nemo-template:template-instance;
\r
80 "The list of all known users";
\r
84 "A user is an administrative domain which is
\r
85 logically separated from other users, and each
\r
86 intent is specified by a particular user.";
\r
89 uses nemo-user:user-instance;
\r
94 container query-condition-definitions {
\r
96 "Contains the definitions for all advanced query, which means
\r
97 they are the query with conditions supported by the NEMO engine.
\r
98 User will fetch all results which meet the condition.";
\r
100 list query-condition-definition {
\r
102 "Define the query with condition. For example, user may
\r
103 intent to query all connection's name whose utilization is
\r
104 beyond 80%. That is a query with condition.";
\r
106 key "query-condition-name query-intent-type";
\r
107 leaf query-condition-name {
\r
109 "A user-visible name for the query condition definition.
\r
110 The query condition name is usually to specify the
\r
111 attribute or property of some kind of intent.
\r
112 For the above example, the query-condition-name is utility.";
\r
113 type nemo-common:query-condition-name;
\r
117 leaf query-intent-type {
\r
119 "The target for the query, and its attributes will be checked out
\r
120 if meet the condition. In the above example, connection is the
\r
121 target. So, connection will be the query-intent-type here.";
\r
131 leaf query-condition-value-type {
\r
133 "The type of the target value for the query condition.
\r
134 For the above example, the target-value is 80(%),
\r
135 so the query-condition-value-type will be int.";
\r
140 "A string-valued target value.";
\r
144 "An integer-valued target value.";
\r
148 "An integer-range target value.";
\r
153 container query-condition-match-patterns {
\r
155 "The relationship between the value of query-condition-name
\r
156 and query-condition-target-value. If an intent's attribute
\r
157 or property specified by the query condition name matches
\r
158 to the target value by the match pattern, this intent meets
\r
159 the condition. For the above example, the condition's
\r
160 query-condition-match-patterns could be less-than, not-less-than,
\r
161 equal, not-equal, greater-than, not-greater-than, between.";
\r
163 leaf-list query-condition-match-pattern {
\r
166 enum not-less-than;
\r
170 enum not-greater-than;
\r
178 grouping common-rpc-result {
\r
180 "Common return result for all defined RPCs.";
\r
184 "Result code which is convenient for processing in a program.";
\r
188 "The invoked RPC was executed successfully";
\r
192 "There's an error while executing the RPC";
\r
199 "A human-readable message for an error or exception";
\r
204 grouping query-condition-instance {
\r
206 "A query condition instance generated according to
\r
207 a specified query condition definition.";
\r
209 leaf query-condition-id {
\r
211 "A unique ID for a query condition instance.";
\r
212 type nemo-common:query-condition-id;
\r
216 leaf query-condition-name {
\r
218 "The name of the query condition definition.";
\r
219 type nemo-common:query-condition-name;
\r
223 leaf query-intent-type {
\r
225 "The type of the intents that the user wants to query from through
\r
226 the condition instance.";
\r
236 leaf query-condition-match-pattern {
\r
238 "The match pattern the condition instance will use.";
\r
241 enum not-less-than;
\r
245 enum not-greater-than;
\r
250 container query-condition-target-value {
\r
252 "The target value used to compare with the attribute
\r
253 or property of the intents.";
\r
255 leaf string-value {
\r
263 container range-value {
\r
277 rpc register-user {
\r
279 "Register a user to the user repository.";
\r
282 uses nemo-user:user-instance;
\r
286 uses common-rpc-result;
\r
290 rpc begin-transaction {
\r
292 "Begin a transaction for the user";
\r
295 uses nemo-user:user-instance;
\r
299 uses common-rpc-result;
\r
303 rpc end-transaction {
\r
305 "Commit the user's current transaction";
\r
308 uses nemo-user:user-instance;
\r
312 uses common-rpc-result;
\r
316 rpc language-style-nemo-request {
\r
318 "Create, update or delete an intent of a user through an NEMO statement";
\r
321 uses nemo-user:user-instance;
\r
323 leaf nemo-statement {
\r
329 uses common-rpc-result;
\r
333 rpc structure-style-nemo-update {
\r
335 "Create or update all or a part of the user's intents,
\r
336 which are described as json or xml format.";
\r
339 uses nemo-user:user-instance;
\r
344 uses common-rpc-result;
\r
348 rpc structure-style-nemo-delete {
\r
350 "Delete some intents of a user from the user repository";
\r
353 uses nemo-user:user-instance;
\r
355 container objects {
\r
357 type nemo-common:node-id;
\r
360 leaf-list connection {
\r
361 type nemo-common:connection-id;
\r
365 type nemo-common:flow-id;
\r
369 container operations {
\r
370 leaf-list operation {
\r
371 type nemo-common:operation-id;
\r
375 container results {
\r
381 uses common-rpc-result;
\r
385 rpc advanced-nemo-query {
\r
387 "Query some intents of a user from the user repository
\r
388 according to several advanced query conditions.";
\r
391 uses nemo-user:user-instance;
\r
393 list query-condition {
\r
394 key "query-condition-id";
\r
395 uses query-condition-instance;
\r
400 uses common-rpc-result;
\r