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 export-schema {
86 typedef export-grammar {
93 typedef export-format {
100 grouping external-url-data {
102 description "Url to download";
107 description "username if the url uses authentication";
112 description "password if the url uses authentication";
117 grouping package-identifer {
119 description "Type of the package";
120 type manotypes:package-type;
124 description "Id of the package";
129 grouping package-file-identifer {
130 uses package-identifer;
133 description "Relative path in the package";
138 grouping download-task-status {
140 description "The status of the download task";
146 description "Detailed download status message";
150 leaf progress-percent {
151 description "The download progress percentage (0-100)";
156 leaf bytes_downloaded {
157 description "The number of bytes downloaded";
163 description "The total number of bytes to write";
168 leaf bytes_per_second {
169 description "The total number of bytes written per second";
175 description "start time (unix epoch)";
180 description "stop time (unix epoch)";
185 grouping copy-task-status {
187 description "The status of the copy task";
193 container download-jobs {
194 rwpb:msg-new DownloadJobs;
195 description "Download jobs";
199 rwpb:msg-new DownloadJob;
203 description "Unique UUID";
208 description "URL of the download";
212 uses package-file-identifer;
213 uses download-task-status;
217 container copy-jobs {
218 rwpb:msg-new CopyJobs;
219 description "Copy jobs";
223 rwpb:msg-new CopyJob;
224 key "transaction-id";
226 leaf transaction-id {
227 description "Unique UUID";
231 uses copy-task-status;
235 rpc get-package-endpoint {
236 description "Retrieves the endpoint for the descriptor";
239 uses package-identifer;
244 description "Endpoint that contains all the package-related data";
251 description "Copies the package specified in input and returns the copied package id";
254 uses package-identifer;
257 description "Name of destination package";
263 leaf transaction-id {
264 description "Valid ID to track the status of the task";
268 uses package-identifer;
272 rpc get-package-schema {
273 description "Retrieves the schema for the package type";
277 description "Type of the package";
278 type manotypes:package-type;
284 description "List of all top level directories for the package.";
291 description "Creates a new package";
294 uses package-identifer;
295 uses external-url-data;
299 leaf transaction-id {
300 description "Valid ID to track the status of the task";
307 description "Creates a new package";
310 uses package-identifer;
311 uses external-url-data;
315 leaf transaction-id {
316 description "Valid ID to track the status of the task";
323 description "Export a package";
326 uses package-identifer;
329 description "Schema to export";
334 leaf export-grammar {
335 description "Schema to export";
341 description "Format to export";
349 leaf transaction-id {
350 description "Valid ID to track the status of the task";
355 description "Valid ID to track the status of the task";
361 rpc package-file-add {
362 description "Retrieves the file from the URL and store it in the package";
365 uses package-file-identifer;
366 uses external-url-data;
371 description "Valid ID to track the status of the task";
377 rpc package-file-delete {
378 description "Retrieves the file from the URL and store it in the package";
381 uses package-file-identifer;
386 description "Status of the delte operation";
391 description "Trace in case of a failure";