Patrick Brady | 10bba35 | 2017-07-19 12:09:28 -0700 | [diff] [blame] | 1 | /*- |
| 2 | * ============LICENSE_START======================================================= |
| 3 | * ONAP : APPC |
| 4 | * ================================================================================ |
| 5 | * Copyright (C) 2017 AT&T Intellectual Property. All rights reserved. |
| 6 | * ================================================================================ |
| 7 | * Copyright (C) 2017 Amdocs |
| 8 | * ============================================================================= |
| 9 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 10 | * you may not use this file except in compliance with the License. |
| 11 | * You may obtain a copy of the License at |
| 12 | * |
| 13 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 14 | * |
| 15 | * Unless required by applicable law or agreed to in writing, software |
| 16 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 17 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 18 | * See the License for the specific language governing permissions and |
| 19 | * limitations under the License. |
| 20 | * |
| 21 | * ECOMP is a trademark and service mark of AT&T Intellectual Property. |
| 22 | * ============LICENSE_END========================================================= |
| 23 | */ |
| 24 | |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 25 | /* |
| 26 | * Yang model for the OAM component of Application Controller (APP-C) component of ONAP |
| 27 | * |
| 28 | * This model is used to define the data and services of the OAM component of APP-C. |
| 29 | * |
| 30 | * The services exposed by this component are: |
| 31 | * |
| 32 | * get-metrics: |
| 33 | * Used to retrieve current metric data from APP-C. |
| 34 | * |
| 35 | */ |
| 36 | |
| 37 | module appc-oam { |
| 38 | |
| 39 | yang-version 1; |
Patrick Brady | 0756759 | 2017-12-13 11:09:30 -0800 | [diff] [blame] | 40 | namespace "org:onap:appc:oam"; |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 41 | prefix appc-oam; |
| 42 | organization "Copyright 2017 AT&T Intellectual Property."; |
| 43 | |
| 44 | description |
| 45 | "Defines the services and request/response requirements for the |
| 46 | APP-C OAM component."; |
| 47 | |
| 48 | /* |
| 49 | * Note, the revision changes the package name of the generated java code. Do not |
| 50 | * change the revision unless you also update all references to the bindings. |
| 51 | */ |
| 52 | revision "2017-03-03" { |
| 53 | description |
| 54 | "APP-C OAM interface version 1.5.00"; |
| 55 | } |
| 56 | |
| 57 | grouping common-header { |
| 58 | description "A common header for all APP-C requests"; |
| 59 | container common-header { |
| 60 | description "A common header for all APP-C requests"; |
| 61 | |
| 62 | leaf originator-id { |
| 63 | description "originator-id an identifier of the calling system which can be |
| 64 | used addressing purposes, i.e. returning asynchronous response |
| 65 | to the proper destination over UEB (especially in case of multiple |
| 66 | consumers of APP-C APIs)"; |
| 67 | type string; |
| 68 | mandatory true; |
| 69 | } |
| 70 | |
| 71 | leaf request-id { |
| 72 | description "UUID for the request ID. An OSS/BSS identifier for the request |
| 73 | that caused the current action. Multiple API calls may be made |
| 74 | with the same request-id The request-id shall be recorded throughout |
| 75 | the operations on a single request"; |
| 76 | type string; |
| 77 | mandatory true; |
| 78 | } |
| 79 | |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 80 | container flags { |
| 81 | leaf request-timeout { |
| 82 | description "The allowed time in seconds to perform the request. If the request cannot |
| 83 | be completed in this amount of time, the request is aborted with OAM state set |
| 84 | to Error. If set to zero, no timeout exists and the request will be handled |
| 85 | continue until operation completes or fails. If omitted, the default value of |
| 86 | 20 is used."; |
| 87 | type uint16; |
| 88 | mandatory false; |
| 89 | } |
| 90 | } |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 91 | } |
| 92 | } |
| 93 | |
| 94 | grouping status { |
mojahidi | 3df3182 | 2017-08-29 18:20:26 +0530 | [diff] [blame] | 95 | description "The specific response codes are to be aligned with SDC reference |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 96 | doc (main table removed to avoid duplication and digression from |
mojahidi | 3df3182 | 2017-08-29 18:20:26 +0530 | [diff] [blame] | 97 | main table). See SDC and ECOMP Distribution Consumer Interface |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 98 | Agreement"; |
| 99 | container status { |
mojahidi | 3df3182 | 2017-08-29 18:20:26 +0530 | [diff] [blame] | 100 | description "The specific response codes are to be aligned with SDC reference |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 101 | doc (main table removed to avoid duplication and digression from |
mojahidi | 3df3182 | 2017-08-29 18:20:26 +0530 | [diff] [blame] | 102 | main table). See SDC and ECOMP Distribution Consumer Interface |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 103 | Agreement"; |
| 104 | leaf code { |
| 105 | description "Response code"; |
| 106 | type uint16; |
| 107 | mandatory true; |
| 108 | } |
| 109 | leaf message { |
| 110 | description "Response message"; |
| 111 | type string; |
| 112 | mandatory true; |
| 113 | } |
| 114 | } |
| 115 | } |
| 116 | |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 117 | typedef appc-state { |
| 118 | type enumeration { |
| 119 | enum "Error"; |
| 120 | enum "Unknown"; |
| 121 | enum "Not_Instantiated"; // Equivalent to Bundle's UNINSTALL |
| 122 | enum "Instantiated"; // Equivalent to Bundle's INSTALL |
| 123 | enum "Starting"; |
| 124 | enum "Started"; |
| 125 | enum "EnteringMaintenanceMode"; |
| 126 | enum "MaintenanceMode"; |
| 127 | enum "Stopping"; |
| 128 | enum "Stopped"; |
| 129 | enum "Restarting"; |
| 130 | } |
| 131 | description "Refers to the various states an APP-C instance can be in"; |
| 132 | } |
| 133 | |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 134 | rpc get-metrics { |
| 135 | description "An operation to get list of registered Metrics in APP-C"; |
| 136 | output { |
| 137 | list metrics { |
| 138 | key kpi-name; |
| 139 | description "KPI metrics definition"; |
| 140 | leaf kpi-name { |
| 141 | description "metrics name"; |
| 142 | type string; |
| 143 | mandatory true; |
| 144 | } |
| 145 | leaf last-reset-time { |
| 146 | description "Last reset time"; |
| 147 | type string; |
| 148 | mandatory true; |
| 149 | } |
| 150 | list kpi-values { |
| 151 | key name; |
| 152 | description "KPI properties in form of key value pairs"; |
| 153 | leaf name { |
| 154 | description "KPI property name"; |
| 155 | type string; |
| 156 | } |
| 157 | leaf value { |
| 158 | description "KPI property value"; |
| 159 | type string; |
| 160 | } |
| 161 | } |
| 162 | } |
| 163 | } |
| 164 | } |
| 165 | |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 166 | rpc maintenance-mode { |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 167 | description "An operation that disables appc-provider-lcm so that it no longer accepts LCM request. This |
| 168 | operation has no impact on queued and currently executing LCM request. A notification will be |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 169 | sent out indicating the APP-C is idle once all LCM request have completed execution."; |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 170 | input { |
| 171 | uses common-header; |
| 172 | } |
| 173 | output { |
| 174 | uses common-header; |
| 175 | uses status; |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | rpc start { |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 180 | description "An operation that enables appc-provider-lcm so that it can begin to accepts LCM request. This |
| 181 | includes starting any appc bundles which are stopped."; |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 182 | input { |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 183 | uses common-header; |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 184 | } |
| 185 | output { |
| 186 | uses common-header; |
| 187 | uses status; |
| 188 | } |
| 189 | } |
beili.zhou | 9adb43f | 2017-08-11 22:16:05 -0400 | [diff] [blame] | 190 | |
| 191 | rpc get-appc-state { |
| 192 | description "Returns the current state of the running APPC LCM instance"; |
| 193 | output { |
| 194 | leaf state { |
| 195 | type appc-state; |
| 196 | } |
| 197 | } |
| 198 | } |
| 199 | |
| 200 | rpc stop { |
| 201 | description "Force stops the APPC bundles that accept LCM requests"; |
| 202 | // Note: OAM feature bundles and it's dependencies (Appc-common and LifeCycle Manager) would continue to run |
| 203 | input { |
| 204 | uses common-header; |
| 205 | } |
| 206 | output { |
| 207 | uses common-header; |
| 208 | uses status; |
| 209 | } |
| 210 | } |
| 211 | |
| 212 | rpc restart { |
| 213 | description "An operation that restarts APPC by invoking the stop rpc followed by the start rpc."; |
| 214 | input { |
| 215 | uses common-header; |
| 216 | } |
| 217 | output { |
| 218 | uses common-header; |
| 219 | uses status; |
| 220 | } |
| 221 | } |
Patrick Brady | c7d0075 | 2017-06-01 10:45:37 -0700 | [diff] [blame] | 222 | } |