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 container download-jobs {
186 rwpb:msg-new DownloadJobs;
187 description "Download jobs";
191 rwpb:msg-new DownloadJob;
195 description "Unique UUID";
200 description "URL of the download";
204 uses package-file-identifer;
205 uses download-task-status;
209 rpc get-package-endpoint {
210 description "Retrieves the endpoint for the descriptor";
213 uses package-identifer;
218 description "Endpoint that contains all the package-related data";
224 rpc get-package-schema {
225 description "Retrieves the schema for the package type";
229 description "Type of the package";
230 type manotypes:package-type;
236 description "List of all top level directories for the package.";
243 description "Creates a new package";
246 uses package-identifer;
247 uses external-url-data;
251 leaf transaction-id {
252 description "Valid ID to track the status of the task";
259 description "Creates a new package";
262 uses package-identifer;
263 uses external-url-data;
267 leaf transaction-id {
268 description "Valid ID to track the status of the task";
275 description "Export a package";
278 uses package-identifer;
281 description "Schema to export";
286 leaf export-grammar {
287 description "Schema to export";
293 description "Format to export";
301 leaf transaction-id {
302 description "Valid ID to track the status of the task";
307 description "Valid ID to track the status of the task";
313 rpc package-file-add {
314 description "Retrieves the file from the URL and store it in the package";
317 uses package-file-identifer;
318 uses external-url-data;
323 description "Valid ID to track the status of the task";
329 rpc package-file-delete {
330 description "Retrieves the file from the URL and store it in the package";
333 uses package-file-identifer;
338 description "Status of the delte operation";
343 description "Trace in case of a failure";