

# Image and stack log operations
<a name="pc-py-lib-api-logs-image-stack"></a>

**Topics**
+ [`list_image_log_streams`](pc-py-lib-api-logs-image-stack-log-streams.md)
+ [`get_image_log_events`](pc-py-lib-api-logs-image-stack-log-events.md)
+ [`get_image_stack_events`](pc-py-lib-api-logs-image-stack-log-stack-events.md)
+ [`list_official_images`](pc-py-lib-api-logs-list-official-images.md)

# `list_image_log_streams`
<a name="pc-py-lib-api-logs-image-stack-log-streams"></a>

```
list_image_log_streams(image_id, region, next_token)
```

List log streams for an image.Parameters:

**`image_id` (required)**  
The image ID.

**`region`**  
The image AWS Region.

**`next_token`**  
The token for the next set of results.

# `get_image_log_events`
<a name="pc-py-lib-api-logs-image-stack-log-events"></a>

```
get_image_log_events(image_id, log_stream_name, region, next_token, start_from_head, limit, start_time, end_time)
```

Get log events for a given image and log stream.Parameters:

**`image_id` (required)**  
The image ID.

**`log_stream_name` (required)**  
The log stream name.

**`region`**  
The image AWS Region.

**`next_token`**  
The token for the next set of results.

**`start_from_head`**  
If set to `True`, AWS ParallelCluster returns the earliest log events first. If set to `False`, it returns the latest log events first. The default is `False`.

**`limit`**  
The maximum number of log events returned. If you don't specify a value, the maximum is the number of logs that can fit in a response size of 1 MB, up to 10,000 log events.

**`start_time`**  
The start of the time range for log events, expressed in ISO 8601 format; for example, `'2021-01-01T20:00:00Z'`. Events with a timestamp equal to, or later than, this time are included.

**`end_time`**  
The end of the time range for log events, expressed in ISO 8601 format; for example, `'2021-01-01T20:00:00Z'`. Events with a timestamp equal to, or later than, this time are not included.

# `get_image_stack_events`
<a name="pc-py-lib-api-logs-image-stack-log-stack-events"></a>

```
get_image_stack_events(image_id, region, next_token)
```

Get stack events for a given image.Parameters:

**`image_id` (required)**  
The image ID.

**`region`**  
The image AWS Region.

**`next_token`**  
The token for the next set of results.

# `list_official_images`
<a name="pc-py-lib-api-logs-list-official-images"></a>

```
list_official_images(region,os, architecture)
```

Retrieve the list of official AWS ParallelCluster images.Parameters:

**`region`**  
The image AWS Region.

**`os`**  
Filters by operating system distribution. The default is no filtering.

**`architecture`**  
Filters by architecture. The default is no filtering.