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 {
62 "Update model to support projects.";
81 typedef export-schema {
88 typedef export-grammar {
95 typedef export-format {
102 grouping external-url-data {
104 description "Url to download";
109 description "username if the url uses authentication";
114 description "password if the url uses authentication";
119 grouping package-identifer {
121 description "Type of the package";
122 type manotypes:package-type;
126 description "Id of the package";
131 grouping package-file-identifer {
132 uses package-identifer;
135 description "Relative path in the package";
140 grouping download-task-status {
142 description "The status of the download task";
148 description "Detailed download status message";
152 leaf progress-percent {
153 description "The download progress percentage (0-100)";
158 leaf bytes_downloaded {
159 description "The number of bytes downloaded";
165 description "The total number of bytes to write";
170 leaf bytes_per_second {
171 description "The total number of bytes written per second";
177 description "start time (unix epoch)";
182 description "stop time (unix epoch)";
187 augment "/rw-project:project" {
188 container download-jobs {
189 rwpb:msg-new DownloadJobs;
190 description "Download jobs";
194 rwpb:msg-new DownloadJob;
198 description "Unique UUID";
203 description "URL of the download";
207 uses package-file-identifer;
208 uses download-task-status;
213 rpc get-package-endpoint {
214 description "Retrieves the endpoint for the descriptor";
217 uses package-identifer;
223 description "Endpoint that contains all the package-related data";
229 rpc get-package-schema {
230 description "Retrieves the schema for the package type";
234 description "Type of the package";
235 type manotypes:package-type;
238 uses manotypes:rpc-project-name;
243 description "List of all top level directories for the package.";
250 description "Creates a new package";
253 uses package-identifer;
254 uses external-url-data;
255 uses manotypes:rpc-project-name;
259 leaf transaction-id {
260 description "Valid ID to track the status of the task";
267 description "Creates a new package";
270 uses package-identifer;
271 uses external-url-data;
272 uses manotypes:rpc-project-name;
276 leaf transaction-id {
277 description "Valid ID to track the status of the task";
284 description "Export a package";
287 uses package-identifer;
288 uses manotypes:rpc-project-name;
291 description "Schema to export";
296 leaf export-grammar {
297 description "Schema to export";
303 description "Format to export";
310 leaf transaction-id {
311 description "Valid ID to track the status of the task";
316 description "Valid ID to track the status of the task";
322 rpc package-file-add {
323 description "Retrieves the file from the URL and store it in the package";
326 uses package-file-identifer;
327 uses external-url-data;
328 uses manotypes:rpc-project-name;
333 description "Valid ID to track the status of the task";
339 rpc package-file-delete {
340 description "Retrieves the file from the URL and store it in the package";
343 uses package-file-identifer;
344 uses manotypes:rpc-project-name;
349 description "Status of the delte operation";
354 description "Trace in case of a failure";