3 * Copyright 2016 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 {
79 typedef package-file-type {
90 typedef vnfd-file-type {
101 typedef nsd-file-type {
110 typedef export-schema {
117 typedef export-grammar {
124 typedef export-format {
131 grouping external-url-data {
133 description "Url to download";
138 description "username if the url uses authentication";
143 description "password if the url uses authentication";
148 grouping package-identifer {
150 description "Type of the package";
151 type manotypes:package-type;
155 description "Id of the package";
160 grouping package-file-identifer {
161 uses package-identifer;
164 description "Relative path in the package";
169 grouping download-task-status {
171 description "The status of the download task";
177 description "Detailed download status message";
181 leaf progress-percent {
182 description "The download progress percentage (0-100)";
187 leaf bytes_downloaded {
188 description "The number of bytes downloaded";
194 description "The total number of bytes to write";
199 leaf bytes_per_second {
200 description "The total number of bytes written per second";
206 description "start time (unix epoch)";
211 description "stop time (unix epoch)";
216 grouping copy-task-status {
218 description "The status of the copy task";
224 container download-jobs {
225 rwpb:msg-new DownloadJobs;
226 description "Download jobs";
230 rwpb:msg-new DownloadJob;
234 description "Unique UUID";
239 description "URL of the download";
243 uses package-file-identifer;
244 uses download-task-status;
248 container copy-jobs {
249 rwpb:msg-new CopyJobs;
250 description "Copy jobs";
254 rwpb:msg-new CopyJob;
255 key "transaction-id";
257 leaf transaction-id {
258 description "Unique UUID";
262 uses copy-task-status;
266 rpc get-package-endpoint {
267 description "Retrieves the endpoint for the descriptor";
270 uses package-identifer;
275 description "Endpoint that contains all the package-related data";
282 description "Copies the package specified in input and returns the copied package id";
285 uses package-identifer;
288 description "Name of destination package";
294 leaf transaction-id {
295 description "Valid ID to track the status of the task";
299 uses package-identifer;
303 rpc get-package-schema {
304 description "Retrieves the schema for the package type";
308 description "Type of the package";
309 type manotypes:package-type;
315 description "List of all top level directories for the package.";
322 description "Creates a new package";
325 uses package-identifer;
326 uses external-url-data;
330 leaf transaction-id {
331 description "Valid ID to track the status of the task";
338 description "Creates a new package";
341 uses package-identifer;
342 uses external-url-data;
346 leaf transaction-id {
347 description "Valid ID to track the status of the task";
354 description "Export a package";
357 uses package-identifer;
360 description "Schema to export";
365 leaf export-grammar {
366 description "Schema to export";
372 description "Format to export";
380 leaf transaction-id {
381 description "Valid ID to track the status of the task";
386 description "Valid ID to track the status of the task";
392 rpc package-file-add {
393 description "Retrieves the file from the URL and store it in the package";
396 uses package-file-identifer;
397 uses external-url-data;
399 choice catalog-type {
402 leaf vnfd-file-type {
403 description "Type of vnfd file being added to the package";
409 description "Type of nsd file being added to the package";
419 description "Valid ID to track the status of the task";
425 rpc package-file-delete {
426 description "Retrieves the file from the URL and store it in the package";
429 uses package-file-identifer;
430 choice catalog-type {
432 leaf vnfd-file-type {
433 description "Type of file being removed from the vnfd package";
439 description "Type of file being removed from the nsd package";
449 description "Status of the delte operation";
454 description "Trace in case of a failure";