3 * Copyright 2016-2017 RIFT.IO Inc
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
21 * @file rw-pkg-mgmt.yang
22 * @author Varun Prasad
24 * @brief Pacakage Management Yang
29 namespace "http://riftio.com/ns/riftware-1.0/rw-pkg-mgmt";
32 import ietf-yang-types {
60 import rw-project-vnfd {
61 prefix "rw-project-vnfd";
64 import rw-project-nsd {
65 prefix "rw-project-nsd";
72 import rw-project-mano {
73 prefix "rw-project-mano";
78 "Update model to support projects.";
97 typedef package-file-type {
108 typedef vnfd-file-type {
121 typedef nsd-file-type {
130 typedef export-schema {
137 typedef export-grammar {
144 typedef export-format {
151 grouping external-url-data {
153 description "Url to download";
158 description "username if the url uses authentication";
163 description "password if the url uses authentication";
168 grouping package-identifer {
170 description "Type of the package";
171 type manotypes:package-type;
175 description "Id of the package";
180 grouping package-file-identifer {
181 uses package-identifer;
184 description "Relative path in the package";
189 grouping download-task-status {
191 description "The status of the download task";
197 description "Detailed download status message";
201 leaf progress-percent {
202 description "The download progress percentage (0-100)";
207 leaf bytes_downloaded {
208 description "The number of bytes downloaded";
214 description "The total number of bytes to write";
219 leaf bytes_per_second {
220 description "The total number of bytes written per second";
226 description "start time (unix epoch)";
231 description "stop time (unix epoch)";
236 grouping copy-task-status {
238 description "The status of the copy task";
244 augment "/rw-project:project" {
245 container download-jobs {
246 description "Download jobs";
253 description "Unique UUID";
258 description "URL of the download";
262 uses package-file-identifer;
263 uses download-task-status;
267 container copy-jobs {
268 description "Copy jobs";
272 key "transaction-id";
274 leaf transaction-id {
275 description "Unique UUID";
279 uses copy-task-status;
283 container create-jobs {
284 description "Create jobs";
288 key "transaction-id";
290 leaf transaction-id {
291 description "Unique UUID";
295 uses copy-task-status;
299 container update-jobs {
300 description "Update jobs";
304 key "transaction-id";
306 leaf transaction-id {
307 description "Unique UUID";
311 uses copy-task-status;
317 rpc get-package-endpoint {
318 description "Retrieves the endpoint for the descriptor";
321 uses package-identifer;
322 uses manotypes:rpc-project-name;
327 description "Endpoint that contains all the package-related data";
334 description "Copies the package specified in input and returns the copied package id";
337 uses package-identifer;
340 description "Name of destination package";
344 uses manotypes:rpc-project-name;
348 leaf transaction-id {
349 description "Valid ID to track the status of the task";
353 uses package-identifer;
357 rpc get-package-schema {
358 description "Retrieves the schema for the package type";
362 description "Type of the package";
363 type manotypes:package-type;
366 uses manotypes:rpc-project-name;
371 description "List of all top level directories for the package.";
378 description "Creates a new package";
381 uses package-identifer;
382 uses external-url-data;
383 uses manotypes:rpc-project-name;
387 leaf transaction-id {
388 description "Valid ID to track the status of the task";
391 uses manotypes:rpc-project-name;
396 description "Creates a new package";
399 uses package-identifer;
400 uses external-url-data;
401 uses manotypes:rpc-project-name;
405 leaf transaction-id {
406 description "Valid ID to track the status of the task";
409 uses manotypes:rpc-project-name;
414 description "Export a package";
417 uses package-identifer;
418 uses manotypes:rpc-project-name;
421 description "Schema to export";
426 leaf export-grammar {
427 description "Schema to export";
433 description "Format to export";
440 leaf transaction-id {
441 description "Valid ID to track the status of the task";
446 description "Valid ID to track the status of the task";
450 uses manotypes:rpc-project-name;
454 rpc package-file-add {
455 description "Retrieves the file from the URL and store it in the package";
458 uses package-file-identifer;
459 uses external-url-data;
460 uses manotypes:rpc-project-name;
462 choice catalog-type {
465 leaf vnfd-file-type {
466 description "Type of vnfd file being added to the package";
472 description "Type of nsd file being added to the package";
481 description "Valid ID to track the status of the task";
484 uses manotypes:rpc-project-name;
488 rpc package-file-delete {
489 description "Retrieves the file from the URL and store it in the package";
492 uses package-file-identifer;
493 uses manotypes:rpc-project-name;
495 choice catalog-type {
497 leaf vnfd-file-type {
498 description "Type of file being removed from the vnfd package";
504 description "Type of file being removed from the nsd package";
513 description "Status of the delte operation";
518 description "Trace in case of a failure";
522 uses manotypes:rpc-project-name;