Return a list of the images that are on the provider
558761
def avail_images(call=None):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )

    fetch = True
    page = 1
    ret = {}

    while fetch:
        items = query(method='images', command='?page=' + six.text_type(page) + '&per_page=200')

        for image in items['images']:
            ret[image['name']] = {}
            for item in six.iterkeys(image):
                ret[image['name']][item] = image[item]

        page += 1
        try:
            fetch = 'next' in items['links']['pages']
        except KeyError:
            fetch = False

    return ret
243437
def current_arg_images(self) -> List[str]:
        
        if self._current_arg_images is None:
            self._current_arg_images = [
                s.data['url'] for s in Message(self.current_arg)
                if s.type == 'image' and 'url' in s.data
            ]
        return self._current_arg_images
250178
def list_assets(self):
        
        response = self.requests_session.get(self._base_url).content
        if not response:
            return {}

        try:
            asset_list = json.loads(response)
        except TypeError:
            asset_list = None
        except ValueError:
            raise ValueError(response.decode('UTF-8'))

        if not asset_list:
            return []

        if 'ids' in asset_list:
            return asset_list['ids']
        return []
613783
def image_get(request, image_id):
    """"""
    image = glanceclient(request).images.get(image_id)
    return Image(image)
817654
def list(self, options=None, **kwds):
        
        option_string = self._build_option_string(options)
        photos = self._client.get("/photos%s/list.json" % option_string,
                                  **kwds)["result"]
        photos = self._result_to_list(photos)
        return [Photo(self._client, photo) for photo in photos]
166859
def avail_images(call=None, location='local'):
    '''
    
    '''
    if call == 'action':
        raise SaltCloudSystemExit(
            'The avail_images function must be called with '
            '-f or --function, or with the --list-images option'
        )

    ret = {}
    for host_name, host_details in six.iteritems(avail_locations()):
        for item in query('get', 'nodes/{0}/storage/{1}/content'.format(host_name, location)):
            ret[item['volid']] = item
    return ret
1158314
def image_show(self, image_id):
        '''
        
        '''
        nt_ks = self.compute_conn
        image = nt_ks.images.get(image_id)
        links = {}
        for link in image.links:
            links[link['rel']] = link['href']
        ret = {
            'name': image.name,
            'id': image.id,
            'status': image.status,
            'progress': image.progress,
            'created': image.created,
            'updated': image.updated,
            'metadata': image.metadata,
            'links': links,
        }
        if hasattr(image, 'minDisk'):
            ret['minDisk'] = image.minDisk
        if hasattr(image, 'minRam'):
            ret['minRam'] = image.minRam

        return ret
1145465
def images():
    
    if request.method == 'POST':
        file_upload = request.files['file']
        if file_upload:
            image = dict()
            image['filename'] = secure_filename(file_upload.filename)
            full_path = os.path.join(session['img_input_dir'],
                                     image['filename'])
            file_upload.save(full_path)
            image['uid'] = session['image_uid_counter']
            session['image_uid_counter'] += 1
            current_app.logger.debug('File %d is saved as %s',
                                     image['uid'],
                                     image['filename'])
            session['image_list'].append(image)
            return jsonify(ok="true", file=image['filename'], uid=image['uid'])
        return jsonify(ok="false")
    if request.method == 'GET':
        return jsonify(images=session['image_list'])
1152004
def get_image_files(c:PathOrStr, check_ext:bool=True, recurse=False)->FilePathList:
    ""
    return get_files(c, extensions=(image_extensions if check_ext else None), recurse=recurse)
6935
def image_list(self, name=None):
        '''
        
        '''
        nt_ks = self.compute_conn
        ret = {}
        for image in nt_ks.images.list():
            links = {}
            for link in image.links:
                links[link['rel']] = link['href']
            ret[image.name] = {
                'name': image.name,
                'id': image.id,
                'status': image.status,
                'progress': image.progress,
                'created': image.created,
                'updated': image.updated,
                'metadata': image.metadata,
                'links': links,
            }
            if hasattr(image, 'minDisk'):
                ret[image.name]['minDisk'] = image.minDisk
            if hasattr(image, 'minRam'):
                ret[image.name]['minRam'] = image.minRam
        if name:
            return {name: ret[name]}
        return ret
573086
def images(self, type):
        
        images = []

        res = yield from self.http_query("GET", "/{}/images".format(type), timeout=None)
        images = res.json

        try:
            if type in ["qemu", "dynamips", "iou"]:
                for local_image in list_images(type):
                    if local_image['filename'] not in [i['filename'] for i in images]:
                        images.append(local_image)
                images = sorted(images, key=itemgetter('filename'))
            else:
                images = sorted(images, key=itemgetter('image'))
        except OSError as e:
            raise ComputeError("Can't list images: {}".format(str(e)))
        return images
854102
def images(self):
        
        req = self.request(self.mist_client.uri+'/clouds/'+self.id+'/images')
        images = req.get().json()
        return images
998049
def image_list(auth=None, **kwargs):
    '''
    
    '''
    cloud = get_operator_cloud(auth)
    kwargs = _clean_kwargs(**kwargs)
    return cloud.list_images(**kwargs)
1234554
def get_images(self, limit=None):
        """"""
        url = (self._imgur._base_url + "/3/account/{0}/"
               "images/{1}".format(self.name, '{}'))
        resp = self._imgur._send_request(url, limit=limit)
        return [Image(img, self._imgur) for img in resp]
405500
def list_all(self, name=None, visibility=None, member_status=None,
            owner=None, tag=None, status=None, size_min=None, size_max=None,
            sort_key=None, sort_dir=None):
        

        def strip_version(uri):
            """
            The 'next' uri contains a redundant version number. We need to
            strip it to use in the method_get() call.
            """
            pos = uri.find("/images")
            return uri[pos:]

        obj_class = self.resource_class
        resp, resp_body = self.list(name=name, visibility=visibility,
                member_status=member_status, owner=owner, tag=tag,
                status=status, size_min=size_min, size_max=size_max,
                sort_key=sort_key, sort_dir=sort_dir, return_raw=True)
        data = resp_body.get(self.plural_response_key, resp_body)
        next_uri = strip_version(resp_body.get("next", ""))
        ret = [obj_class(manager=self, info=res) for res in data if res]
        while next_uri:
            resp, resp_body = self.api.method_get(next_uri)
            data = resp_body.get(self.plural_response_key, resp_body)
            next_uri = strip_version(resp_body.get("next", ""))
            ret.extend([obj_class(manager=self, info=res)
                    for res in data if res])
        return ret
1045045
def list(self, device_path, timeout_ms=None):
    """"""
    return self.filesync_service.list(
        device_path, timeouts.PolledTimeout.from_millis(timeout_ms))
86182
def list_images(call=None, kwargs=None):
    '''
    
    '''
    if call != 'function':
        raise SaltCloudSystemExit(
            'The list_images function must be called with '
            '-f or --function.'
        )

    if not version_compatible('4.0'):
        raise SaltCloudNotFound(
            "The 'image_alias' feature requires the profitbricks "
            "SDK v4.0.0 or greater."
        )

    ret = {}
    conn = get_conn()

    if kwargs.get('location') is not None:
        item = conn.get_location(kwargs.get('location'), 3)
        ret[item['id']] = {'image_alias': item['properties']['imageAliases']}
        return ret

    for item in conn.list_locations(3)['items']:
        ret[item['id']] = {'image_alias': item['properties']['imageAliases']}

    return ret