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 {
56 import rw-project-mano {
57 prefix "rw-project-mano";
66 "Update model to support projects.";
85 typedef upload-task-status {
88 enum CHECK_IMAGE_EXISTS;
97 grouping image-upload-info {
99 description "The image id that exists in the image catalog";
104 description "The image name that exists in the image catalog";
108 leaf image-checksum {
109 description "The image md5 checksum";
114 grouping upload-task-status {
116 description "The status of the upload task";
117 type upload-task-status;
122 description "Detailed upload status message";
126 leaf progress-percent {
127 description "The image upload progress percentage (0-100)";
133 description "The number of bytes written";
139 description "The total number of bytes to write";
144 leaf bytes_per_second {
145 description "The total number of bytes written per second";
151 description "The image upload start time (unix epoch)";
156 description "The image upload stop time (unix epoch)";
161 grouping upload-task {
163 description "The cloud account to upload the image to";
165 path "../../../../rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
169 uses image-upload-info;
170 uses upload-task-status;
173 augment "/rw-project:project" {
174 container upload-jobs {
175 rwpb:msg-new UploadJobs;
176 description "Image upload jobs";
180 rwpb:msg-new UploadJob;
184 description "Unique image upload job-id";
189 description "Current job status";
194 description "The job start time (unix epoch)";
199 description "The job stop time (unix epoch)";
204 rwpb:msg-new UploadTask;
205 description "The upload tasks that are part of this job";
212 rpc create-upload-job {
214 rwpb:msg-new CreateUploadJob;
216 uses mano-types:rpc-project-name;
218 choice image-selection {
219 case onboarded-image {
220 description "Use an image previously onboarded in the image catalog";
221 container onboarded-image {
222 uses image-upload-info;
227 description "Use an HTTP URL to pull the image from";
229 container external-url {
231 description "The image HTTP URL to pull the image from";
235 uses image-upload-info;
238 description "Format of the Disk";
239 type rwcal:disk-format;
242 leaf container-format {
243 description "Format of the container";
244 type rwcal:container-format;
251 leaf-list cloud-account {
252 description "List of cloud accounts to upload the image to";
254 path "/rw-project:project[rw-project:name=current()/.." +
255 "/project-name]/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
261 rwpb:msg-new CreateUploadJobOutput;
263 description "The upload job-id to cancel";
269 rpc cancel-upload-job {
271 rwpb:msg-new CancelUploadJob;
277 uses mano-types:rpc-project-name;