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-image-mgmt.yang
22 * @author Austin Cormier
24 * @brief Image Management Yang
29 namespace "http://riftio.com/ns/riftware-1.0/rw-image-mgmt";
30 prefix "rw-image-mgmt";
32 import ietf-yang-types {
68 typedef upload-task-status {
71 enum CHECK_IMAGE_EXISTS;
80 grouping image-upload-info {
82 description "The image id that exists in the image catalog";
87 description "The image name that exists in the image catalog";
92 description "The image md5 checksum";
97 grouping upload-task-status {
99 description "The status of the upload task";
100 type upload-task-status;
105 description "Detailed upload status message";
109 leaf progress-percent {
110 description "The image upload progress percentage (0-100)";
116 description "The number of bytes written";
122 description "The total number of bytes to write";
127 leaf bytes_per_second {
128 description "The total number of bytes written per second";
134 description "The image upload start time (unix epoch)";
139 description "The image upload stop time (unix epoch)";
144 grouping upload-task {
146 description "The cloud account to upload the image to";
148 path "/rwcloud:cloud/rwcloud:account/rwcloud:name";
152 uses image-upload-info;
153 uses upload-task-status;
156 container upload-jobs {
157 rwpb:msg-new UploadJobs;
158 description "Image upload jobs";
162 rwpb:msg-new UploadJob;
166 description "Unique image upload job-id";
171 description "Current job status";
176 description "The job start time (unix epoch)";
181 description "The job stop time (unix epoch)";
186 rwpb:msg-new UploadTask;
187 description "The upload tasks that are part of this job";
193 rpc create-upload-job {
195 rwpb:msg-new CreateUploadJob;
197 choice image-selection {
198 case onboarded-image {
199 description "Use an image previously onboarded in the image catalog";
200 container onboarded-image {
201 uses image-upload-info;
206 description "Use an HTTP URL to pull the image from";
208 container external-url {
210 description "The image HTTP URL to pull the image from";
214 uses image-upload-info;
217 description "Format of the Disk";
218 type rwcal:disk-format;
221 leaf container-format {
222 description "Format of the container";
223 type rwcal:container-format;
230 leaf-list cloud-account {
231 description "List of cloud accounts to upload the image to";
233 path "/rwcloud:cloud/rwcloud:account/rwcloud:name";
239 rwpb:msg-new CreateUploadJobOutput;
241 description "The upload job-id to cancel";
247 rpc cancel-upload-job {
249 rwpb:msg-new CancelUploadJob;