'Create an Image.
Create an Image using the parameters supplied in the POST
application/json object. The parameters are:
:param name: the name to give the image
:param description: (optional) description of the image
:param source_type: (required) source type.
current only \'url\' is supported
:param image_url: (required) URL to get the image
:param disk_format: (required) format of the image
:param kernel: (optional) kernel to use for the image
:param ramdisk: (optional) Ramdisk to use for the image
:param architecture: (optional) the Architecture of the image
:param min_disk: (optional) the minimum disk size
for the image to boot with
:param min_ram: (optional) the minimum ram for the image to boot with
:param visibility: (required) takes \'public\', \'private\', and \'shared\'
:param protected: (required) true if the image is protected
:param import_data: (optional) true to copy the image data
to the image service or use it from the current location
Any parameters not listed above will be assigned as custom properties
for the image.
This returns the new image object on success.'

@rest_utils.ajax(data_required=True)
def put(self, request):

    meta = create_image_metadata(request.DATA)
    if request.DATA.get('image_url'):
        if request.DATA.get('import_data'):
            meta['copy_from'] = request.DATA.get('image_url')
        else:
            meta['location'] = request.DATA.get('image_url')
    else:
        meta['data'] = request.DATA.get('data')
    image = api.glance.image_create(request, **meta)
    return rest_utils.CreatedResponse(('/api/glance/images/%s' % image.name), image.to_dict())
