| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
_doc_url = "https://docs.openstack.org/python-glanceclient/latest/cli/property-keys.html" |
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
_BASE_SCHEMA = { |
| 21 |
"additionalProperties": { |
| 22 |
"type": "string" |
| 23 |
}, |
| 24 |
"name": "image", |
| 25 |
"links": [{ |
| 26 |
"href": "{self}", |
| 27 |
"rel": "self" |
| 28 |
}, { |
| 29 |
"href": "{file}", |
| 30 |
"rel": "enclosure" |
| 31 |
}, { |
| 32 |
"href": "{schema}", |
| 33 |
"rel": "describedby" |
| 34 |
}], |
| 35 |
"properties": { |
| 36 |
"container_format": { |
| 37 |
"enum": [None, "ami", "ari", "aki", "bare", "ovf", "ova", |
| 38 |
"docker"], |
| 39 |
"type": ["null", "string"], |
| 40 |
"description": "Format of the container" |
| 41 |
}, |
| 42 |
"min_ram": { |
| 43 |
"type": "integer", |
| 44 |
"description": "Amount of ram (in MB) required to boot image." |
| 45 |
}, |
| 46 |
"ramdisk_id": { |
| 47 |
"pattern": ("^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}" |
| 48 |
"-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}" |
| 49 |
"-([0-9a-fA-F]){12}$"), |
| 50 |
"type": ["null", "string"], |
| 51 |
"description": ("ID of image stored in Glance that should be " |
| 52 |
"used as the ramdisk when booting an AMI-style " |
| 53 |
"image."), |
| 54 |
"is_base": False |
| 55 |
}, |
| 56 |
"locations": { |
| 57 |
"items": { |
| 58 |
"required": ["url", "metadata"], |
| 59 |
"type": "object", |
| 60 |
"properties": { |
| 61 |
"url": { |
| 62 |
"type": "string", |
| 63 |
"maxLength": 255 |
| 64 |
}, |
| 65 |
"metadata": { |
| 66 |
"type": "object" |
| 67 |
} |
| 68 |
} |
| 69 |
}, |
| 70 |
"type": "array", |
| 71 |
"description": ("A set of URLs to access the image " |
| 72 |
"file kept in external store") |
| 73 |
}, |
| 74 |
"file": { |
| 75 |
"readOnly": True, |
| 76 |
"type": "string", |
| 77 |
"description": "An image file url" |
| 78 |
}, |
| 79 |
"owner": { |
| 80 |
"type": ["null", "string"], |
| 81 |
"description": "Owner of the image", |
| 82 |
"maxLength": 255 |
| 83 |
}, |
| 84 |
"id": { |
| 85 |
"pattern": ("^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}" |
| 86 |
"-([0-9a-fA-F]){4}-([0-9a-fA-F]){4}" |
| 87 |
"-([0-9a-fA-F]){12}$"), |
| 88 |
"type": "string", |
| 89 |
"description": "An identifier for the image" |
| 90 |
}, |
| 91 |
"size": { |
| 92 |
"readOnly": True, |
| 93 |
"type": ["null", "integer"], |
| 94 |
"description": "Size of image file in bytes" |
| 95 |
}, |
| 96 |
"os_distro": { |
| 97 |
"type": "string", |
| 98 |
"description": ("Common name of operating system distribution " |
| 99 |
"as specified in %s" % _doc_url), |
| 100 |
"is_base": False |
| 101 |
}, |
| 102 |
"self": { |
| 103 |
"readOnly": True, |
| 104 |
"type": "string", |
| 105 |
"description": "An image self url" |
| 106 |
}, |
| 107 |
"disk_format": { |
| 108 |
"enum": [None, "ami", "ari", "aki", "vhd", "vhdx", "vmdk", "raw", |
| 109 |
"qcow2", "vdi", "iso", "ploop"], |
| 110 |
"type": ["null", "string"], |
| 111 |
"description": "Format of the disk" |
| 112 |
}, |
| 113 |
"os_version": { |
| 114 |
"type": "string", |
| 115 |
"description": "Operating system version as specified by the" |
| 116 |
" distributor", |
| 117 |
"is_base": False |
| 118 |
}, |
| 119 |
"direct_url": { |
| 120 |
"readOnly": True, |
| 121 |
"type": "string", |
| 122 |
"description": "URL to access the image file kept in external" |
| 123 |
" store" |
| 124 |
}, |
| 125 |
"schema": { |
| 126 |
"readOnly": True, |
| 127 |
"type": "string", |
| 128 |
"description": "An image schema url" |
| 129 |
}, |
| 130 |
"status": { |
| 131 |
"readOnly": True, |
| 132 |
"enum": ["queued", "saving", "active", "killed", |
| 133 |
"deleted", "uploading", "importing", |
| 134 |
"pending_delete", "deactivated"], |
| 135 |
"type": "string", |
| 136 |
"description": "Status of the image" |
| 137 |
}, |
| 138 |
"tags": { |
| 139 |
"items": { |
| 140 |
"type": "string", |
| 141 |
"maxLength": 255 |
| 142 |
}, |
| 143 |
"type": "array", |
| 144 |
"description": "List of strings related to the image" |
| 145 |
}, |
| 146 |
"kernel_id": { |
| 147 |
"pattern": "^([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA-F])" |
| 148 |
"{4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12}$", |
| 149 |
"type": ["null", "string"], |
| 150 |
"description": "ID of image stored in Glance that should be " |
| 151 |
"used as the kernel when booting an " |
| 152 |
"AMI-style image.", |
| 153 |
"is_base": False |
| 154 |
}, |
| 155 |
"visibility": { |
| 156 |
"enum": ["public", "private", "community", "shared"], |
| 157 |
"type": "string", |
| 158 |
"description": "Scope of image accessibility" |
| 159 |
}, |
| 160 |
"updated_at": { |
| 161 |
"readOnly": True, |
| 162 |
"type": "string", |
| 163 |
"description": "Date and time of the last image modification" |
| 164 |
}, |
| 165 |
"min_disk": { |
| 166 |
"type": "integer", |
| 167 |
"description": "Amount of disk space (in GB) required to boot " |
| 168 |
"image." |
| 169 |
}, |
| 170 |
"virtual_size": { |
| 171 |
"readOnly": True, |
| 172 |
"type": ["null", "integer"], |
| 173 |
"description": "Virtual size of image in bytes" |
| 174 |
}, |
| 175 |
"instance_uuid": { |
| 176 |
"type": "string", |
| 177 |
"description": "Metadata which can be used to record which " |
| 178 |
"instance this image is associated with. " |
| 179 |
"(Informational only, does not create an " |
| 180 |
"instance snapshot.)", |
| 181 |
"is_base": False |
| 182 |
}, |
| 183 |
"name": { |
| 184 |
"type": ["null", "string"], |
| 185 |
"description": "Descriptive name for the image", |
| 186 |
"maxLength": 255 |
| 187 |
}, |
| 188 |
"checksum": { |
| 189 |
"readOnly": True, |
| 190 |
"type": ["null", "string"], |
| 191 |
"description": "md5 hash of image contents.", |
| 192 |
"maxLength": 32 |
| 193 |
}, |
| 194 |
"os_hash_algo": { |
| 195 |
"readOnly": True, |
| 196 |
"type": ["null", "string"], |
| 197 |
"description": "Algorithm to calculate os_hash_value", |
| 198 |
"maxLength": 32 |
| 199 |
}, |
| 200 |
"os_hash_value": { |
| 201 |
"readOnly": True, |
| 202 |
"type": ["null", "string"], |
| 203 |
"description": "Hexdigest of the image contents using the " |
| 204 |
"algorithm specified by the os_hash_algo", |
| 205 |
"maxLength": 32 |
| 206 |
}, |
| 207 |
"created_at": { |
| 208 |
"readOnly": True, |
| 209 |
"type": "string", |
| 210 |
"description": "Date and time of image registration" |
| 211 |
}, |
| 212 |
"protected": { |
| 213 |
"type": "boolean", |
| 214 |
"description": "If true, image will not be deletable." |
| 215 |
}, |
| 216 |
"os_hidden": { |
| 217 |
"type": "boolean", |
| 218 |
"description": "If true, image will not appear in default " |
| 219 |
"image list response." |
| 220 |
}, |
| 221 |
"architecture": { |
| 222 |
"type": "string", |
| 223 |
"description": ("Operating system architecture as specified " |
| 224 |
"in %s" % _doc_url), |
| 225 |
"is_base": False |
| 226 |
} |
| 227 |
} |
| 228 |
} |