Images
CREATE
Creating a new image.
Create and Upload in One Step
You can also create an image and upload the file content in a single operation by providing the filepath parameter to create():
GET
Retrieve a specific Image
List/Filter/Order/Search an iterable of Images
We can query for images with specific characteristics.
UPDATE
Update specific fields on an individual image.
UPLOAD FILE CONTENT
Upload the file content of the image (e.g. and cumulus-vx-1.2.3.iso) to Air.
Reset/clear the file content associated with an Image
If you want to upload different content to the image you must first call clear_upload to clear the uploaded content currently associated with the image. This step is in place to protect currently uploaded images.
Parallel uploads for large files
For large files, you can speed up uploads by using multiple parallel workers. The SDK automatically chunks files into ~100MB parts and uploads them to S3.
Verifying / Checking Image Content
There are two ways to verify the content of an uploaded image.
- Compare the
hashof an image with the hash of a local file - Download the contents of the uploaded image and inspect the contents
1. Comparing hashes
An Image will have a populated hash when the Image has an associated file upload. This hash is the SHA256 hash of the file calculated using the air_sdk.utils.sha256_file method.
If you have a file locally, you can use this sha256_file method to determine your local hash and can compare this to the hash associated with the Image instance to see if the contents are identical.
2. Download the file contents
If you have permission to perform this operation, you can download the contents of the image to a local file and inspect its contents.
DELETE
Delete an image