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-user {prefix nemo-user;}
\r
20 revision "2015-10-10" {
\r
22 "Initial revision.";
\r
25 grouping user-intent {
\r
27 "User intent refers to a purpose in getting an ultimate result
\r
28 or performing some specific operation on some objects.";
\r
32 "The element could be operated and managed by users.
\r
33 It inludes resources to construct users' virtual network,
\r
34 and the services in this network.In NEMO project, it is
\r
35 abstracted into node, connection and flow";
\r
39 uses nemo-object:node-instance;
\r
43 key "connection-id";
\r
44 uses nemo-object:connection-instance;
\r
49 uses nemo-object:flow-instance;
\r
53 container operations {
\r
55 "The operation is to dynamically adjust the behavior of network,
\r
56 and it is applied on objects, that is, node, connection and flow";
\r
60 uses nemo-operation:operation-instance;
\r
71 "The list of all known users";
\r
75 "A user is an administrative domain which is
\r
76 logically separated from other users, and each
\r
77 intent is specified by a particular user.";
\r
80 uses nemo-user:user-instance;
\r
85 container query-condition-definitions {
\r
87 "Contains the definitions for all advanced query, which means
\r
88 they are the query with conditions supported by the NEMO engine.
\r
89 User will fetch all results which meet the condition.";
\r
91 list query-condition-definition {
\r
93 "Define the query with condition. For example, user may
\r
94 intent to query all connection's name whose utilization is
\r
95 beyond 80%. That is a query with condition.";
\r
97 key "query-condition-name query-intent-type";
\r
98 leaf query-condition-name {
\r
100 "A user-visible name for the query condition definition.
\r
101 The query condition name is usually to specify the
\r
102 attribute or property of some kind of intent.
\r
103 For the above example, the query-condition-name is utility.";
\r
104 type nemo-common:query-condition-name;
\r
108 leaf query-intent-type {
\r
110 "The target for the query, and its attributes will be checked out
\r
111 if meet the condition. In the above example, connection is the
\r
112 target. So, connection will be the query-intent-type here.";
\r
122 leaf query-condition-value-type {
\r
124 "The type of the target value for the query condition.
\r
125 For the above example, the target-value is 80(%),
\r
126 so the query-condition-value-type will be int.";
\r
131 "A string-valued target value.";
\r
135 "An integer-valued target value.";
\r
139 "An integer-range target value.";
\r
144 container query-condition-match-patterns {
\r
146 "The relationship between the value of query-condition-name
\r
147 and query-condition-target-value. If an intent's attribute
\r
148 or property specified by the query condition name matches
\r
149 to the target value by the match pattern, this intent meets
\r
150 the condition. For the above example, the condition's
\r
151 query-condition-match-patterns could be less-than, not-less-than,
\r
152 equal, not-equal, greater-than, not-greater-than, between.";
\r
154 leaf-list query-condition-match-pattern {
\r
157 enum not-less-than;
\r
161 enum not-greater-than;
\r
169 grouping common-rpc-result {
\r
171 "Common return result for all defined RPCs.";
\r
175 "Result code which is convenient for processing in a program.";
\r
179 "The invoked RPC was executed successfully";
\r
183 "There's an error while executing the RPC";
\r
190 "A human-readable message for an error or exception";
\r
195 grouping query-condition-instance {
\r
197 "A query condition instance generated according to
\r
198 a specified query condition definition.";
\r
200 leaf query-condition-id {
\r
202 "A unique ID for a query condition instance.";
\r
203 type nemo-common:query-condition-id;
\r
207 leaf query-condition-name {
\r
209 "The name of the query condition definition.";
\r
210 type nemo-common:query-condition-name;
\r
214 leaf query-intent-type {
\r
216 "The type of the intents that the user wants to query from through
\r
217 the condition instance.";
\r
227 leaf query-condition-match-pattern {
\r
229 "The match pattern the condition instance will use.";
\r
232 enum not-less-than;
\r
236 enum not-greater-than;
\r
241 container query-condition-target-value {
\r
243 "The target value used to compare with the attribute
\r
244 or property of the intents.";
\r
246 leaf string-value {
\r
254 container range-value {
\r
268 rpc register-user {
\r
270 "Register a user to the user repository.";
\r
273 uses nemo-user:user-instance;
\r
277 uses common-rpc-result;
\r
281 rpc begin-transaction {
\r
283 "Begin a transaction for the user";
\r
286 uses nemo-user:user-instance;
\r
290 uses common-rpc-result;
\r
294 rpc end-transaction {
\r
296 "Commit the user's current transaction";
\r
299 uses nemo-user:user-instance;
\r
303 uses common-rpc-result;
\r
307 rpc language-style-nemo-request {
\r
309 "Create, update or delete an intent of a user through an NEMO statement";
\r
312 uses nemo-user:user-instance;
\r
314 leaf nemo-statement {
\r
320 uses common-rpc-result;
\r
324 rpc structure-style-nemo-update {
\r
326 "Create or update all or a part of the user's intents,
\r
327 which are described as json or xml format.";
\r
330 uses nemo-user:user-instance;
\r
335 uses common-rpc-result;
\r
339 rpc structure-style-nemo-delete {
\r
341 "Delete some intents of a user from the user repository";
\r
344 uses nemo-user:user-instance;
\r
346 container objects {
\r
348 type nemo-common:node-id;
\r
351 leaf-list connection {
\r
352 type nemo-common:connection-id;
\r
356 type nemo-common:flow-id;
\r
360 container operations {
\r
361 leaf-list operation {
\r
362 type nemo-common:operation-id;
\r
366 container results {
\r
372 uses common-rpc-result;
\r
376 rpc advanced-nemo-query {
\r
378 "Query some intents of a user from the user repository
\r
379 according to several advanced query conditions.";
\r
382 uses nemo-user:user-instance;
\r
384 list query-condition {
\r
385 key "query-condition-id";
\r
386 uses query-condition-instance;
\r
391 uses common-rpc-result;
\r