-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[Python] Add Firehose Basics scenario + Hello #7963
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
scmacdon
wants to merge
11
commits into
main
Choose a base branch
from
codeloom/firehose-basics-20260707
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
b3151fb
feat(firehose): Add Python Basics scenario and Hello example
scmacdon 7b01b27
added spec
scmacdon 610cfc9
fixed issues with the AI generated code
scmacdon d15dfd0
fixed issues with the AI generated code
scmacdon 0afc625
fixed issues with the AI generated code
scmacdon 408f2a2
fixed issues with the AI generated code
scmacdon ac57d51
fixed issues with the AI generated code
scmacdon f4b1e04
Fix review issues: restore metadata, add unit tests, fix lint
brmur 778aff5
Fix remaining AI review items: type annotation, encryption timeout, c…
brmur 04a1b36
Regenerate README with writeme tool (fix Validate WRITEMEs CI)
brmur a709d9b
Regenerate Java, Rust, SAP ABAP firehose READMEs (fix WRITEME CI)
brmur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| # Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """ | ||
| Purpose: Hello Amazon Data Firehose - Lists delivery streams in your account. | ||
| """ | ||
|
|
||
| # snippet-start:[python.example_code.firehose.Hello] | ||
| import boto3 | ||
| from botocore.exceptions import ClientError | ||
|
|
||
|
|
||
| def hello_firehose(firehose_client): | ||
| """ | ||
| Use the AWS SDK for Python (Boto3) to create an Amazon Data Firehose client | ||
| and list delivery streams in your account. This example uses the default | ||
| settings specified in your shared credentials and config files. | ||
|
|
||
| :param firehose_client: A Boto3 Amazon Data Firehose client object. | ||
| """ | ||
| print("Hello, Amazon Data Firehose! Let's list your delivery streams:\n") | ||
| try: | ||
| response = firehose_client.list_delivery_streams(Limit=10) | ||
| stream_names = response.get("DeliveryStreamNames", list()) | ||
| if stream_names: | ||
| print(f" Found {len(stream_names)} delivery stream(s):") | ||
| for name in stream_names: | ||
| print(f" - {name}") | ||
| if response.get("HasMoreDeliveryStreams", False): | ||
| print("\n Note: There are additional delivery streams not shown.") | ||
| else: | ||
| print(" No delivery streams found in the current region.") | ||
| except ClientError as err: | ||
| print( | ||
| f" Couldn't list delivery streams. Error: " | ||
| f"{err.response['Error']['Code']}: {err.response['Error']['Message']}" | ||
| ) | ||
| raise | ||
|
|
||
|
|
||
| if __name__ == "__main__": | ||
| hello_firehose(boto3.client("firehose", region_name="us-east-1")) | ||
| # snippet-end:[python.example_code.firehose.Hello] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.