None
Bases: object
Provides retrieval of disk images.
BaseImageService.
download
(image_href, image_file)¶Downloads image to specified location.
Parameters: |
|
---|---|
Raises: | exception.ImageRefValidationFailed. |
Raises: | exception.ImageDownloadFailed. |
BaseImageService.
show
(image_href)¶Get dictionary of image properties.
Parameters: | image_href – Image reference. |
---|---|
Raises: | exception.ImageRefValidationFailed. |
Returns: | dictionary of image properties. It has three of them: ‘size’, ‘updated_at’ and ‘properties’. ‘updated_at’ attribute is a naive UTC datetime object. |
BaseImageService.
validate_href
(image_href)¶Validate image reference.
Parameters: | image_href – Image reference. |
---|---|
Raises: | exception.ImageRefValidationFailed. |
Returns: | Information needed to further operate with an image. |
None
Bases: ironic.common.image_service.BaseImageService
Provides retrieval of disk images available locally on the conductor.
FileImageService.
download
(image_href, image_file)¶Downloads image to specified location.
Parameters: |
|
---|---|
Raises: | exception.ImageRefValidationFailed if source image file doesn’t exist. |
Raises: | exception.ImageDownloadFailed if exceptions were raised while writing to file or creating hard link. |
FileImageService.
show
(image_href)¶Get dictionary of image properties.
Parameters: | image_href – Image reference. |
---|---|
Raises: | exception.ImageRefValidationFailed if image file specified doesn’t exist. |
Returns: | dictionary of image properties. It has three of them: ‘size’, ‘updated_at’ and ‘properties’. ‘updated_at’ attribute is a naive UTC datetime object. |
FileImageService.
validate_href
(image_href)¶Validate local image reference.
Parameters: | image_href – Image reference. |
---|---|
Raises: | exception.ImageRefValidationFailed if source image file doesn’t exist. |
Returns: | Path to image file if it exists. |
None
Bases: ironic.common.image_service.BaseImageService
Provides retrieval of disk images using HTTP.
HttpImageService.
download
(image_href, image_file)[source]¶Downloads image to specified location.
Parameters: |
|
---|---|
Raises: | exception.ImageRefValidationFailed if GET request returned response code not equal to 200. |
Raises: | exception.ImageDownloadFailed if: * IOError happened during file write; * GET request failed. |
HttpImageService.
show
(image_href)[source]¶Get dictionary of image properties.
Parameters: | image_href – Image reference. |
---|---|
Raises: | exception.ImageRefValidationFailed if: * HEAD request failed; * HEAD request returned response code not equal to 200; * Content-Length header not found in response to HEAD request. |
Returns: | dictionary of image properties. It has three of them: ‘size’, ‘updated_at’ and ‘properties’. ‘updated_at’ attribute is a naive UTC datetime object. |
HttpImageService.
validate_href
(image_href, secret=False)[source]¶Validate HTTP image reference.
Parameters: |
|
---|---|
Raises: | exception.ImageRefValidationFailed if HEAD request failed or returned response code not equal to 200. |
Returns: | Response to HEAD request. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.