21760a039374dfd03e77279cfa952c64a84719e1
[nemo.git] / nemo-api / src / main / yang / nemo-intent.yang
1 /*\r
2  * Copyright (c) 2015  Huawei Technologies Co., Ltd. and others.  All rights reserved.\r
3  *\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
7  */\r
8  \r
9 module nemo-intent {\r
10         yang-version 1; \r
11         namespace "urn:opendaylight:params:xml:ns:yang:nemo:intent";    \r
12         prefix "nemo-intent";\r
13         \r
14         import nemo-common {prefix nemo-common;}\r
15         import nemo-object {prefix nemo-object;}\r
16         import nemo-operation {prefix nemo-operation;}\r
17         import nemo-result {prefix nemo-result;}\r
18         \r
19         revision "2015-06-29" {\r
20         description\r
21             "Initial revision.";\r
22     }\r
23                 \r
24         grouping intent-instance {\r
25                 description "";\r
26                 leaf intent-id {\r
27                         description "A unique ID for the intent";\r
28                         type nemo-common:intent-id;                     \r
29                         mandatory true;\r
30                 }       \r
31                 leaf intent-name {\r
32                         description "A user-visible name for the intent";\r
33                         type nemo-common:intent-name;\r
34                 }       \r
35                 container objects {\r
36                         description "";\r
37                         list node {\r
38                                 key "node-id";\r
39                                 uses nemo-object:node-instance;\r
40                         }                       \r
41                         list connection {\r
42                                 key "connection-id";\r
43                                 uses nemo-object:connection-instance;\r
44                         }                               \r
45                         list flow {\r
46                                 key "flow-id";\r
47                                 uses nemo-object:flow-instance;\r
48                         }                                                       \r
49                 }\r
50                 \r
51                 container operation {\r
52                         leaf apply-on-object {\r
53                                 type nemo-common:object-id;\r
54                                 mandatory true;\r
55                         }               \r
56                         leaf priority{\r
57                                 type int64;\r
58                                 default 1;\r
59                         }\r
60                         uses nemo-operation:condition-instance;\r
61                         uses nemo-operation:action-instance;\r
62                         uses nemo-operation:constraint-instance;                        \r
63                 }\r
64                 \r
65                 container result{\r
66                         leaf result-to-object {\r
67                                 type nemo-common:object-id;\r
68                                 mandatory true;\r
69                         }               \r
70                         leaf priority{\r
71                                 type int64;\r
72                                 default 1;\r
73                         }\r
74                         choice result-mode {\r
75                                 mandatory true;\r
76                                 case expected-case {\r
77                                         uses nemo-result:expected-instance;\r
78                                 }\r
79                                 case avoid-case{\r
80                                         uses nemo-result:avoid-instance;\r
81                                 }               \r
82                         }                                               \r
83                 }       \r
84                 container contexts{\r
85                         list context {\r
86                                 key "context-id";\r
87                                 leaf context-id {\r
88                                         type nemo-common:context-id;\r
89                                         mandatory true;\r
90                                 }\r
91                                 leaf context-name{\r
92                                         type nemo-common:context-name;\r
93                                         mandatory true;\r
94                                 }\r
95                         }                       \r
96                 }\r
97         }\r
98                 \r
99         container users {\r
100                 description "The list of all known users";\r
101                 list user {\r
102             description "";\r
103             key "user-id";\r
104             leaf user-id {\r
105                 description "A unique ID for the user";             \r
106                 type nemo-common:user-id;\r
107                                 mandatory true;\r
108             }\r
109             leaf user-name {\r
110                 description "A user-visible name for the user";\r
111                 type nemo-common:user-name;\r
112                                 mandatory false;\r
113             }           \r
114                         list intent{\r
115                                 key "intent-id";\r
116                                 uses intent-instance;\r
117                                 min-elements 1;\r
118                         }\r
119                 }               \r
120         }\r
121         \r
122         rpc register-node-instance {\r
123             description "";\r
124                 input {\r
125                         uses nemo-object:node-instance;\r
126                 }\r
127         }\r
128         \r
129         rpc unregister-node-instance {\r
130             description "";\r
131                 input {\r
132                         uses nemo-object:node-instance;\r
133                 }\r
134         }\r
135                 \r
136 }