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 {
68 import rw-project-mano {
69 prefix "rw-project-mano";
74 "Update model to support projects.";
93 typedef export-schema {
100 typedef export-grammar {
107 typedef export-format {
114 grouping external-url-data {
116 description "Url to download";
121 description "username if the url uses authentication";
126 description "password if the url uses authentication";
131 grouping package-identifer {
133 description "Type of the package";
134 type manotypes:package-type;
138 description "Id of the package";
143 grouping package-file-identifer {
144 uses package-identifer;
147 description "Relative path in the package";
152 grouping download-task-status {
154 description "The status of the download task";
160 description "Detailed download status message";
164 leaf progress-percent {
165 description "The download progress percentage (0-100)";
170 leaf bytes_downloaded {
171 description "The number of bytes downloaded";
177 description "The total number of bytes to write";
182 leaf bytes_per_second {
183 description "The total number of bytes written per second";
189 description "start time (unix epoch)";
194 description "stop time (unix epoch)";
199 grouping copy-task-status {
201 description "The status of the copy task";
207 augment "/rw-project:project" {
208 container download-jobs {
209 rwpb:msg-new DownloadJobs;
210 description "Download jobs";
214 rwpb:msg-new DownloadJob;
218 description "Unique UUID";
223 description "URL of the download";
227 uses package-file-identifer;
228 uses download-task-status;
232 container copy-jobs {
233 rwpb:msg-new CopyJobs;
234 description "Copy jobs";
238 rwpb:msg-new CopyJob;
239 key "transaction-id";
241 leaf transaction-id {
242 description "Unique UUID";
246 uses copy-task-status;
251 rpc get-package-endpoint {
252 description "Retrieves the endpoint for the descriptor";
255 uses package-identifer;
256 uses manotypes:rpc-project-name;
261 description "Endpoint that contains all the package-related data";
268 description "Copies the package specified in input and returns the copied package id";
271 uses package-identifer;
274 description "Name of destination package";
278 uses manotypes:rpc-project-name;
282 leaf transaction-id {
283 description "Valid ID to track the status of the task";
287 uses package-identifer;
291 rpc get-package-schema {
292 description "Retrieves the schema for the package type";
296 description "Type of the package";
297 type manotypes:package-type;
300 uses manotypes:rpc-project-name;
305 description "List of all top level directories for the package.";
312 description "Creates a new package";
315 uses package-identifer;
316 uses external-url-data;
317 uses manotypes:rpc-project-name;
321 leaf transaction-id {
322 description "Valid ID to track the status of the task";
325 uses manotypes:rpc-project-name;
330 description "Creates a new package";
333 uses package-identifer;
334 uses external-url-data;
335 uses manotypes:rpc-project-name;
339 leaf transaction-id {
340 description "Valid ID to track the status of the task";
343 uses manotypes:rpc-project-name;
348 description "Export a package";
351 uses package-identifer;
352 uses manotypes:rpc-project-name;
355 description "Schema to export";
360 leaf export-grammar {
361 description "Schema to export";
367 description "Format to export";
374 leaf transaction-id {
375 description "Valid ID to track the status of the task";
380 description "Valid ID to track the status of the task";
384 uses manotypes:rpc-project-name;
388 rpc package-file-add {
389 description "Retrieves the file from the URL and store it in the package";
392 uses package-file-identifer;
393 uses external-url-data;
394 uses manotypes:rpc-project-name;
399 description "Valid ID to track the status of the task";
402 uses manotypes:rpc-project-name;
406 rpc package-file-delete {
407 description "Retrieves the file from the URL and store it in the package";
410 uses package-file-identifer;
411 uses manotypes:rpc-project-name;
416 description "Status of the delte operation";
421 description "Trace in case of a failure";
425 uses manotypes:rpc-project-name;