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-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 {
62 "Update model to support projects.";
81 typedef upload-task-status {
84 enum CHECK_IMAGE_EXISTS;
93 grouping image-upload-info {
95 description "The image id that exists in the image catalog";
100 description "The image name that exists in the image catalog";
104 leaf image-checksum {
105 description "The image md5 checksum";
110 grouping upload-task-status {
112 description "The status of the upload task";
113 type upload-task-status;
118 description "Detailed upload status message";
122 leaf progress-percent {
123 description "The image upload progress percentage (0-100)";
129 description "The number of bytes written";
135 description "The total number of bytes to write";
140 leaf bytes_per_second {
141 description "The total number of bytes written per second";
147 description "The image upload start time (unix epoch)";
152 description "The image upload stop time (unix epoch)";
157 grouping upload-task {
159 description "The cloud account to upload the image to";
161 path "../../../../rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
165 uses image-upload-info;
166 uses upload-task-status;
169 augment "/rw-project:project" {
170 container upload-jobs {
171 rwpb:msg-new UploadJobs;
172 description "Image upload jobs";
176 rwpb:msg-new UploadJob;
180 description "Unique image upload job-id";
185 description "Current job status";
190 description "The job start time (unix epoch)";
195 description "The job stop time (unix epoch)";
200 rwpb:msg-new UploadTask;
201 description "The upload tasks that are part of this job";
208 rpc create-upload-job {
210 rwpb:msg-new CreateUploadJob;
212 uses mano-types:rpc-project-name;
214 choice image-selection {
215 case onboarded-image {
216 description "Use an image previously onboarded in the image catalog";
217 container onboarded-image {
218 uses image-upload-info;
223 description "Use an HTTP URL to pull the image from";
225 container external-url {
227 description "The image HTTP URL to pull the image from";
231 uses image-upload-info;
234 description "Format of the Disk";
235 type rwcal:disk-format;
238 leaf container-format {
239 description "Format of the container";
240 type rwcal:container-format;
247 leaf-list cloud-account {
248 description "List of cloud accounts to upload the image to";
250 path "/rw-project:project[rw-project:name=current()/.." +
251 "/project-name]/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
257 rwpb:msg-new CreateUploadJobOutput;
259 description "The upload job-id to cancel";
265 rpc cancel-upload-job {
267 rwpb:msg-new CancelUploadJob;
273 uses mano-types:rpc-project-name;