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 {
60 import rw-project-mano {
61 prefix "rw-project-mano";
66 "Update model to support projects.";
85 typedef export-schema {
92 typedef export-grammar {
99 typedef export-format {
106 grouping external-url-data {
108 description "Url to download";
113 description "username if the url uses authentication";
118 description "password if the url uses authentication";
123 grouping package-identifer {
125 description "Type of the package";
126 type manotypes:package-type;
130 description "Id of the package";
135 grouping package-file-identifer {
136 uses package-identifer;
139 description "Relative path in the package";
144 grouping download-task-status {
146 description "The status of the download task";
152 description "Detailed download status message";
156 leaf progress-percent {
157 description "The download progress percentage (0-100)";
162 leaf bytes_downloaded {
163 description "The number of bytes downloaded";
169 description "The total number of bytes to write";
174 leaf bytes_per_second {
175 description "The total number of bytes written per second";
181 description "start time (unix epoch)";
186 description "stop time (unix epoch)";
191 augment "/rw-project:project" {
192 container download-jobs {
193 rwpb:msg-new DownloadJobs;
194 description "Download jobs";
198 rwpb:msg-new DownloadJob;
202 description "Unique UUID";
207 description "URL of the download";
211 uses package-file-identifer;
212 uses download-task-status;
217 rpc get-package-endpoint {
218 description "Retrieves the endpoint for the descriptor";
221 uses package-identifer;
227 description "Endpoint that contains all the package-related data";
233 rpc get-package-schema {
234 description "Retrieves the schema for the package type";
238 description "Type of the package";
239 type manotypes:package-type;
242 uses manotypes:rpc-project-name;
247 description "List of all top level directories for the package.";
254 description "Creates a new package";
257 uses package-identifer;
258 uses external-url-data;
259 uses manotypes:rpc-project-name;
263 leaf transaction-id {
264 description "Valid ID to track the status of the task";
267 uses manotypes:rpc-project-name;
272 description "Creates a new package";
275 uses package-identifer;
276 uses external-url-data;
277 uses manotypes:rpc-project-name;
281 leaf transaction-id {
282 description "Valid ID to track the status of the task";
285 uses manotypes:rpc-project-name;
290 description "Export a package";
293 uses package-identifer;
294 uses manotypes:rpc-project-name;
297 description "Schema to export";
302 leaf export-grammar {
303 description "Schema to export";
309 description "Format to export";
316 leaf transaction-id {
317 description "Valid ID to track the status of the task";
322 description "Valid ID to track the status of the task";
326 uses manotypes:rpc-project-name;
330 rpc package-file-add {
331 description "Retrieves the file from the URL and store it in the package";
334 uses package-file-identifer;
335 uses external-url-data;
336 uses manotypes:rpc-project-name;
341 description "Valid ID to track the status of the task";
344 uses manotypes:rpc-project-name;
348 rpc package-file-delete {
349 description "Retrieves the file from the URL and store it in the package";
352 uses package-file-identifer;
353 uses manotypes:rpc-project-name;
358 description "Status of the delte operation";
363 description "Trace in case of a failure";
367 uses manotypes:rpc-project-name;