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 {
72 typedef export-schema {
79 typedef export-grammar {
86 typedef export-format {
93 grouping external-url-data {
95 description "Url to download";
100 description "username if the url uses authentication";
105 description "password if the url uses authentication";
110 grouping package-identifer {
112 description "Type of the package";
113 type manotypes:package-type;
117 description "Id of the package";
122 grouping package-file-identifer {
123 uses package-identifer;
126 description "Relative path in the package";
131 grouping download-task-status {
133 description "The status of the download task";
139 description "Detailed download status message";
143 leaf progress-percent {
144 description "The download progress percentage (0-100)";
149 leaf bytes_downloaded {
150 description "The number of bytes downloaded";
156 description "The total number of bytes to write";
161 leaf bytes_per_second {
162 description "The total number of bytes written per second";
168 description "start time (unix epoch)";
173 description "stop time (unix epoch)";
178 container download-jobs {
179 rwpb:msg-new DownloadJobs;
180 description "Download jobs";
184 rwpb:msg-new DownloadJob;
188 description "Unique UUID";
193 description "URL of the download";
197 uses package-file-identifer;
198 uses download-task-status;
202 rpc get-package-endpoint {
203 description "Retrieves the endpoint for the descriptor";
206 uses package-identifer;
211 description "Endpoint that contains all the package-related data";
217 rpc get-package-schema {
218 description "Retrieves the schema for the package type";
222 description "Type of the package";
223 type manotypes:package-type;
229 description "List of all top level directories for the package.";
236 description "Creates a new package";
239 uses package-identifer;
240 uses external-url-data;
244 leaf transaction-id {
245 description "Valid ID to track the status of the task";
252 description "Creates a new package";
255 uses package-identifer;
256 uses external-url-data;
260 leaf transaction-id {
261 description "Valid ID to track the status of the task";
268 description "Export a package";
271 uses package-identifer;
274 description "Schema to export";
279 leaf export-grammar {
280 description "Schema to export";
286 description "Format to export";
294 leaf transaction-id {
295 description "Valid ID to track the status of the task";
300 description "Valid ID to track the status of the task";
306 rpc package-file-add {
307 description "Retrieves the file from the URL and store it in the package";
310 uses package-file-identifer;
311 uses external-url-data;
316 description "Valid ID to track the status of the task";
322 rpc package-file-delete {
323 description "Retrieves the file from the URL and store it in the package";
326 uses package-file-identifer;
331 description "Status of the delte operation";
336 description "Trace in case of a failure";