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 {
52 import rw-project-mano {
53 prefix "rw-project-mano";
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 description "Image upload jobs";
178 description "Unique image upload job-id";
183 description "Current job status";
188 description "The job start time (unix epoch)";
193 description "The job stop time (unix epoch)";
198 description "The upload tasks that are part of this job";
205 rpc create-upload-job {
208 uses mano-types:rpc-project-name;
210 choice image-selection {
211 case onboarded-image {
212 description "Use an image previously onboarded in the image catalog";
213 container onboarded-image {
214 uses image-upload-info;
219 description "Use an HTTP URL to pull the image from";
221 container external-url {
223 description "The image HTTP URL to pull the image from";
227 uses image-upload-info;
230 description "Format of the Disk";
231 type rwcal:disk-format;
234 leaf container-format {
235 description "Format of the container";
236 type rwcal:container-format;
243 leaf-list cloud-account {
244 description "List of cloud accounts to upload the image to";
246 path "/rw-project:project[rw-project:name=current()/.." +
247 "/project-name]/rw-cloud:cloud/rw-cloud:account/rw-cloud:name";
254 description "The upload job-id to cancel";
260 rpc cancel-upload-job {
266 uses mano-types:rpc-project-name;