|
| 1 | +# AWS EC2 API describe-fpga-images |
| 2 | + |
| 3 | +Use `aws ec2 describe-fpga-images` API to get information about all AFIs available to your AWS account. The set of AFIs returned by `describe-fpga-images` includes: |
| 4 | + |
| 5 | +* AFIs owned by your AWS account. |
| 6 | +* AFIs owned by other AWS accounts for which you have been granted load permissions. |
| 7 | +* Public AFIs. |
| 8 | + |
| 9 | +The API provides various filters to get information about specific AFIs. Invoke `aws ec2 describe-fpga-images help` to get an up-to-date list of available filters. See **Example usage** section in this document for common filters. |
| 10 | + |
| 11 | +AFI information is accessible using `describe-fpga-images` immediately after `create-fpga-image` returns with a valid `afiId`. The information provided by `describe-fpga-images` includes AFI states to check the result of the bitstream generation process: |
| 12 | + |
| 13 | +* `pending` AFI bitstream generation is in progress. |
| 14 | +* `available` AFI is available for use by F1 instances. |
| 15 | +* `failed` AFI bitstream generation failed. The `State.Message` field provides the specific error code as described in [create-fpga-image error codes](create_fpga_image_error_codes.md). |
| 16 | +* `unavailable` AFI is no longer available for use by F1 instances. |
| 17 | + |
| 18 | + |
| 19 | +## Example response |
| 20 | + |
| 21 | +The following response shows the AFI information provided by `describe-fpga-images`. The AFIs shown in this case are the public AFIs generated from the example CLs in the HDK. |
| 22 | + |
| 23 | +``` |
| 24 | + { |
| 25 | + "FpgaImages": [ |
| 26 | + { |
| 27 | + "OwnerAlias": "amazon", |
| 28 | + "UpdateTime": "2017-04-19T17:15:26.000Z", |
| 29 | + "Name": "cl_hellow_world_04151701", |
| 30 | + "PciId": { |
| 31 | + "SubsystemVendorId": "0xfedd", |
| 32 | + "VendorId": "0x1d0f", |
| 33 | + "DeviceId": "0xf000", |
| 34 | + "SubsystemId": "0x1d51" |
| 35 | + }, |
| 36 | + "FpgaImageGlobalId": "agfi-0f0e045f919413242", |
| 37 | + "State": { |
| 38 | + "Code": "available" |
| 39 | + }, |
| 40 | + "ShellVersion": "0x04151701", |
| 41 | + "OwnerId": "095707098027", |
| 42 | + "FpgaImageId": "afi-0f0927bc2649e6259", |
| 43 | + "CreateTime": "2017-04-19T17:15:25.000Z", |
| 44 | + "Description": "cl_hello_world for shell 0x04151701" |
| 45 | + }, |
| 46 | + { |
| 47 | + "OwnerAlias": "amazon", |
| 48 | + "UpdateTime": "2017-04-17T15:58:54.000Z", |
| 49 | + "Name": "cl_dram_dma_0415", |
| 50 | + "PciId": { |
| 51 | + "SubsystemVendorId": "0xfedc", |
| 52 | + "VendorId": "0x1d0f", |
| 53 | + "DeviceId": "0xf001", |
| 54 | + "SubsystemId": "0x1d51" |
| 55 | + }, |
| 56 | + "FpgaImageGlobalId": "agfi-0d873e8b409f8e806", |
| 57 | + "State": { |
| 58 | + "Code": "available" |
| 59 | + }, |
| 60 | + "ShellVersion": "0x04151701", |
| 61 | + "OwnerId": "095707098027", |
| 62 | + "FpgaImageId": "afi-06d0ffc989feeea2a", |
| 63 | + "CreateTime": "2017-04-17T15:58:54.000Z", |
| 64 | + "Description": "cl_dram_dma_0415" |
| 65 | + } |
| 66 | + ] |
| 67 | + } |
| 68 | +``` |
| 69 | + |
| 70 | +## Example usage |
| 71 | + |
| 72 | +* Get all AFIs accessible to caller AWS account |
| 73 | +``` |
| 74 | + $ aws ec2 describe-fpga-images |
| 75 | +``` |
| 76 | + |
| 77 | +* Get AFI using specific AFI ID. Information is provided only if caller has access to AFI. |
| 78 | +``` |
| 79 | + $ aws ec2 describe-fpga-images --fpga-image-ids afi-06d0ffc989feeea2a |
| 80 | +``` |
| 81 | + |
| 82 | +* Get multiple AFIs by AFI IDs |
| 83 | +``` |
| 84 | + $ aws ec2 describe-fpga-images --fpga-image-ids afi-06d0ffc989feeea2a afi-0f0927bc2649e6259 |
| 85 | +``` |
| 86 | + |
| 87 | +* Get AFIs owned by caller AWS account. Exludes public AFIs and AFIs with load permissions. |
| 88 | +``` |
| 89 | + $ aws ec2 describe-fpga-images --owners self |
| 90 | +``` |
| 91 | + |
| 92 | +* Get public AFIs owned by Amazon (this is the command use to retrive the example response) |
| 93 | +``` |
| 94 | + $ aws ec2 describe-fpga-images --owners amazon |
| 95 | +``` |
| 96 | + |
| 97 | +* Get AFIs owned by AWS marketplace. |
| 98 | +``` |
| 99 | + $ aws ec2 describe-fpga-images --owners aws-marketplace |
| 100 | +``` |
| 101 | + |
| 102 | +* Get AFIs using explicit AWS account ID. |
| 103 | +``` |
| 104 | + $ aws ec2 describe-fpga-images --owners 095707098027 |
| 105 | +``` |
| 106 | + |
| 107 | +### Use filters parameter |
| 108 | + |
| 109 | +* Get AFIs using various filters |
| 110 | +``` |
| 111 | + # Get AFI by name |
| 112 | + $ aws ec2 describe-fpga-images --filters "Name=name,Values=cl_dram_dma_0415" |
| 113 | +
|
| 114 | + # Get AFIs in 'available' state |
| 115 | + $ aws ec2 describe-fpga-images --filters "Name=state,Values=available" |
| 116 | +
|
| 117 | + # Get AFIs with shell version 0x04151701 |
| 118 | + $ aws ec2 describe-fpga-images --filters "Name=shell-version,Values=0x04151701" |
| 119 | +
|
| 120 | + # Get AFI created at a specific time |
| 121 | + $ aws ec2 describe-fpga-images --filters "Name=create-time,Values=2017-04-17T15:58:54.000Z" |
| 122 | +``` |
| 123 | + |
| 124 | +* Get AFIs using wildcard filters (wildcards only usable in `filters` parameter) |
| 125 | +``` |
| 126 | + # Get AFIs created on 2017-04-17 |
| 127 | + $ aws ec2 describe-fpga-images --filters "Name=create-time,Values=2017-04-17*" |
| 128 | +
|
| 129 | + # Get AFIs if name starts with 'cl_' |
| 130 | + $ aws ec2 describe-fpga-images --filters "Name=name,Values=cl_*" |
| 131 | +
|
| 132 | + # Get AFIs with multiple wildcards |
| 133 | + $ aws ec2 describe-fpga-images --filters "Name=name,Values=*_world_*" |
| 134 | +``` |
| 135 | + |
| 136 | + |
| 137 | +### Combine filters to find groups of AFIs |
| 138 | + |
| 139 | +* Get all failed AFIs owned by caller AWS account |
| 140 | +``` |
| 141 | + $ aws ec2 describe-fpga-images --owners self --filters "Name=state,Values=failed" |
| 142 | +``` |
| 143 | + |
| 144 | +* Multiple filter values are evaluated as `OR` conditions |
| 145 | +``` |
| 146 | + # Get both example AFIs by name |
| 147 | + $ aws ec2 describe-fpga-images --filters "Name=name,Values=cl_dram_dma_0415,cl_hellow_world_04151701" |
| 148 | +
|
| 149 | + # Get AFIs created on 2017-04-17 or 2017-04-19 |
| 150 | + $ aws ec2 describe-fpga-images --filters "Name=create-time,Values=2017-04-17*,2017-04-19*" |
| 151 | +``` |
| 152 | + |
| 153 | +* Multiple filters are evaluated as `AND` conditions |
| 154 | +``` |
| 155 | + # Get AFIs by name AND created on 2017-04-17 |
| 156 | + $ aws ec2 describe-fpga-images --filters "Name=name,Values=cl_dram_dma_0415,cl_hellow_world_04151701" "Name=create-time,Values=2017-04-17*" |
| 157 | +
|
| 158 | + # Same filter can be use multiple times, which can return an empty set |
| 159 | + $ aws ec2 describe-fpga-images --filters "Name=name,Values=cl_dram_dma_0415" "Name=name,Values=cl_hellow_world_04151701" |
| 160 | +``` |
| 161 | + |
| 162 | +## Common Error Messages |
| 163 | + |
| 164 | + |
| 165 | +* Invalid owner ID or filter alias |
| 166 | +``` |
| 167 | + $ aws ec2 describe-fpga-images --owners 12345 |
| 168 | +
|
| 169 | + An error occurred (InvalidUserID.Malformed) when calling the DescribeFpgaImages operation: User ID '12345' is invalid |
| 170 | +``` |
| 171 | + |
| 172 | +* Invalid AFI ID |
| 173 | +``` |
| 174 | + $ aws ec2 describe-fpga-images --fpga-image-ids afi-06d0ffc989feeeXXX |
| 175 | +
|
| 176 | + An error occurred (InvalidFpgaImageID.Malformed) when calling the DescribeFpgaImages operation: Image ID 'afi-06d0ffc989feeeXXX' is invalid |
| 177 | +``` |
| 178 | + |
| 179 | +* AFI ID not found |
| 180 | +``` |
| 181 | + $ aws ec2 describe-fpga-images --fpga-image-ids afi-03d027a3318440a77 |
| 182 | +
|
| 183 | + An error occurred (InvalidFpgaImageID.NotFound) when calling the DescribeFpgaImages operation: Image ID 'afi-03d027a3318440a77' not found |
| 184 | +``` |
| 185 | + |
| 186 | +* Invalid filter name |
| 187 | +``` |
| 188 | + $ aws ec2 describe-fpga-images --filters "Name=bad-filter,Values=value" |
| 189 | +
|
| 190 | + An error occurred (InvalidParameterValue) when calling the DescribeFpgaImages operation: The filter 'bad-filter' is invalid |
| 191 | +``` |
0 commit comments